Expand description
§LAN Party
This is the Clique problem. For part one we find triangles (cliques of size 3) for each node by checking if there’s an edge between any distinct pair of neighbouring nodes.
Part two asks to find the maximum clique, for which we could use the Bron–Kerbosch algorithm. However the input has a specific structure that enables a simpler approach of finding the largest maximal clique using a greedy algorithm. Nodes are arranged in clusters of 13 and the maximum clique is size 14. This approach will not necessarily work for any general graph, but will work for the inputs provided.
Functions§
- Convert each character pair
xy
to an index from 0..676 so that we can use much faster array lookup instead of aHashMap
. - to_char 🔒
- to_
usize 🔒
Type Aliases§
- Input 🔒