# Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# FindKClique

FindKClique[g,k]
finds a largest k-clique in the graph g.

FindKClique[g,k,n]
finds a k-clique containing at most n vertices.

FindKClique[g,k,{n}]
finds a k-clique containing exactly n vertices.

FindKClique[g,k,{nmin,nmax}]
finds a k-clique containing between and vertices.

FindKClique[g,k,nspec,s]
finds at most s k-cliques.

FindKClique[{g,v},k,]
finds k-cliques that include the vertex v only.

FindKClique[{vw,},]
uses rules to specify the graph g.

## DetailsDetails

• A k-clique is a maximal set of vertices that are at a distance no greater than k from each other.
• FindKClique returns a list of k-cliques.
• FindKClique will return an empty list if there is no k-clique.
• FindKClique[,k,nspec,All] finds all the k-cliques.
• FindKClique works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

## Background & ContextBackground & Context

• FindKClique finds one or more k-cliques in a graph, returning them as a list of vertices. Here, a k-clique is a maximal set of vertices that are at a distance no greater than k from each other. k-cliques are used in project selection, pattern matching, finance, and network analysis.
• FindKClique can be used to find k-cliques of different sizes, from 1 to the largest possible size (in general n for a graph on n vertices). FindKClique can be used to find a single k-clique of specified size, a specified number of cliques, or all.
• 1-cliques are cliques. All k-clans are k-cliques, but the converse is not always true. Related functions include FindClique, FindKClan, FindKClub, and FindKPlex.

## ExamplesExamplesopen allclose all

### Basic Examples  (2)Basic Examples  (2)

Find a largest 2-clique in a graph:

 Out[2]=

Show the 2-clique:

 Out[3]=

Find all 4-cliques:

 Out[2]=