Add "proper coloring" unittest check
authorGuido Trotter <ultrotter@google.com>
Mon, 3 Dec 2012 13:13:34 +0000 (14:13 +0100)
committerGuido Trotter <ultrotter@google.com>
Tue, 4 Dec 2012 16:46:35 +0000 (17:46 +0100)
commitc94f9990e504a4f807dbb7e0cd0cfd41be427c1a
tree2828cd5c6e472b3832b70ba702cab36e0861f9f9
parent8b50de5c65eda8a596749e0c53884c4fa104a450
Add "proper coloring" unittest check

We have to check that for each edge its vertices have different colors.

This is very easy to do with a vertex-to-color map, but not so easy with
a color-to-vertex one. Since all our coloring algorithms created a
vertex-to-color map behind the scenes and then converted it, we flip
them back to returning it directly, and do the conversion explicitly
where we need it (which for now is everywhere except when testing this
property).

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
htest/Test/Ganeti/HTools/Graph.hs
htools/Ganeti/HTools/Graph.hs