-- | Types for the general graph colorer.
-{-# OPTIONS -w #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and fix
--- any warnings in the module. See
--- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
--- for details
module GraphBase (
Triv,
import UniqSet
import UniqFM
+
-- | A fn to check if a node is trivially colorable
-- For graphs who's color classes are disjoint then a node is 'trivially colorable'
-- when it has less neighbors and exclusions than available colors for that node.
-- | All active nodes in the graph.
graphMap :: UniqFM (Node k cls color) }
+
-- | An empty graph.
+initGraph :: Graph k cls color
initGraph
= Graph
{ graphMap = emptyUFM }
, nodeConflicts :: UniqSet k
-- | Colors that cannot be used by this node.
- , nodeExclusions :: UniqSet color
+ , nodeExclusions :: UniqSet color
-- | Colors that this node would prefer to be, in decending order.
, nodePreference :: [color]
+