Macaulay2 » Documentation
Packages » EdgeIdeals :: cliqueNumber
next | previous | forward | backward | up | index | toc

# cliqueNumber -- computes the clique number of a graph

- Usage:
    `c = cliqueNumber G`
- Inputs:
  - G, a graph,
- Outputs:
  - c, an integer, the clique number of G

## Description

cliqueNumber returns the clique number of a graph, the size of the largest clique contained in the graph. This number is also related to the dimension of the clique complex of the graph.

    i1 : R = QQ[a..d];

    i2 : cliqueNumber completeGraph R

    o2 = 4

    i3 : G = graph({a*b,b*c,a*c,a*d})

    o3 = Graph{"edges" => {{a, b}, {a, c}, {b, c}, {a, d}}}
               "ring" => R
               "vertices" => {a, b, c, d}

    o3 : Graph

    i4 : cliqueNumber G

    o4 = 3

    i5 : dim cliqueComplex G + 1 == cliqueNumber G

    o5 = true

## See also

- cliqueComplex -- returns the clique complex of a graph
- getCliques -- returns cliques in a graph
- getMaxCliques -- returns maximal cliques in a graph

## Ways to use cliqueNumber:

- `cliqueNumber(Graph)`

## For the programmer

The object cliqueNumber is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/EdgeIdeals.m2:2037:0.