bgrins / javascript-astar

A* Search / Pathfinding Algorithm in Javascript
https://briangrinstead.com/blog/astar-search-algorithm-in-javascript-updated/
MIT License
1.36k stars 324 forks source link

fewest turns #55

Open goozo opened 7 years ago

goozo commented 7 years ago

is there a way to pass option which would set a penalty if the path changes directions in order to get a path with fewest turns? (I need to avoid the staircase effect)

marcong95 commented 6 years ago

I have similar requirement too, so I read the source code. But found nothing about it. If you want to do the same thing, you can have a look on my forked version (marcong95/javascript-astar). I add some code on it referring to another project called JointJS. But do NOT use it directly for production use, I have not done any testing on it.