Re: [Tutor] "Path tree"

2017-08-17 Thread Michael C
Ok, I will work with all these. Thx all! On Aug 16, 2017 20:22, "Abdur-Rahmaan Janhangeer" wrote: > in addition to the answers i'd say now you have the motivation to learn > python data structures and algorithms > >

Re: [Tutor] "Path tree"

2017-08-17 Thread Abdur-Rahmaan Janhangeer
in addition to the answers i'd say now you have the motivation to learn python data structures and algorithms http://interactivepython.org/runestone/static/pythonds/index.html barnum and miller it is free though i have not found a good pdf book form from where to download, but you have the site

Re: [Tutor] "Path tree"

2017-08-16 Thread Cameron Simpson
On 16Aug2017 10:22, Alan Gauld wrote: On 16/08/17 02:02, Cameron Simpson wrote: Ok. So you have a graph like this: 1 -- 2 -- 3 -- 4 | 7 -- 5 -- 6 -- 8 graph = { 1: [2], 2: [1, 3], 2: [1, 3, 5], 3: [2, 4], 4: [3], 5: [7, 6],

Re: [Tutor] "Path tree"

2017-08-16 Thread Alan Gauld via Tutor
On 16/08/17 02:02, Cameron Simpson wrote: > Ok. So you have a graph like this: > 1 -- 2 -- 3 -- 4 >| > 7 -- 5 -- 6 -- 8 > > graph = { > 1: [2], > 2: [1, 3], 2: [1, 3, 5], > 3: [2, 4], > 4: [3], > 5: [7, 6], 5: [2, 6, 7], > 6: [5, 8], >

Re: [Tutor] "Path tree"

2017-08-15 Thread Cameron Simpson
On 14Aug2017 12:10, Michael C wrote: http://imgur.com/a/CwA2G Ok. So you have a graph like this: 1 -- 2 -- 3 -- 4 | 7 -- 5 -- 6 -- 8 Have a read of a graph theory textbook. Also, wikipedia has an article on finding the shortest path through a graph:

Re: [Tutor] "Path tree"

2017-08-15 Thread Peter Otten
Martin A. Brown wrote: > The image: > >> http://imgur.com/a/CwA2G > > To me, this looks like a 'graph', which is a more general data > structure -- it does not look like a 'tree' (in the computer-science > meaning of the term, anyway). > import networkx as nx While Martin's solution is

Re: [Tutor] "Path tree"

2017-08-14 Thread Michael C
http://imgur.com/a/CwA2G I don't know to do this with math :( On Sun, Aug 13, 2017 at 1:07 PM, Michael C wrote: > Hi all: > > I am trying to formulate a "path-finding" function, and I am stuck on this > problem: > > Please look at the picture attached:

Re: [Tutor] "Path tree"

2017-08-14 Thread Alan Gauld via Tutor
On 13/08/17 21:07, Michael C wrote: > Please look at the picture attached: This is a text mailing list, no binary attachments allowed. The server strips them off. You need to put it on a web site and provide a link. > consisting of (x,y). Now I am trying to make a function go through this >

Re: [Tutor] "Path tree"

2017-08-14 Thread Mats Wichmann
On 08/13/2017 02:07 PM, Michael C wrote: > Hi all: > > I am trying to formulate a "path-finding" function, and I am stuck on this > problem: > > Please look at the picture attached: Those dots are coordinates of (x,y), > and this tree can be thought of as a list of tuples, with each tuple >

[Tutor] "Path tree"

2017-08-13 Thread Michael C
Hi all: I am trying to formulate a "path-finding" function, and I am stuck on this problem: Please look at the picture attached: Those dots are coordinates of (x,y), and this tree can be thought of as a list of tuples, with each tuple consisting of (x,y). Now I am trying to make a function go