Skip to content

Commit

Permalink
Prevent deadend removal + graph compression introducing simple loops (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Moss authored Mar 13, 2024
1 parent f0c0b14 commit 7fdab2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aequilibrae/paths/graph_building.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ def build_compressed_graph(graph):
"link_id": np.arange(slink),
}
)

# Link compression can introduce new simple cycles into the graph
comp_lnk = comp_lnk[comp_lnk.a_node != comp_lnk.b_node]

max_link_id = link_id_max * 10
comp_lnk.link_id += max_link_id

Expand Down

0 comments on commit 7fdab2d

Please sign in to comment.