Munkres-simple-0.1.0.0: Simple and typesafe layer over the Munkres package.

Safe HaskellNone
LanguageHaskell2010

Data.Algorithm.Munkres.Simple

Contents

Description

A simple and typesafe layer over Data.Algorithm.Munkres.

Synopsis

Problems

data Problem a b Source

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

data Solution a b Source

The solution of an association problem.

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.