def _make_diff(old, new, both):
<EOL>diff_edges = new.copy()<EOL>not_different = [tuple(edge) for edge in both]<EOL>diff_edges.remove_edges_from(not_different)<EOL>diff_nodes = new.copy()<EOL>not_different = []<EOL>for new_node in new.nodes():<EOL><INDENT>if new_node in old.nodes():<EOL><INDENT>not_different.append(new_node)<EOL><DEDENT><DEDENT>diff_nodes.remove_nodes_from(not_different)<EOL>return diff_nodes, diff_edges<EOL>
calculates differences between topologies 'old' and 'new'
returns a tuple with two network graph objects
the first graph contains the added nodes, the secnod contains the added links