Re: [sage-support] edges in graphs

2011-02-05 Thread Johannes
I just checked the shortes_path method and it wents many times faster. thnx. Am 05.02.2011 08:08, schrieb Nathann Cohen: > >> >> Of course finding the shortest path may be (almost) as expensive as >> finding all of them... If you're doing this for a lot of edges you >> might want to break it up in

Re: [sage-support] edges in graphs

2011-02-04 Thread Nathann Cohen
> > Of course finding the shortest path may be (almost) as expensive as > finding all of them... If you're doing this for a lot of edges you > might want to break it up into components, then the test would be > easy. It would be cool if all_paths were an iterator and you could > just ask for the f

Re: [sage-support] edges in graphs

2011-02-04 Thread Robert Bradshaw
On Fri, Feb 4, 2011 at 3:26 PM, Mike Hansen wrote: > On Fri, Feb 4, 2011 at 11:56 PM, Johannes wrote: >> Hi list >> how can i add a new edge (a->b) to a given graph G (n.n. connected), >> just in the case that there is no path (a -> ... -> b) before? > > You should use "shortest_path" which uses

Re: [sage-support] edges in graphs

2011-02-04 Thread Mike Hansen
On Fri, Feb 4, 2011 at 11:56 PM, Johannes wrote: > Hi list > how can i add a new edge (a->b) to a given graph G (n.n. connected), > just in the case that there is no path (a -> ... -> b) before? You should use "shortest_path" which uses Dijkstra's algorithm under the hood. if g.shortest_path('a'

[sage-support] edges in graphs

2011-02-04 Thread Johannes
Hi list how can i add a new edge (a->b) to a given graph G (n.n. connected), just in the case that there is no path (a -> ... -> b) before? all i found is the all_path(a,b) method wich tooks very long in my case and generates a huge overhead. greatz Johanens -- To post to this group, send email