Re:Speeding up my Advent of Code solution with Dijkstra's Al...
by smcl on Saturday January 01, 2022 @07:31AM
(#29757779)
I worked on a lot of previous AoC problems in November and then did AoC 2021 in December. I should do a little write-up because there are definitely patterns that repeat, but one thing I noticed was that if you're doing them in Python then the "heapq" module is sometimes so useful it feels like cheating. There are many problems where as long as you have a simple brute force algorithm and a way to rank potential solutions, you're mostly done.
[ Parent
| on HN ]
Re:Speeding up my Advent of Code solution with Dijkstra's Al...
by EnderShadow8 on Saturday January 01, 2022 @07:51AM
(#29757889)
If it works, it works. Priority queues are an extremely powerful data structure if you leverage them right.
I find C++'s set and map and related data structures are also very useful for solving cp problems.