The known path is three steps long (i.e. contains four vertices) while the paths returned by all_shortest_paths are only two steps long. Is there any way of extending the cut off criterion for all_shortest_paths so that it would return the known path too? My problem with the graph.edge(u,v) function for me in this case is the fact that in many cases I have multiple edges connecting two given vertices. Each edge has a unique ID allowing me to link it back to an entry in an external database. Though it is of interest to me which vertices lie along the path when I run all_shortest_paths what I really am after are the IDs associated to the edges along the path. It seems to me as if graph.edge(u,v) only returns one edge when called. So when I have twenty edges that each link u and v I am not sure yet how I can access the other edges to obtain their IDs. I could presumably note down the edge and then delete it and then rerun graph.edge but that probably is not the most ideal way. Best, Philipp -----Original Message----- From: graph-tool [mailto:graph-tool-bounces@skewed.de] On Behalf Of Tiago de Paula Peixoto Sent: 09 March 2016 21:22 To: graph-tool@skewed.de Subject: Re: [graph-tool] How is all_shortest_paths defined? On 09.03.2016 22:17, Philipp-Maximilian Jacob wrote:
When I however run all_shortest_paths(g,source,target) this path is not part of the results set. Why is that?
The function finds all _shortest_ paths, not all paths. Are you sure the known path belong to the shortest set?
Finally, is it possible to also obtain an edge descriptor as a result? Currently I think the documentation states that the result is an iterator over the sequence of vertices from source to target.
You can get the edge between any two vertices u and v by calling the Graph.edge(u, v) function. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de> _______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool