Hey this is my first post in your forums so hello to all.
Onto my problem which is a very simple path finding algorithm that I cant seem to wrap my head around. There are 50 nodes each one has an x,y cord and a list of nodes it connects to.
If you plot them you will find that the paths are mostly linear (see attached file ashelp.png) and the max nodes each node is connected to is only 4. Most of the nodes only have 2 nodes connected to it though, so path finding should be easy… I thought :puzzled:
Here is my data
var Node_Stats:Array = new Array();
Node_Stats.push(new Array());
Node_Stats.push(new Array(203,183,"15-34"));
Node_Stats.push(new Array(261,100,"30-42"));
Node_Stats.push(new Array(137,257,"8-48"));
Node_Stats.push(new Array(157,171,"18-49"));
Node_Stats.push(new Array(175,120,"21-49"));
Node_Stats.push(new Array(121,52,"9-41"));
Node_Stats.push(new Array(221,81,"35-42-43"));
Node_Stats.push(new Array(111,259,"3-28"));
Node_Stats.push(new Array(146,62,"6-12-36"));
Node_Stats.push(new Array(58,159,"31-44"));
Node_Stats.push(new Array(231,229,"17-45"));
Node_Stats.push(new Array(169,80,"9-14-36-43"));
Node_Stats.push(new Array(257,200,"11-24"));
Node_Stats.push(new Array(148,92,"5-26"));
Node_Stats.push(new Array(210,161,"1-29"));
Node_Stats.push(new Array(33,245,"25-32"));
Node_Stats.push(new Array(245,215,"11-13"));
Node_Stats.push(new Array(137,160,"4-23"));
Node_Stats.push(new Array(109,217,"39-50"));
Node_Stats.push(new Array(57,101,"22-44"));
Node_Stats.push(new Array(193,125,"5-29"));
Node_Stats.push(new Array(68,78,"20-46"));
Node_Stats.push(new Array(125,138,"18-26"));
Node_Stats.push(new Array(269,183,"13-37"));
Node_Stats.push(new Array(12,235,"16-0"));
Node_Stats.push(new Array(127,112,"14-23"));
Node_Stats.push(new Array(165,208,"34-50"));
Node_Stats.push(new Array(82,260,"8-32"));
Node_Stats.push(new Array(208,139,"15-21"));
Node_Stats.push(new Array(272,124,"2-47"));
Node_Stats.push(new Array(74,188,"10-39"));
Node_Stats.push(new Array(55,255,"16-28"));
Node_Stats.push(new Array(200,35,"38-0"));
Node_Stats.push(new Array(188,197,"1-27"));
Node_Stats.push(new Array(202,80,"7-12-43"));
Node_Stats.push(new Array(161,51,"9-12-38"));
Node_Stats.push(new Array(266,166,"24-47"));
Node_Stats.push(new Array(179,40,"33-36-43"));
Node_Stats.push(new Array(86,201,"19-31"));
Node_Stats.push(new Array(186,244,"45-48"));
Node_Stats.push(new Array(103,60,"6-46"));
Node_Stats.push(new Array(242,91,"2-7"));
Node_Stats.push(new Array(196,66,"7-12-35-38"));
Node_Stats.push(new Array(59,131,"10-20"));
Node_Stats.push(new Array(205,239,"11-40"));
Node_Stats.push(new Array(87,66,"22-41"));
Node_Stats.push(new Array(271,149,"30-37"));
Node_Stats.push(new Array(163,253,"3-40"));
Node_Stats.push(new Array(155,128,5,"4-0"));
Node_Stats.push(new Array(141,221,"19-27"));
And to put the list of node IDs into an array I use
var Node_Cons:Array = Node_Stats[NODE_ID][3].split("-")
OK so the idea is to be able find the shortest path from one node to another by moving node to node. The only problem is that with my data being so simple and mostly linear I don’t know how to approach it. It seems like a wast of my time writing a long complicated path finding algorithm (which I would be learning to do as I go) for something this… well linear…
Any ideas on how to approach this without the need for a long complicated path finding algorithm?
Thank you
-Zhahaman2001