mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2025-12-13 21:34:58 +00:00
day 12
This commit is contained in:
18
2022/12/README.md
Normal file
18
2022/12/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
|
||||
<details>
|
||||
<summary>Solutions</summary>
|
||||
<ol>
|
||||
<li>497</li>
|
||||
<li>492</li>
|
||||
</ol>
|
||||
</details>
|
||||
Reference in New Issue
Block a user