anvaka/ngraph.path

Turn penalties

j1mie opened this issue · 4 comments

j1mie commented

Hi there,

I'm using this library to draw a network graph on top of a grid, and I was wondering if you could suggest how to best implement a "turn penalty", to avoid a stair-casing effect, using the distance and heuristic functions.

Thanks!

j1mie commented

Also, just to add - I'm currently adding weights to nodes rather than edges - is this acceptable to do, using ngraph.path?

related: #2, still no response :(

j1mie commented

Looking at the PR I linked above, it seems as though we'd need to access fromNode.parent in the distance function. @anvaka Any idea on how to do this?

I've made a PR to expose the parent node to the distance() function to enable this: #42