Re: [sage-support] List all shortest paths between two vertices in a graph

2021-08-25 Thread Beth Claire
Thanks, that does exactly what I needed! It is significantly faster and uses significantly less memory. --Beth On Wednesday, August 25, 2021 at 6:33:36 AM UTC-5 Jean-Florent Raymond wrote: > Hello, > > The function shortest_simple_paths returns an iterator with paths sorted > by increasing len

Re: [sage-support] List all shortest paths between two vertices in a graph

2021-08-25 Thread Jean-Florent Raymond
Hello, The function shortest_simple_paths returns an iterator with paths sorted by increasing length. Therefore if you only want paths of minimum length, you can iterate over the result of shortest_simple_paths and stop as soon as you encounter a longer path. That way you do not iterate over all t

[sage-support] List all shortest paths between two vertices in a graph

2021-08-23 Thread Beth Claire
Hi, Given an undirected graph G, and two vertices u and v of G, I want to list all paths from u to v with a length of d_G(u,v). The built-in function shortest_simple_paths