Coloring.Make
Provide a function for k-coloring a graph.
k
module G : G
module 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
val 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.
coloring g k
g
if g cannot be k-colored.
Worst-case time complexity is exponential. Space complexity is O(V).
val two_color : G.t -> int H.t