Unverified Commit d9708f38 authored by Morten Knutsen's avatar Morten Knutsen Committed by GitHub
Browse files

Merge pull request #2 from he32/new-networx

Work also with newer networkx (tested with 2.1).
parents a2cf8a09 a528cd88
......@@ -1504,7 +1504,7 @@ class Simulation:
self.graph.add_node(router)
for (u, v, w) in edges:
self.graph.add_edge(u, v, w)
self.graph.add_edge(u, v, **w)
del self.changes[idx]
......
......@@ -85,9 +85,9 @@ def parse_pajek(lines):
edge_data.update(extra_attr)
if G.has_edge(u,v):
if G[u][v]['value'] > float(w):
G.add_edge(u,v,edge_data)
G.add_edge(u,v,**edge_data)
else:
G.add_edge(u,v,edge_data)
G.add_edge(u,v,**edge_data)
if not G.name:
raise Exception("No graph definition found")
if len(G.nodes()) == 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment