ngraph.path icon indicating copy to clipboard operation
ngraph.path copied to clipboard

Turn penalties

Open j1mie opened this issue 5 years ago • 4 comments

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 avatar Jun 17 '19 10:06 j1mie

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

j1mie avatar Jun 17 '19 14:06 j1mie

related: https://github.com/anvaka/ngraph.path/issues/2, still no response :(

leeoniya avatar Jun 17 '19 14:06 leeoniya

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?

j1mie avatar Jun 24 '19 09:06 j1mie

I've made a PR to expose the parent node to the distance() function to enable this: https://github.com/anvaka/ngraph.path/pull/42

georeith avatar Nov 10 '23 15:11 georeith