    {-# LANGUAGE MultiParamTypeClasses #-}

    -- | Example Graphs
    module Data.Graph.Inductive.Example(
        -- * Auxiliary Functions
        genUNodes, genLNodes, labUEdges, noEdges,
        -- * Small Dynamic Graphs
        a, b, c, e, loop, ab, abb, dag3, e3, cyc3, g3, g3b, dag4, d1, d3,
        -- * Small Static Graphs
        a', b', c', e', loop', ab', abb', dag3', e3', dag4', d1', d3',
        -- * Functions to Create (Regular) Graphs
        ucycle, star, ucycleM, starM,
        -- * More Graphs
        -- | clr : Cormen\/Leiserson\/Rivest

        -- | kin : Kingston

        -- ** Dynamic Versions
        clr479, clr489, clr486, clr508, clr528, clr595, gr1, kin248, vor,
        -- ** Static Versions
        clr479', clr489', clr486', clr508', clr528', kin248', vor'
    )where

    import Data.Graph.Inductive.Graph
    import Data.Graph.Inductive.PatriciaTree

    import Data.Graph.Inductive.Monad
    import Data.Graph.Inductive.Monad.IOArray

    -- | generate list of unlabeled nodes
    genUNodes :: Int -> [UNode]
    genUNodes :: Int -> [UNode]
    genUNodes n :: Int
    n = [Int] -> [()] -> [UNode]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..Int
    n] (() -> [()]
    forall a. a -> [a]
    repeat ())

    -- | generate list of labeled nodes
    genLNodes :: (Enum a) => a -> Int -> [LNode a]
    genLNodes :: a -> Int -> [LNode a]
    genLNodes q :: a
    q i :: Int
    i = Int -> [LNode a] -> [LNode a]
    forall a. Int -> [a] -> [a]
    take Int
    i ([Int] -> [a] -> [LNode a]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..] [a
    q..])

    -- | denote unlabeled edges
    labUEdges :: [Edge] -> [UEdge]
    labUEdges :: [Edge] -> [UEdge]
    labUEdges = (Edge -> UEdge) -> [Edge] -> [UEdge]
    forall a b. (a -> b) -> [a] -> [b]
    map (\(i :: Int
    i,j :: Int
    j) -> (Int
    i,Int
    j,()))

    -- | empty (unlabeled) edge list
    noEdges :: [UEdge]
    noEdges :: [UEdge]
    noEdges = []

    a,b,c,e,loop,ab,abb,dag3   :: Gr Char ()
    e3                         :: Gr () String
    cyc3,g3,g3b                :: Gr Char String
    dag4                       :: Gr Int ()
    d1,d3                      :: Gr Int Int

    a :: Gr Char ()
    a    = ([],1,'a',[]) Context Char () -> Gr Char () -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & Gr Char ()
    forall (gr :: * -> * -> *) a b. Graph gr => gr a b
    empty                  -- just a node
    b :: Gr Char ()
    b    = [LNode Char] -> [UEdge] -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..2] "ab") [UEdge]
    noEdges      -- just two nodes
    c :: Gr Char ()
    c    = [LNode Char] -> [UEdge] -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..3] "abc") [UEdge]
    noEdges     -- just three nodes
    e :: Gr Char ()
    e    = ([((),1)],2,'b',[]) Context Char () -> Gr Char () -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & Gr Char ()
    a                -- just one edge a-->b
    e3 :: Gr () [Char]
    e3   = [UNode] -> [LEdge [Char]] -> Gr () [Char]
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Int -> [UNode]
    genUNodes 2)
           [(1,2,"a"),(1,2,"b"),(1,2,"a")]        -- three edges (two labels) a-->b
    loop :: Gr Char ()
    loop = ([],1,'a',[((),1)]) Context Char () -> Gr Char () -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & Gr Char ()
    forall (gr :: * -> * -> *) a b. Graph gr => gr a b
    empty            -- loop on single node
    ab :: Gr Char ()
    ab   = ([((),1)],2,'b',[((),1)]) Context Char () -> Gr Char () -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & Gr Char ()
    a          -- cycle of two nodes:  a<-->b
    abb :: Gr Char ()
    abb  = [LNode Char] -> [UEdge] -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..2] "ab") ([Edge] -> [UEdge]
    labUEdges [(2,2)]) -- a and loop on b

    cyc3 :: Gr Char [Char]
    cyc3 = [Context Char [Char]] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    [Context a b] -> gr a b
    buildGr                                -- cycle of three nodes
           [([("ca",3)],1,'a',[("ab",2)]),
                    ([],2,'b',[("bc",3)]),
                    ([],3,'c',[])]

    dag3 :: Gr Char ()
    dag3 = [LNode Char] -> [UEdge] -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..3] "abc") ([Edge] -> [UEdge]
    labUEdges [(1,3)])
    dag4 :: Gr Int ()
    dag4 = [Edge] -> [UEdge] -> Gr Int ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 4) ([Edge] -> [UEdge]
    labUEdges [(1,2),(1,4),(2,3),(2,4),(4,3)])

    d1 :: Gr Int Int
    d1   = [Edge] -> [LEdge Int] -> Gr Int Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 2) [(1,2,1)]
    d3 :: Gr Int Int
    d3   = [Edge] -> [LEdge Int] -> Gr Int Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 3) [(1,2,1),(1,3,4),(2,3,2)]

    g3 :: Gr Char [Char]
    g3 = ([("left",2),("up",3)],1,'a',[("right",2)]) Context Char [Char] -> Gr Char [Char] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & (
                            ([],2,'b',[("down",3)])  Context Char [Char] -> Gr Char [Char] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & (
                            ([],3,'c',[])            Context Char [Char] -> Gr Char [Char] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & Gr Char [Char]
    forall (gr :: * -> * -> *) a b. Graph gr => gr a b
    empty ))
    g3b :: Gr Char [Char]
    g3b = ([("down",2)], 3,'c',[("up",1)])   Context Char [Char] -> Gr Char [Char] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & (
          ([("right",1)],2,'b',[("left",1)]) Context Char [Char] -> Gr Char [Char] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & (
                     ([],1,'a',[])           Context Char [Char] -> Gr Char [Char] -> Gr Char [Char]
    forall (gr :: * -> * -> *) a b.
    DynGraph gr =>
    Context a b -> gr a b -> gr a b
    & Gr Char [Char]
    forall (gr :: * -> * -> *) a b. Graph gr => gr a b
    empty ))

    a',b',c',e',loop',ab',abb',dag3' :: IO (SGr Char ())
    e3'                              :: IO (SGr () String)
    dag4'                            :: IO (SGr Int ())
    d1',d3'                          :: IO (SGr Int Int)

    a' :: IO (SGr Char ())
    a'    = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM [(1,'a')] [UEdge]
    noEdges              -- just a node
    b' :: IO (SGr Char ())
    b'    = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..2] "ab") [UEdge]
    noEdges      -- just two nodes
    c' :: IO (SGr Char ())
    c'    = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..3] "abc") [UEdge]
    noEdges     -- just three nodes
    e' :: IO (SGr Char ())
    e'    = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..2] "ab") [(1,2,())]   -- just one edge a-->b
    e3' :: IO (SGr () [Char])
    e3'   = [UNode] -> [LEdge [Char]] -> IO (SGr () [Char])
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Int -> [UNode]
    genUNodes 2)
              [(1,2,"a"),(1,2,"b"),(1,2,"a")]       -- three edges (two labels) a-->b
    loop' :: IO (SGr Char ())
    loop' = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM [(1,'a')] [(1,1,())]           -- loop on single node
    ab' :: IO (SGr Char ())
    ab'   = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..2] "ab")
              [(1,2,()),(2,1,())]                   -- cycle of two nodes:  a<-->b
    abb' :: IO (SGr Char ())
    abb'  = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..2] "ab") ([Edge] -> [UEdge]
    labUEdges [(2,2)]) -- a and loop on b

    dag3' :: IO (SGr Char ())
    dag3' = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [Char] -> [LNode Char]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..3] "abc") ([Edge] -> [UEdge]
    labUEdges [(1,3)])
    dag4' :: IO (SGr Int ())
    dag4' = [Edge] -> [UEdge] -> IO (SGr Int ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 4) ([Edge] -> [UEdge]
    labUEdges [(1,2),(1,4),(2,3),(2,4),(4,3)])

    d1' :: IO (SGr Int Int)
    d1'   = [Edge] -> [LEdge Int] -> IO (SGr Int Int)
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 2) [(1,2,1)]
    d3' :: IO (SGr Int Int)
    d3'   = [Edge] -> [LEdge Int] -> IO (SGr Int Int)
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 3) [(1,2,1),(1,3,4),(2,3,2)]

    ucycle :: (Graph gr) => Int -> gr () ()
    ucycle :: Int -> gr () ()
    ucycle n :: Int
    n = [Int] -> [Edge] -> gr () ()
    forall (gr :: * -> * -> *). Graph gr => [Int] -> [Edge] -> gr () ()
    mkUGraph [Int]
    vs ((Int -> Edge) -> [Int] -> [Edge]
    forall a b. (a -> b) -> [a] -> [b]
    map (\v :: Int
    v->(Int
    v,Int
    v Int -> Int -> Int
    forall a. Integral a => a -> a -> a
    `mod` Int
    nInt -> Int -> Int
    forall a. Num a => a -> a -> a
    +1)) [Int]
    vs)
               where vs :: [Int]
    vs = [1..Int
    n]

    star :: (Graph gr) => Int -> gr () ()
    star :: Int -> gr () ()
    star n :: Int
    n = [Int] -> [Edge] -> gr () ()
    forall (gr :: * -> * -> *). Graph gr => [Int] -> [Edge] -> gr () ()
    mkUGraph [1..Int
    n] ((Int -> Edge) -> [Int] -> [Edge]
    forall a b. (a -> b) -> [a] -> [b]
    map (\v :: Int
    v->(1,Int
    v)) [2..Int
    n])

    ucycleM :: (GraphM m gr) => Int -> m (gr () ())
    ucycleM :: Int -> m (gr () ())
    ucycleM n :: Int
    n = [Int] -> [Edge] -> m (gr () ())
    forall (m :: * -> *) (gr :: * -> * -> *).
    GraphM m gr =>
    [Int] -> [Edge] -> m (gr () ())
    mkUGraphM [Int]
    vs ((Int -> Edge) -> [Int] -> [Edge]
    forall a b. (a -> b) -> [a] -> [b]
    map (\v :: Int
    v->(Int
    v,Int
    v Int -> Int -> Int
    forall a. Integral a => a -> a -> a
    `mod` Int
    nInt -> Int -> Int
    forall a. Num a => a -> a -> a
    +1)) [Int]
    vs)
                where vs :: [Int]
    vs = [1..Int
    n]

    starM :: (GraphM m gr) => Int -> m (gr () ())
    starM :: Int -> m (gr () ())
    starM n :: Int
    n = [Int] -> [Edge] -> m (gr () ())
    forall (m :: * -> *) (gr :: * -> * -> *).
    GraphM m gr =>
    [Int] -> [Edge] -> m (gr () ())
    mkUGraphM [1..Int
    n] ((Int -> Edge) -> [Int] -> [Edge]
    forall a b. (a -> b) -> [a] -> [b]
    map (\v :: Int
    v->(1,Int
    v)) [2..Int
    n])

    clr479,clr489    :: Gr Char ()
    clr486           :: Gr String ()
    clr508,clr528    :: Gr Char Int
    clr595,gr1       :: Gr Int Int
    kin248           :: Gr Int ()
    vor              :: Gr String Int

    clr479 :: Gr Char ()
    clr479 = [LNode Char] -> [UEdge] -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Char -> Int -> [LNode Char]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 'u' 6)
             ([Edge] -> [UEdge]
    labUEdges [(1,2),(1,4),(2,5),(3,5),(3,6),(4,2),(5,4),(6,6)])
    clr486 :: Gr [Char] ()
    clr486 = [LNode [Char]] -> [UEdge] -> Gr [Char] ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [[Char]] -> [LNode [Char]]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..9] ["shorts","socks","watch","pants","shoes",
                                  "shirt","belt","tie","jacket"])
                     ([Edge] -> [UEdge]
    labUEdges [(1,4),(1,5),(2,5),(4,5),(4,7),(6,7),(6,8),(7,9),(8,9)])
    clr489 :: Gr Char ()
    clr489 = [LNode Char] -> [UEdge] -> Gr Char ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Char -> Int -> [LNode Char]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 'a' 8)
                     ([Edge] -> [UEdge]
    labUEdges [(1,2),(2,3),(2,5),(2,6),(3,4),(3,7),(4,3),(4,8),
                             (5,1),(5,6),(6,7),(7,6),(7,8),(8,8)])
    clr508 :: Gr Char Int
    clr508 = [LNode Char] -> [LEdge Int] -> Gr Char Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Char -> Int -> [LNode Char]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 'a' 9)
                     [(1,2,4),(1,8,8),(2,3,8),(2,8,11),(3,4,7),(3,6,4),(3,9,2),
                      (4,5,9),(4,6,14),(5,6,10),(6,7,2),(7,8,1),(7,9,6),(8,9,7)]
    clr528 :: Gr Char Int
    clr528 = [LNode Char] -> [LEdge Int] -> Gr Char Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph [(1,'s'),(2,'u'),(3,'v'),(4,'x'),(5,'y')]
                     [(1,2,10),(1,4,5),(2,3,1),(2,4,2),(3,5,4),
                      (4,2,3),(4,3,9),(4,5,2),(5,1,7),(5,3,6)]
    clr595 :: Gr Int Int
    clr595 = [Edge] -> [LEdge Int] -> Gr Int Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [Int] -> [Edge]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..6] [1..6])
                     [(1,2,16),(1,3,13),(2,3,10),(2,4,12),(3,2,4),
                      (3,5,14),(4,3,9),(4,6,20),(5,4,7),(5,6,4)]
    gr1 :: Gr Int Int
    gr1    = [Edge] -> [LEdge Int] -> Gr Int Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [Int] -> [Edge]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..10] [1..10])
                     [(1,2,12),(1,3,1),(1,4,2),(2,3,1),(2,5,7),(2,6,5),(3,6,1),
                      (3,7,7),(4,3,3),(4,6,2),(4,7,5),(5,3,2),(5,6,3),(5,8,3),
                      (6,7,2),(6,8,3),(6,9,1),(7,9,9),(8,9,1),(8,10,4),(9,10,11)]
    kin248 :: Gr Int ()
    kin248 = [Edge] -> [UEdge] -> Gr Int ()
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 10)
                     ([Edge] -> [UEdge]
    labUEdges [(1,2),(1,4),(1,7),(2,4),(2,5),(3,4),(3,10),
                             (4,5),(4,8),(5,2),(5,3),(6,7),(7,6),(7,8),
                             (8,10),(9,9),(9,10),(10,8),(10,9)])
             -- this is the inverse graph shown on the bottom of the page

    vor :: Gr [Char] Int
    vor = [LNode [Char]] -> [LEdge Int] -> Gr [Char] Int
    forall (gr :: * -> * -> *) a b.
    Graph gr =>
    [LNode a] -> [LEdge b] -> gr a b
    mkGraph ([Int] -> [[Char]] -> [LNode [Char]]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..8] ["A","B","C","H1","H2","D","E","F"])
                  [(1,4,3),(2,3,3),(2,4,3),(4,2,4),(4,6,2),
                   (5,2,5),(5,3,6),(5,7,5),(5,8,6),
                   (6,5,3),(6,7,2),(7,8,3),(8,7,3)]

    clr479',clr489'  :: IO (SGr Char ())
    clr486'          :: IO (SGr String ())
    clr508',clr528'  :: IO (SGr Char Int)
    kin248'          :: IO (SGr Int ())
    vor'             :: IO (SGr String Int)

    clr479' :: IO (SGr Char ())
    clr479' = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Char -> Int -> [LNode Char]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 'u' 6)
              ([Edge] -> [UEdge]
    labUEdges [(1,2),(1,4),(2,5),(3,5),(3,6),(4,2),(5,4),(6,6)])
    clr486' :: IO (SGr [Char] ())
    clr486' = [LNode [Char]] -> [UEdge] -> IO (SGr [Char] ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [[Char]] -> [LNode [Char]]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..9] ["shorts","socks","watch","pants","shoes",
                                    "shirt","belt","tie","jacket"])
                       ([Edge] -> [UEdge]
    labUEdges [(1,4),(1,5),(2,5),(4,5),(4,7),(6,7),(6,8),(7,9),(8,9)])
    clr489' :: IO (SGr Char ())
    clr489' = [LNode Char] -> [UEdge] -> IO (SGr Char ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Char -> Int -> [LNode Char]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 'a' 8)
                       ([Edge] -> [UEdge]
    labUEdges [(1,2),(2,3),(2,5),(2,6),(3,4),(3,7),(4,3),(4,8),
                               (5,1),(5,6),(6,7),(7,6),(7,8),(8,8)])
    clr508' :: IO (SGr Char Int)
    clr508' = [LNode Char] -> [LEdge Int] -> IO (SGr Char Int)
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Char -> Int -> [LNode Char]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 'a' 9)
                       [(1,2,4),(1,8,8),(2,3,8),(2,8,11),(3,4,7),(3,6,4),(3,9,2),
                       (4,5,9),(4,6,14),(5,6,10),(6,7,2),(7,8,1),(7,9,6),(8,9,7)]
    clr528' :: IO (SGr Char Int)
    clr528' = [LNode Char] -> [LEdge Int] -> IO (SGr Char Int)
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM [(1,'s'),(2,'u'),(3,'v'),(4,'x'),(5,'y')]
                       [(1,2,10),(1,4,5),(2,3,1),(2,4,2),(3,5,4),
                        (4,2,3),(4,3,9),(4,5,2),(5,1,7),(5,3,6)]
    kin248' :: IO (SGr Int ())
    kin248' = [Edge] -> [UEdge] -> IO (SGr Int ())
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM (Int -> Int -> [Edge]
    forall a. Enum a => a -> Int -> [LNode a]
    genLNodes 1 10)
                       ([Edge] -> [UEdge]
    labUEdges [(1,2),(1,4),(1,7),(2,4),(2,5),(3,4),(3,10),
                               (4,5),(4,8),(5,2),(5,3),(6,7),(7,6),(7,8),
                               (8,10),(9,9),(9,10),(10,8),(10,9)])
             -- this is the inverse graph shown on the bottom of the page

    vor' :: IO (SGr [Char] Int)
    vor' = [LNode [Char]] -> [LEdge Int] -> IO (SGr [Char] Int)
    forall (m :: * -> *) (gr :: * -> * -> *) a b.
    GraphM m gr =>
    [LNode a] -> [LEdge b] -> m (gr a b)
    mkGraphM ([Int] -> [[Char]] -> [LNode [Char]]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [1..8] ["A","B","C","H1","H2","D","E","F"])
                    [(1,4,3),(2,3,3),(2,4,3),(4,2,4),(4,6,2),
                     (5,2,5),(5,3,6),(5,7,5),(5,8,6),
                     (6,5,3),(6,7,2),(7,8,3),(8,7,3)]