| Safe Haskell | None |
|---|
LogicGrowsOnTrees.Examples.MapColoring
Description
This module contains examples of logic programs that generate all the valid colorings of a given (geographical) map.
Documentation
Arguments
| :: MonadPlus m | |
| => Word | number of colors |
| -> Word | number of countries |
| -> (Word -> Word -> Bool) | whether two countries are adjacent (must be symmetric) |
| -> m [(Word, Word)] | a valid coloring |
Generate all valid map colorings.
Arguments
| :: MonadPlus m | |
| => Word | number of colors |
| -> Word | number of countries |
| -> (Word -> Word -> Bool) | whether two countries are adjacent (must be symmetric) |
| -> m [(Word, Word)] | a (unique) valid coloring |
Generate all unique valid map colorings. That is, exactly one coloring will be generated from each class of colorings that are equivalent under a permutation of colors.