| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Algorithm.Munkres.Simple
Description
A simple and typesafe layer over Data.Algorithm.Munkres.
- data Problem a b
- problem :: (Ord a, Ord b) => Set a -> Set b -> (a -> b -> Double) -> Problem a b
- data Solution a b
- solve :: (Ord a, Ord b) => Problem a b -> Solution a b
- associatedA :: (Ord a, Ord b) => Solution a b -> b -> Maybe a
- associatedB :: (Ord a, Ord b) => Solution a b -> a -> Maybe b
- associationList :: Solution a b -> [(a, b)]
Problems
An association problem, consisting of two sets of items, and a weight function between them. Construct with problem.
problem :: (Ord a, Ord b) => Set a -> Set b -> (a -> b -> Double) -> Problem a b Source
Constructs an association problem, checking whether the sets of objects are the same size first.
Solutions
associatedA :: (Ord a, Ord b) => Solution a b -> b -> Maybe a Source
In a solution of type Solution a b, finds the a that a given b is paired with. Returns Nothing if the given b was not a part of the initial problem.
associatedB :: (Ord a, Ord b) => Solution a b -> a -> Maybe b Source
In a solution of type Solution a b, finds the b that a given a is paired with. Returns Nothing if the given a was not a part of the initial problem.
associationList :: Solution a b -> [(a, b)] Source
A list of the pairs of items in a solution.