-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
I believe there is an error in the algorithm for possibleRoutes. It can't handle routes that reach a dead end on the map. If you have this route: Point Teo->Puama->Mt Ootua->Hanapaoa, you're at a dead end. At this point the expression "_filter roadsFrom(end), notVisited" returns an empty array. That array is then mapped over with "continueRoute". From an ampty array the only element you can map over is "undefined", referencing the "to" property of, results in a runtime exception:
TypeError: Cannot read property 'length' of undefined.
I think the general idea of transforming a graph to a tree (which this example tries to achieve, I think) needs to apply some form of backtracking.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels