GraphTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/GreedyColor

GraphTheory

 GreedyColor

 Calling Sequence GreedyColor(G, perm)

Parameters

 G - undirected unweighted graph perm - (optional) list of vertex labels

Description

 • The GreedyColor command colors the vertices of the graph in the order given by perm, one at a time, assigning to each vertex the smallest available color. If the permutation perm is not specified, the identity permutation is used.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{C6}≔\mathrm{CycleGraph}\left(6\right)$
 ${\mathrm{C6}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 6 vertices and 6 edge\left(s\right)}}$ (1)
 > $\mathrm{GreedyColor}\left(\mathrm{C6}\right)$
 ${2}{,}\left[{0}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}\right]$ (2)
 > $G≔\mathrm{PermuteVertices}\left(\mathrm{C6},\left[1,4,2,5,3,6\right]\right)$
 ${G}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 6 vertices and 6 edge\left(s\right)}}$ (3)
 > $\mathrm{GreedyColor}\left(G\right)$
 ${3}{,}\left[{0}{,}{0}{,}{1}{,}{1}{,}{2}{,}{2}\right]$ (4)