The n-clique problem, is finding all of the n sized cliques for a given graph. More generally, given a metric space and a set of elements. We can build a graph based on a distance threshold. So for a metrizable space , a set , and a graph . We let nodes of correspond to elements of . Let . For some epsilon.
It should be noted that we can divide the problem into connected subgraphs if the graph is not connected, this is check-able in linear time and as such is computationally free relative to what we’re about to deal with. This also will greatly reduce the expense at lower thresholds.
There are several ways to “check” for n-cliques, though most are brute force searches and are incredibly computationally expensive.
The simplest, is to check every of n size. For a there are possible subsets. Which simplifies to factorial time. We also have to verify each subset: . Which has possible checks. So our total complexity is a double factorial: k!*n! …
Assuming you have all (n-1)-cliques, you can count the number of (n-1)-cliques contained in each possible n-clique, which becomes (k-1)!*k! This also requires k! memory.
We can also go by edge addition, for a subgraph of G, the addition of an edge in G will create cliques. added to a proto-graph H, the set of new n-cliques is… .
If we can create a hierarchy of containment for cliques this might be fairly efficient.