In day 6 of the 2019 Advent of Code edition, we are presented with a system of objects orbiting in space. All objects orbit the center of mass of the system (modeled as object COM), either directly or by orbiting a larger object.
COM)B # B orbits COM
B)C # C orbits B
C)D # D orbits C
...
These chains of orbits can be solved as a directed graph. It just so happens that the old Unix toolkit has tools to operate on directed graphs. They aren’t designed for the use that we will make of them, but that’s what makes this fun.
Continue reading “Awkward solutions to Advent of Code challenges”