Skip to content
Snippets Groups Projects
Commit d2d333d8 authored by markn92's avatar markn92
Browse files

fix

parent f2fc90e2
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ def contract_graph(G: nx.Graph, charging_stations: Set[Node], capacity: SoC, ...@@ -62,7 +62,7 @@ def contract_graph(G: nx.Graph, charging_stations: Set[Node], capacity: SoC,
for cs in list(charging_stations): for cs in list(charging_stations):
H.add_node(cs, **G.nodes[cs]) H.add_node(cs, **G.nodes[cs])
# Iterate unvisited charging stations # Iterate unvisited charging stations
for n_cs in [n for n in charging_stations if (n, cs) not in H.edges]: for n_cs in [n for n in charging_stations if (n, cs) not in H.edges and n != cs]:
min_path: Path = dist(G, cs, n_cs) min_path: Path = dist(G, cs, n_cs)
consumption: SoC = fold_path(G, min_path, weight=CONSUMPTION_KEY) consumption: SoC = fold_path(G, min_path, weight=CONSUMPTION_KEY)
if consumption <= capacity: if consumption <= capacity:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment