Contents

Graph::chromaticNumber

Chromatic number of a graph

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

Graph::chromaticNumber(G)

Description

Graph::chromaticNumber(G) returns the chromatic number of the graph G. The chromatic number of a graph is defined to be the number of colors necessary to color it such that no two adjacent vertices have the same color.

Examples

Example 1

We compute the chromatic number of the complete graph with 5 vertices; it must be 5 since any two vertices are adjacent:

Graph::chromaticNumber(Graph::createCompleteGraph(5))

Parameters

G

An undirected graph

Return Values

Positive integer

Algorithms

Internally, the chromatic polynomial is used to compute the chromatic number.

See Also

MuPAD Functions

Was this topic helpful?