nanodeath / CrowLib

Crow: Find your shortest path!
http://www.effectgames.com/effect/article.psp.html/community/Pathfinding_library_Dijkstra_s_Algorithm
MIT License
40 stars 6 forks source link

Implement BFS-as-shortest-path algorithm #8

Open nanodeath opened 14 years ago

nanodeath commented 14 years ago

WIth fixed distances, BFS can be used to calculate a shortest path. It's faster than Dijkstra's, too.

d2n commented 11 years ago

can you make some sample?

IsraelAcosta commented 11 years ago

unfortunately I haven't been able to implement this library. I was working in a prototype I din't get to the implementation of this algorithm. I was looking for other options like JAVA or the possibility of doing it with PHP. sorry

nanodeath commented 11 years ago

It's not verified anywhere, so I'm not going to close this issue yet, but I think BFS is already implemented. bfs is the name of the traversal algorithm, which can be used to traverse the entire graph, or you can use bfs_basic which is a search algorithm and stops when it hits a goal. If you take a look at the test files (perfGraph.js for example) anywhere you see findGoal and the mention of an algorithm (like a*) you can instead use bfs or bfs_basic. Does that help?