5

I am seeking the equivalent of MinimumVertexColoring[g] in Mathematica 12. I've been unsuccessful with either of these options to access old code:

<< Combinatorica`
<< IGraphM`
Joseph O'Rourke
  • 4,731
  • 25
  • 42

1 Answers1

5

IGraph/M has extensive and very fast graph colouring functionality (both exact and approximate), but it is not API-compatible with the now deprecated Combinatorica. In other words, loading <<IGraphM` is not going to make old Combinatorica code work without modifications. The modifications are worth it though as IGraph/M is much, much faster, and works with Mathematica's Graph data structure directly.

You will find many graph colouring examples in the IGraph/M documentation.

A small example:

Nest[IGMycielskian, CycleGraph[4], 2] // (* Mycielski construction increase the chromatic number *)
 Graph[#, VertexSize -> Large, GraphStyle -> "BasicBlack"] & // (* styling: large vertices, black edges *)
 IGVertexMap[ColorData[97], VertexStyle -> IGMinimumVertexColoring] (* style graph based on vertex colouring *)

enter image description here

The available functions are

  • IGVertexColoring, IGEdgeColoring for fast heuristic colouring (not exact minimum).
  • IGKVertexColoring, IGKEdgeColoring finds a colouring with no more than $k$ colours
  • IGMinimumVertexColoring, IGMinimumEdgeColoring find a minimum colouring, and have performance that is competitive with the best you might find elsewhere.
  • IGChromaticNumber, IGChromaticIndex just compute the minimum number of required colours.
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263