Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Sumolib : Find Alternate routes and route wise total length

Hi Bijal,

your question is not really a SUMO question.
What you are looking for is the answer for a question like
python find all path between two nodes in a graph
If you enter this question in your favorite search machine you get as one of the results this page


You have to replace a line like for i in self.graph[u]: with a call to your graph implementation to figure out all outgoing edges.
Add the length of the path so far as last parameter to the recursive function
printAllPathsUtil

Regards
Harald

Am 16.05.19 um 12:39 schrieb Bijal:
Dear Listing,

I am using Sumolib. [Converted net file to graph]. 

My question : How to get the list of the alternate possible routes from Source node to destination node.

Moreover this i need to know the total length of the edges [edge.getLength()] for each routes,source to Destination. [So that i can identify that the route which i am getting through my algorithm, is shortest or not]

For example Output for Source node: 2 to  Destination node:9 should look like this :

2-3-8-9 : Total Length = 400mtr
2-4-5-3-9 :Total Length = 300mtr Etc..

Please help me to get this information out of the graph.

--
:)
Bijal Varia

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user



Back to the top