IsClique - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

GraphTheory

 IsClique
 test if graph is a clique

 Calling Sequence IsClique(G) IsClique(G,S)

Parameters

 G - undirected graph S - (optional) list or set of vertices

Description

 • The IsClique(G) command returns true if the input graph is a clique (complete graph).  It returns false otherwise.
 • The IsClique(G, S) command returns true if the collection of vertices S represents a clique in G, and returns false otherwise.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{K3}≔\mathrm{CompleteGraph}\left(3\right)$
 ${\mathrm{K3}}{≔}{\mathrm{Graph 1: an undirected graph with 3 vertices and 3 edge\left(s\right)}}$ (1)
 > $\mathrm{IsClique}\left(\mathrm{K3}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{C4}≔\mathrm{CycleGraph}\left(4\right)$
 ${\mathrm{C4}}{≔}{\mathrm{Graph 2: an undirected graph with 4 vertices and 4 edge\left(s\right)}}$ (3)
 > $\mathrm{IsClique}\left(\mathrm{C4}\right)$
 ${\mathrm{false}}$ (4)
 > $G≔\mathrm{AddEdge}\left(\mathrm{C4},\left\{1,3\right\},\mathrm{inplace}=\mathrm{false}\right)$
 ${G}{≔}{\mathrm{Graph 3: an undirected graph with 4 vertices and 5 edge\left(s\right)}}$ (5)
 > $\mathrm{IsClique}\left(G,\left[1,2,3\right]\right)$
 ${\mathrm{true}}$ (6)