# How is all_shortest_paths defined?

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?

So, you want a function that returns all shortest paths to return a path
that is not the shortest one?

There is no "cut off criterion"... The algorithm finds the shortest
paths, which in this case are paths of length two.

It seems to me as if graph.edge(u,v) only returns one edge when
called.

Please take a more careful look at the documentation:

Note what it says about the "all_edges" argument:

"If all_edges=True then a list is returned with all the parallel
edges from s to t, otherwise only one edge is returned."

Best,
Tiago

Yes and no. What I am really after is an algorithm that returns me all paths connecting two given nodes up to a certain path length as I want to then analyse this result set further to analyse how "efficient" a given path is.

For me there is some correlation between path length and efficiency, however, the shortest path may not necessarily be the most efficient path so I need to define the result set that I feed into my analysis slightly wider than just the list of shortest paths. In this case I may be interested in e.g. all paths of length 3, 4, and 5.

I realise that returning all paths connecting two nodes may lead to combinatorial explosion in some cases but is it possible to get graph-tool to return all paths up to a certain length?

Thank you for pointing me towards that documentation entry - I should indeed clearly have read it more carefully.

Best wishes,

Philipp