maennchen
Advent of Code 2022 - Day 16
Ok, that was a rough one today.
I haven’t found a way to improve the algorithm further. Part 1 runs in .5 seconds, Part 2 in ~ 5 minutes.
I went the way of precalculating all possible paths between non-zero flow rate valves using :digraph.get_short_path/3. Then I recursively calculate the best step. That works find for 1 actor / 30 iterations. For 2 actors / 26 iterations, that is however still a bit much.
Does anybody have a prettier solution?
Most Liked
kwando
This one was annoying to get right…
Part 1 is more or less instant, part 2 is super duper slow. Would probably work to memoize some computations, but I just let it run embarrassingly long instead, ~30min ![]()
![]()
![]()
lud
I have this solution that runs in 5 or 10 seconds according on how much you want to cheat.
Here I have the correct solution in 5 seconds with keeping the 50_000 best paths but ymmv.
Oh and I did not refactor so it is ugly ![]()







