2 -- Export everything we need to have fun in GHCi:
4 -- See the results of examples.
9 module InstanceGenerator,
12 module ProposalMatcher,
13 module ProposalMatcherConfig,
15 -- Run randomized things.
17 module RandomizedMonad,
20 module Data.Graph.Inductive.Graphviz
23 import InstanceGenerator
24 import ProposalMatcher
25 import ProposalMatcherConfig
27 import RandomizedMonad
28 import Data.Graph.Inductive.Graphviz
30 -- Other imports we need
32 import UnitMinCostFlow
33 import Data.Array.IArray
34 import Data.Array.Unboxed
35 import Data.Graph.Inductive.Graph
36 import Data.Graph.Inductive.Tree
39 myGraph = mkGraph [(0, ()), (1, ()), (2, ())]
40 [(0, 1, 2), (0, 2, 3), (2, 1, -2)] :: Gr () Double
42 spTree1 = spTree 0 myGraph
44 (flowVal, flowResid) = umcf 0 1 myGraph
46 -- Example from idea book p. 425
48 (myNumRvrs, myNumProps) = (4, 3)
50 myPrefsArray = array ((0,0), (myNumRvrs-1,myNumProps-1)) [
51 ((0, 0), 15), ((1, 0), 10), ((2, 0), 15), ((3, 0), 40),
52 ((0, 1), 30), ((1, 1), 7), ((2, 1), 10), ((3, 1), 15),
53 ((0, 2), 15), ((1, 2), 25), ((2, 2), 20), ((3, 2), 20)
57 (myNumRvrs, myNumProps) = (5, 3)
59 myPrefs = transposeArray $ listArray ((0,0), (myNumProps-1,myNumRvrs-1)) [
63 ] :: UArray (Int, Int) Wt
65 myInst = Instance myNumRvrs myNumProps (funcArray (0, myNumRvrs-1) $ const 1) myPrefs
67 rdnGraph = doReduction myInst
68 (rdnFlowVal, rdnFlowResid) = umcf 0 1 rdnGraph
69 rdnFlow = flowDiff rdnGraph rdnFlowResid
70 myMatching = doMatching myInst