Haskell comes with a luxury of vital graph libraries, conveniently one of which is the clique detection library from Data.Algorithm.MaximualCliques
. A clique in a graph is a subgraph where all the nodes have connections between themselves, and is depicted as follows:
For example, the preceding graph contains two cliques shaded in different colors. Perhaps, the graph represents web pages that link to each other. We can visually infer that there might be two clusters of Internet communities due to the structure of the graph. As the network of connections increases, finding the greatest clique becomes an exponentially difficult problem.
In this recipe, we will use an efficient implementation of the maximal clique problem.