Skip to content

Commit

Permalink
2024/23
Browse files Browse the repository at this point in the history
  • Loading branch information
encse committed Dec 23, 2024
1 parent 0e9dee7 commit 1c6cab2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 2024/Day23/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ _Visit the website for the full story and [full puzzle](https://adventofcode.com

We tackled a graph algorithm problem today, where we had to find maximal cliques in an undirected graph. The literature provides [efficient algorithms](https://en.wikipedia.org/wiki/Bron%E2%80%93Kerbosch_algorithm) for this problem, but our graph is not too large, so we can use a straightforward "poor man's" strategy as well.

I started by creating _seed_ components containing nodes that start with '_t_'. Then, I proceeded to _grow_ these components by adding a single node to them in all possible ways. First, I identify the neighbors of each _t_ node, followed by the triples which is required to solve Part 1. In Part 2, this process is continued until a single maximal component remains.
I started with the _seed_ components, that is single element components for each node that starts with '_t_'. Then, I proceeded to _grow_ these components by adding a single node to them in all possible ways. I can put this in a loop, to get components with size 2, 3, 4, etc. _Part 1_ asks for the number of components that have 3 nodes. _Part 2_ asks for the one that cannot be grown anymore.

0 comments on commit 1c6cab2

Please sign in to comment.