ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.33k stars 254 forks source link

Adding tiebreaking to A* #91

Closed nluqo closed 8 years ago

nluqo commented 8 years ago

Found that small tweaks to A* can dramatically alter the performance in certain cases (linear visits in size of path down from squared). I wrote a few notes with demo here. I tried adding the least obtrusive of the changes (tiebreaking when f scores are equal) and attempted to write a test for it.

This is my first pull request for anything so I apologize if I'm missing something obvious.

twpage commented 8 years ago

Interesting! Excellent write up. It's been so long that I actually implemented my own A* - but I'm pretty surprised by these results.

ondras commented 8 years ago

Wow, nice and interesting! Thanks for the patch as well as the updated unit test.