LogicGrowsOnTrees-1.1.0.2: a parallel implementation of logic programming using distributed tree exploration

Safe HaskellNone

LogicGrowsOnTrees.Examples.MapColoring

Description

This module contains examples of logic programs that generate all the valid colorings of a given (geographical) map.

Synopsis

Documentation

coloringSolutionsSource

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.

coloringUniqueSolutionsSource

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.