This content has been marked as final. Show 3 replies
Sounds like the good old 'traveling salesman' problem... This will need some advanced algorithms, I guess. MAybe you can start with having all neighbor stations to each station saved along the station itself, and maybe also line info. Then you'll need some algorithm that checks the connection neighbor to neighbor, and tries to find the shortest way (= fewest stations involved). But this is gonna be hard work for the computer, especially on a big map like the london underground (search for the travelling salesman problem, you'll see that it gets unsolvable quite quickly).
Maybe this can be some help: http://www.sephiroth.it/phpwiki/index.php?title=Path_finder. On the sephiroth site, there's also a movie that connected 2 points on a street map, quite the thing you want. I can't find it right now, but it should be there, maybe there are some explainations to it too.
thanks for that. It looks a little complex for me at the moment, so I guess I should lower my bar and find another way to do that in my program....perhaps leaving it out and just jumping to the new station...
I just found a Flash implementation of a pathfinder algorithm, check it out: http://recycle.andre-michelle.com/zips.unsorted/runtime_pathfinder.zip.
It doesn't find the shortest way all the time, but animates the connection between 2 points, quite nice. Hope it's useful.