anvaka / ngraph.path

Path finding in a graph
https://anvaka.github.io/ngraph.path.demo/
MIT License
3.04k stars 186 forks source link

Expose parent in distance function #42

Open georeith opened 11 months ago

georeith commented 11 months ago

Exposes the parent node in the distance function if one exists.

This is useful for applying penalties for turns, where you need to look at the node visited prior to this see if you made a turn.

See https://github.com/anvaka/ngraph.path/issues/11 and https://github.com/anvaka/ngraph.path/issues/2