mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2024-12-21 23:56:30 +00:00
.. | ||
python | ||
README.md |
12
What a ride...
So first I tried without A-Star. Well that of course did not stand a chance against the actual dataset.
I think my a start implementation is flawed, of the heuristics are not optimal. It starts in a straight line, but ends up checking every field anyways. So it's more like a Dijkstra. But it works.
The difference between Manhattan and Euclidean distance as h(x)
did not help two. Went form 6939 iterations to 6974.
The second part was quick. I reversed the search, starting from the end, removed the heuristic, so ti's now a classic Dijkstra, and instead of searching for a specific node, i stopped at the first encounter of an a
or 0
elevation.
Solutions
- 497
- 492