You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: