vlarmet / cppRouting

Algorithms for Routing and Solving the Traffic Assignment Problem
109 stars 9 forks source link

Repeated edges in traffic assignment output (Algorithm B)? #26

Closed finnwiz closed 1 week ago

finnwiz commented 1 week ago

Hi there,

Firstly, thank you for this extraordinary library. Documentation is great; and we're using it in a project.

Secondly, perhaps I'm misunderstanding something, but when I use assign_traffic according to:

traffic <- assign_traffic(Graph = sgr,
                          from = od_df$from,
                          to = od_df$to,
                          demand = od_df$tons,
                          max_gap = max_gap,
                          algorithm = "dial",
                          verbose = TRUE,
                          aon_method="d",
                          max_it=max_iterations)

The output file (which I'm writing to parquet), actually has edges with repeated vertices. That is, I see:

2024-10-26_11-49-51

Is this behavior expected? Do I need to aggregate the traffic output before using? Are there requirements on the input network dataframe ordering that are leading to this unexpected outcome? Appreciate any guidance and thank you in advance for the help!

finnwiz commented 1 week ago

Well. Writing down my question made me re-examine my graph, which I've erroneously constructed as a multi-digraph. My fault! Closing but thanks again.