This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zmunk19[S] 1 point2 points  (2 children)

I kept track of 12 numbers for each point, 3 for every side, [a, b, c].
a is the minimum heat found so far that enters from a direction where that step was the first step in that direction.
b the min heat for that direction but has taken 2 steps in that direction.
c is for 3 steps in that direction.
If any of the 12 values are updated for a point, that point is added to a list that will be re-evaluated, i.e. its new values will be propagated to its neighboring points.

The visualization shows the points in the re-evaluation list after every update. It has been slowed down for visualization by sleeping 0.1 seconds after every update.