Module aoc::year2017::day12

source ·
Expand description

§Digital Plumber

This problem is the classic union-find. A variant of flood fill is used to find the connected groups or cliques.

For each program we depth first search from each of its neighbors that we have not already visited. If a neighbor has been visited then it must be either already in this clique or in another clique.

Functions§