-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Haskell Data Analysis cookbook
By :
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.
Install the clique library using cabal:
$ cabal install maximal-cliques
Write the following code in a new file, which we will name Main.hs:
Import the required library:
import Data.Algorithm.MaximalCliques
In main...
Change the font size
Change margin width
Change background colour