-- | Find all chains in the given graph.
chainsIn'   :: (DynGraph g, Eq b) => g a b -> [NGroup]
chainsIn' g = filter (not . single) -- Remove trivial chains
              . map (getChain g')
              $ filterNodes' isChainStart g'
    where
      -- Try to make this work on two-element cycles, undirected
      -- graphs, etc.  Also remove multiple edges, etc.
      g' = oneWay $ mkSimple g

-- | Find the chain starting with the given 'Node'.
chainsIn'   :: (DynGraph g, Eq b) => g a b -> [NGroup]
chainsIn' g = filter (not . single) -- Remove trivial chains
              . map (getChain g')
              $ filterNodes' isChainStart g'
    where
      -- Try to make this work on two-element cycles, undirected
      -- graphs, etc.  Also remove multiple edges, etc.
      g' = oneWay $ mkSimple g

-- | Find the chain starting with the given 'Node'.
chainsIn' g = filter (not . single) -- Remove trivial chains
              . map (getChain g')
              $ filterNodes' isChainStart g'
    where
      -- Try to make this work on two-element cycles, undirected
      -- graphs, etc.  Also remove multiple edges, etc.
      g' = oneWay $ mkSimple g

-- | Find the chain starting with the given 'Node'.