Re: Cannot understand the detailedly the following code

2008-04-15 Thread reachmsn
On Apr 11, 10:27 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > If you want to understand how recursion works, or how you can actually   > construct a recursive function step by step, see this excellent post by   > Neil Cerutti: > > http://groups.google.com/group/comp.lang.python/msg/9f0b1

Re: Cannot understand the detailedly the following code

2008-04-15 Thread reachmsn
On Apr 11, 10:27 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 10 Apr 2008 23:57:29 -0300, <[EMAIL PROTECTED]> escribió: > > > i.e. you give, the graph, the start and end vertices as inputs and you > > get the output as a listing of all the paths. This is where I got to. > > It would

Re: Cannot understand the detailedly the following code

2008-04-10 Thread Gabriel Genellina
En Thu, 10 Apr 2008 23:57:29 -0300, <[EMAIL PROTECTED]> escribió: > i.e. you give, the graph, the start and end vertices as inputs and you > get the output as a listing of all the paths. This is where I got to. > It would be very nice if you could kindly hint on how to proceed > further. Thank you

Re: Cannot understand the detailedly the following code

2008-04-10 Thread reachmsn
On Apr 9, 8:12 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-04-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > On Apr 8, 5:45 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > Ok following these instructions one gets > > > def find_all_paths(graph, start, end, path=[]): > >

Re: Cannot understand the detailedly the following code

2008-04-09 Thread A.T.Hofkamp
On 2008-04-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Apr 8, 5:45 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > Ok following these instructions one gets > > def find_all_paths(graph, start, end, path=[]): > path= path+ [start] > > for node in graph[start]: > >find_all_paths(graph

Re: Cannot understand the detailedly the following code

2008-04-09 Thread reachmsn
On Apr 8, 5:45 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-04-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [deleted a long piece of text by our BDFL about recursive graph path-finding > algorithm] > > > after first writing the inductive part ... for node in > > graph[start]

Re: Cannot understand the detailedly the following code

2008-04-09 Thread reachmsn
On Apr 8, 5:45 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-04-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [deleted a long piece of text by our BDFL about recursive graph path-finding > algorithm] > > > after first writing the inductive part ... for node in > > graph[start]

Re: Cannot understand the detailedly the following code

2008-04-08 Thread Gabriel Genellina
En Tue, 08 Apr 2008 09:45:35 -0300, A.T.Hofkamp <[EMAIL PROTECTED]> escribió: > On 2008-04-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [deleted a long piece of text by our BDFL about recursive graph > path-finding algorithm] > >> after first writing the inductive part ... for node in

Re: Cannot understand the detailedly the following code

2008-04-08 Thread A.T.Hofkamp
On 2008-04-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: [deleted a long piece of text by our BDFL about recursive graph path-finding algorithm] > after first writing the inductive part ... for node in > graph[start] > and then by trial and error put square brackets around path in the >

Cannot understand the detailedly the following code

2008-04-08 Thread reachmsn
Hi, At the url http://www.python.org/doc/essays/graphs.html there is some code by Guido Van Rossum for computing paths through a graph - I have pasted it below for reference - Let's write a simple function to determine a path between two nodes. It takes a graph and the start and end nodes as argu