Module Coloring.MakeSource

Provide a function for k-coloring a graph.

Parameters

module G : G

Signature

Sourcemodule H : Hashtbl.S with type key = G.V.t and type 'a t = 'a Hashtbl.Make(G.V).t

Hash tables used to store the coloring

Sourceval coloring : G.t -> int -> int H.t

coloring g k colors the graph g with k colors and returns the coloring as a hash table mapping nodes to their colors. Colors are integers from 1 to k.

Worst-case time complexity is exponential. Space complexity is O(V).

Sourceval two_color : G.t -> int H.t