-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Tools for working on (di)graphs. -- -- A collection of tools for generating and working on directed and -- undirected graphs. Algorithms are written using typeclasses in order -- to be data-structure independent. It is also possible to easily import -- and export graphs using the Graphviz syntax. @package hgraph @version 1.10.0.0 module HGraph.Parallel -- | Runs the producer until it output Nothing. Each successful -- product is sent to the consumer. Returns an IO action which takes the -- next product (or Nothing if there are no more products) produceConsumeExhaustive :: IO (Maybe a) -> (a -> IO b) -> IO (IO (Maybe b)) processJobList :: (a -> IO ([a], [b])) -> [a] -> IO (IO (Maybe b)) module HGraph.Undirected class UndirectedGraph t empty :: UndirectedGraph t => t a -> t a vertices :: UndirectedGraph t => t a -> [a] numVertices :: (UndirectedGraph t, Integral b) => t a -> b edges :: UndirectedGraph t => t a -> [(a, a)] numEdges :: (UndirectedGraph t, Integral b) => t a -> b linearizeVertices :: UndirectedGraph t => t a -> (t Int, [(Int, a)]) class UndirectedGraph t => Adjacency t neighbors :: Adjacency t => t a -> a -> [a] degree :: (Adjacency t, Integral b) => t a -> a -> b edgeExists :: Adjacency t => t a -> (a, a) -> Bool inducedSubgraph :: Adjacency t => t a -> [a] -> t a metaBfs :: (Adjacency t, Ord a) => t a -> a -> ([a] -> [a]) -> [a] connectedComponents :: (Adjacency t, Ord a) => t a -> [[a]] class Mutable t addVertex :: Mutable t => a -> t a -> t a removeVertex :: Mutable t => a -> t a -> t a addEdge :: Mutable t => (a, a) -> t a -> t a removeEdge :: Mutable t => (a, a) -> t a -> t a module HGraph.Undirected.AdjacencyMap data Graph a emptyGraph :: Ord a => Graph a instance HGraph.Undirected.UndirectedGraph HGraph.Undirected.AdjacencyMap.Graph instance HGraph.Undirected.Adjacency HGraph.Undirected.AdjacencyMap.Graph instance HGraph.Undirected.Mutable HGraph.Undirected.AdjacencyMap.Graph module HGraph.Undirected.Expanders -- | Edge expansion of a graph, together with a set of verticies certifying -- that the expansion is not greater. edgeExpansion :: (UndirectedGraph g, Adjacency g) => g a -> (Double, [a]) -- | Vertex expansion of a graph, together with a set of verticies -- certifying that the expansion is not greater. vertexExpansion :: Adjacency g => g a -> (Double, [a]) module HGraph.Undirected.Layout.SpringModel setup :: UndirectedGraph g => Double -> Double -> Double -> Double -> g a -> SpringModel g a step :: forall {g :: Type -> Type} {a}. Adjacency g => Double -> SpringModel g a -> SpringModel g a positions :: forall {g :: Type -> Type} {a}. SpringModel g a -> [(a, V2 Double)] module HGraph.Undirected.Load loadDot :: Mutable t => t String -> [Char] -> Either String (t String) module HGraph.Undirected.Output toDot :: (Show a, UndirectedGraph t) => t a -> [Char] module HGraph.Undirected.Solvers.Treedepth optimalDecomposition :: (Adjacency t, Mutable t, Ord a) => t a -> Decomposition a treedepthAtMost :: (Adjacency t, Num a, Mutable t, Ord a, Eq a) => t a -> a -> Maybe (Decomposition a) isDecomposition :: (Ord k, UndirectedGraph t) => t k -> Decomposition k -> Bool data Decomposition a Decomposition :: Map a a -> Map a (Set a) -> Int -> [a] -> Decomposition a [ancestor] :: Decomposition a -> Map a a [children] :: Decomposition a -> Map a (Set a) [depth] :: Decomposition a -> Int [roots] :: Decomposition a -> [a] instance GHC.Classes.Eq a => GHC.Classes.Eq (HGraph.Undirected.Solvers.Treedepth.Decomposition a) instance (GHC.Classes.Ord a, GHC.Show.Show a) => GHC.Show.Show (HGraph.Undirected.Solvers.Treedepth.Decomposition a) module HGraph.Undirected.Solvers.VertexCover minimumVertexCover :: (Mutable t, UndirectedGraph t, Adjacency t) => t a -> [a] vertexCoverAtMost :: (Mutable t, UndirectedGraph t, Adjacency t) => t a -> Int -> Maybe [a] module HGraph.Utils mhead :: [a] -> Maybe a randomN :: (Random a, RandomGen g) => a -> a -> State g a -- | Lists all subsets of s of size exactly k. choose :: (Eq t, Num t) => t -> [a] -> [[a]] guessOne :: (t -> t -> Maybe a) -> (t -> t -> t) -> t -> [t] -> Maybe a module HGraph.Undirected.Solvers.IndependentSet -- | Find a maximum independet set in g maximize :: (Adjacency t, Mutable t) => t a -> [a] -- | Search for an independent set of size at least k in -- g atLeast :: (Adjacency t, Mutable t) => t a -> Int -> Maybe [a] reduce :: (Adjacency t, Mutable t) => t a -> Int -> (t a, [a], Int) module HGraph.Undirected.Generator grid :: (Num a, Num b, Enum a, Enum b, Mutable t) => t (a, b) -> a -> b -> t (a, b) cycleGraph :: (Mutable t, Integral t) => t t -> t -> t t completeTree :: (Integral t, Mutable t, UndirectedGraph t, Num t, Ord t) => t t -> t -> Int -> t t completeGraph :: (Mutable t, UndirectedGraph t, Num t, Enum t) => t t -> t -> t t randomGraph :: (Integral t, Mutable t, Random t, RandomGen g, Adjacency t) => t t -> t -> t -> StateT g Identity (t t) randomTree :: (RandomGen g, Mutable t, Ord a, UndirectedGraph t, Num a, Enum a) => t a -> a -> StateT g Identity (t a) module HGraph.Directed class DirectedGraph t empty :: DirectedGraph t => t a -> t a vertices :: DirectedGraph t => t a -> [a] numVertices :: (DirectedGraph t, Integral b) => t a -> b arcs :: DirectedGraph t => t a -> [(a, a)] numArcs :: (DirectedGraph t, Integral b) => t a -> b linearizeVertices :: DirectedGraph t => t a -> (t Int, [(Int, a)]) isVertex :: DirectedGraph t => t a -> a -> Bool class Adjacency t outneighbors :: Adjacency t => t a -> a -> [a] inneighbors :: Adjacency t => t a -> a -> [a] outdegree :: (Adjacency t, Integral b) => t a -> a -> b indegree :: (Adjacency t, Integral b) => t a -> a -> b incomingArcs :: Adjacency t => t a -> a -> [(a, a)] outgoingArcs :: Adjacency t => t a -> a -> [(a, a)] arcExists :: Adjacency t => t a -> (a, a) -> Bool metaBfs :: (Adjacency t, Ord a) => t a -> a -> ([a] -> [a]) -> ([a] -> [a]) -> [a] class Mutable t addVertex :: Mutable t => a -> t a -> t a removeVertex :: Mutable t => a -> t a -> t a addArc :: Mutable t => (a, a) -> t a -> t a removeArc :: Mutable t => (a, a) -> t a -> t a subgraphAround :: (DirectedGraph t, Adjacency t, Mutable t) => Int -> t a -> a -> t a renameVertices :: (DirectedGraph t, Mutable t, Ord a) => Map a b -> t b -> t a -> t b topologicalOrdering :: (DirectedGraph t, Mutable t, Adjacency t, Ord a) => t a -> Maybe [a] inducedSubgraph :: (Mutable t, DirectedGraph t, Ord a) => t a -> Set a -> t a -- | The line digraph of a digraph d is the digraph `(V', A')`, -- where V' is the set of arcs of d there is an arc -- (a,b) if the head of b in d is the same as the tail -- of a in d. lineDigraphI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> (t Int, [(Int, (Int, Int))]) transitiveClosure :: (Mutable t, DirectedGraph t, Adjacency t, Ord t) => t t -> t t -- | Find an isomorphism from d0 to d1, if it exists. isIsomorphicTo :: (Adjacency t, Adjacency t, DirectedGraph t, DirectedGraph t) => t a -> t a -> Bool isIsomorphicToI :: forall {t} {t} {a} {k}. (Adjacency t, Adjacency t, DirectedGraph t, DirectedGraph t, Ord k, Ord a) => t k -> t a -> Bool -- | Split each vertex v of the digraph into two vertices -- v_in and v_out. All incoming arcs of v -- become incoming arcs of v_in, all outgoing arcs from -- v become outgoing arcs from v_out and there is an -- arc `(v_in, v_out)`. -- -- This operation is useful when obtaining a vertex variant of arc-based -- algorithms like maximum flow. splitVertices :: (Mutable t, DirectedGraph t, Num a) => t a -> t a union :: (Mutable t, DirectedGraph t) => t a -> t a -> t a module HGraph.Directed.Subgraph -- | Whether d contains h as a subgraph (the identity is -- used for the isomorphism). contains :: (Adjacency t, Adjacency t, DirectedGraph t, DirectedGraph t) => t a -> t a -> Bool -- | Whether h is isomorphic to some subgraph of d. isSubgraphOf :: (Adjacency t, Adjacency t, Ord k2, Ord a, DirectedGraph t, DirectedGraph t) => t k2 -> t a -> Bool -- | Find an isomorphism from h to some subgraph of d, if -- it exists. subgraphIsomorphism :: (Adjacency t, Adjacency t, Ord k2, Ord a, DirectedGraph t, DirectedGraph t) => t a -> t k2 -> Maybe (Map k2 a) subgraphIsomorphismI :: (Adjacency t, Adjacency t, Ord k, Ord a, DirectedGraph t, DirectedGraph t) => t a -> t k -> Maybe (Map k a) -- | Whether phi is a subgraph isomorphism from h to some -- subgraph of d. isSubgraphIsomorphism :: (DirectedGraph t, Ord a, Adjacency t, Adjacency t) => t a -> t a -> Map a a -> Bool -- | Enumerate all subgraphs of d which are isomorphic to -- h enumerateSubgraphs :: (DirectedGraph t, Adjacency t, Mutable t) => t a -> t b -> [t a] enumerateSubgraphsI :: (Mutable t, Ord a, DirectedGraph t, DirectedGraph t, Adjacency t, Adjacency t) => t a -> t Int -> [t a] module HGraph.Directed.Output toDot :: (Ord a, Show a, DirectedGraph t) => t a -> DotStyle a -> [Char] data DotStyle a DotStyle :: String -> [(String, String)] -> [(String, String)] -> Map a [(String, String)] -> Map (a, a) [(String, String)] -> DotStyle a [graphName] :: DotStyle a -> String [everyNode] :: DotStyle a -> [(String, String)] [everyEdge] :: DotStyle a -> [(String, String)] [nodeAttributes] :: DotStyle a -> Map a [(String, String)] [edgeAttributes] :: DotStyle a -> Map (a, a) [(String, String)] defaultDotStyle :: DotStyle a module HGraph.Directed.Load loadDot :: Mutable t => t Int -> [Char] -> Either String (t Int, Map String Int, Map Int String, Map String [(Name, Name)], Map (String, String) [(Name, Name)]) loadEdgeList :: (Read a, Integral a, Mutable t) => t a -> String -> Either String (t a) module HGraph.Directed.Generator.Hereditary.Internal data Fingerprint Fingerprint :: [(Int, Int)] -> Fingerprint [degreeSequence] :: Fingerprint -> [(Int, Int)] enumerateParallel :: (Adjacency t2, DirectedGraph t2, Ord a) => (t2 a -> t -> [t2 a]) -> [t2 a] -> [t] -> IO (IO (Maybe (t2 a, Bool))) enumerateParallel' :: (Adjacency t2, DirectedGraph t2, Ord a) => (t2 a -> t -> [t2 a]) -> [t2 a] -> [t] -> IO (IO (Maybe (t2 a))) exhaust :: Monad m => m (Maybe a) -> m [a] random :: Monad m => p -> p -> [a] -> p -> m a insertNewDigraph :: (Adjacency t2, DirectedGraph t2, Ord k, Ord a, Monad m) => t2 a -> k -> Int -> [t2 a] -> Map k (Int, [t2 a]) -> m (Map k (Int, [t2 a])) fingerprint :: (Adjacency t, DirectedGraph t) => t a -> Fingerprint instance GHC.Classes.Ord HGraph.Directed.Generator.Hereditary.Internal.Fingerprint instance GHC.Classes.Eq HGraph.Directed.Generator.Hereditary.Internal.Fingerprint module HGraph.Directed.Generator.Hereditary enumerateParallel :: (Adjacency t2, DirectedGraph t2, Ord a) => (t2 a -> t -> [t2 a]) -> [t2 a] -> [t] -> IO (IO (Maybe (t2 a, Bool))) enumerateParallel' :: (Adjacency t2, DirectedGraph t2, Ord a) => (t2 a -> t -> [t2 a]) -> [t2 a] -> [t] -> IO (IO (Maybe (t2 a))) random :: Monad m => p1 -> p2 -> [a] -> p3 -> m a exhaust :: Monad m => m (Maybe a) -> m [a] module HGraph.Directed.Generator -- | A cycle where vertices are connected in both directions bidirectedCycle :: (Mutable t, Num a, Enum a) => t a -> a -> t a -- | Generate a random weakly-connected acyclic digraph with n -- vertices and m + n - 1 arcs. randomAcyclicDigraph :: forall {g} {t} {t}. (RandomGen g, Mutable t, DirectedGraph t, Integral t, Random t, Adjacency t) => t t -> t -> t -> StateT g Identity (t t) randomDigraph :: (Integral t, Mutable t, DirectedGraph t, Random t, RandomGen g, Adjacency t) => t t -> t -> t -> StateT g Identity (t t) oneWayGrid :: (Mutable t, DirectedGraph t, Num a, Enum a) => t a -> a -> a -> t a module HGraph.Directed.Connectivity.Basic -- | Vertices that s can reach. reach :: (Adjacency t, Ord a) => t a -> a -> [a] reverseReach :: (Adjacency t, Ord a) => t a -> a -> [a] reachable :: forall {a} {t}. (Adjacency t, Ord a) => t a -> a -> a -> Bool allPaths :: (Ord t, Adjacency t) => t t -> t -> t -> [[t]] allLinkages :: (DirectedGraph t1, Adjacency t1, Eq b, Eq t2, Num t2) => t1 b -> t2 -> b -> b -> [[[b]]] -- | All maximal paths on a digraph, represented as a list of vertices. | -- Cycles are also considered as maximal paths and their corresponding -- lists contain the initial vertex twice. allMaximalPaths :: (Adjacency t, DirectedGraph t) => t b -> [[b]] -- | All strongly connected components of a digraph, in an arbitrary order. strongComponents :: (DirectedGraph t, Adjacency t, Mutable t, Ord a) => t a -> [[a]] module HGraph.Directed.EditDistance.Acyclic.VertexDeletion.Internal minimum :: (DirectedGraph t, Adjacency t, Mutable t) => t a -> ([a], Int) minimumI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> ([Int], Int) minimumI' :: (DirectedGraph t, Mutable t, Adjacency t, Ord a) => t a -> Int -> Maybe ([a], Int) minimumIComponents :: (DirectedGraph t, Mutable t, Adjacency t, Ord a) => t a -> Int -> [[a]] -> Maybe ([a], Int) module HGraph.Directed.EditDistance.Acyclic.VertexDeletion minimum :: (DirectedGraph t, Adjacency t, Mutable t) => t a -> ([a], Int) minimumI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> ([Int], Int) module HGraph.Directed.Connectivity.Flow -- | Is the vertex set A well-linked to the vertex set B? -- That is, is there, for every subset A' of A, some -- subset B' of B of the same size such that there is a -- linkage from A' to B' containing as many paths as -- there are vertices in A'? isWellLinkedTo :: (Ord k, Mutable t, DirectedGraph t, Adjacency t) => t k -> [k] -> [k] -> Bool maxDisjointPaths :: (Mutable t, DirectedGraph t, Adjacency t, Integral a) => t a -> a -> a -> [[a]] maxArcDisjointPaths :: (Mutable t, DirectedGraph t, Adjacency t, Integral a) => t a -> a -> a -> [[a]] maxFlow :: (Ord a, Adjacency t, DirectedGraph t) => t a -> a -> a -> Map (a, a) Bool maxFlowValue :: (Ord a, Adjacency t, DirectedGraph t) => t a -> a -> a -> Int minCut :: (Mutable t, DirectedGraph t, Adjacency t, Eq a) => t a -> a -> a -> [a] minCutI :: (Mutable t, DirectedGraph t, Adjacency t, Integral a) => t a -> a -> a -> [a] -- | Search for a subset A' of va and a subset -- B' of vb of the same size such that no linkage from -- A' to B' connecting all vertices in both sets exist. separableSets :: (Ord k, Mutable t, DirectedGraph t, Adjacency t) => t k -> [k] -> [k] -> Maybe ([Int], [Int]) separableSetsI :: forall {b} {t}. (Mutable t, DirectedGraph t, Integral b, Adjacency t) => t b -> [b] -> [b] -> Int -> Maybe ([b], [b]) cuttableSubsetI :: forall {a} {t}. (Adjacency t, DirectedGraph t, Integral a, Mutable t) => t a -> [a] -> [a] -> Int -> Maybe ([a], [a]) findWellLinkedSetI :: (Mutable t, DirectedGraph t, Adjacency t, Integral a) => t a -> Int -> Maybe ([a], [a]) module HGraph.Directed.EditDistance.Acyclic.ArcDeletion.Internal minimum :: (DirectedGraph t, Adjacency t, Mutable t) => t a -> ([(a, a)], Int) minimumI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> ([(Int, Int)], Int) guessArc :: forall {t} {a} {t}. (DirectedGraph t, Mutable t, Mutable t, Adjacency t, Adjacency t, Integral a) => t a -> Int -> t a -> Maybe ([(a, a)], Int) separateVertices :: forall {t} {a} {t}. (DirectedGraph t, Mutable t, Mutable t, Adjacency t, Adjacency t, Integral a) => t a -> Int -> t a -> [(a, a)] -> Maybe ([(a, a)], Int) separateVertices' :: forall {t} {a} {t}. (DirectedGraph t, Mutable t, Mutable t, Adjacency t, Adjacency t, Integral a) => t a -> Int -> t a -> [(a, a)] -> [(a, a)] -> Maybe ([(a, a)], Int) minimumIComponents :: forall {t} {a} {t}. (DirectedGraph t, Mutable t, Mutable t, Adjacency t, Adjacency t, Integral a) => t a -> Int -> [[a]] -> t a -> Maybe ([(a, a)], Int) module HGraph.Directed.EditDistance.Acyclic.ArcDeletion minimum :: (DirectedGraph t, Adjacency t, Mutable t) => t a -> ([(a, a)], Int) minimumI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> ([(Int, Int)], Int) module HGraph.Directed.Connectivity.OneWayWellLinkedness.Internal data Guess a Guess :: Set a -> Set a -> Int -> Set a -> Set a -> Guess a [aSet] :: Guess a -> Set a [bSet] :: Guess a -> Set a [numberOfVertices] :: Guess a -> Int [aCandidates] :: Guess a -> Set a [bCandidates] :: Guess a -> Set a vertexWellLinkedPair :: (Mutable t, DirectedGraph t, Integral a, Adjacency t) => t a -> Int -> Maybe (Set a, Set a) edgeWellLinkedPair :: (DirectedGraph t, Adjacency t, Mutable t, Integral a) => t a -> Int -> Maybe (Set a, Set a) edgeWellLinkedPair' :: (DirectedGraph t, Adjacency t, Mutable t, Integral a, Eq a, Ord a) => t a -> Int -> Guess a -> Maybe (Set a, Set a) addAVertex :: (DirectedGraph t, Adjacency t, Mutable t, Integral a, Ord a, Eq a) => t a -> Int -> Guess a -> Maybe (Set a, Set a) addBVertex :: (DirectedGraph t, Adjacency t, Mutable t, Integral a, Ord a, Eq a) => t a -> Int -> Guess a -> Maybe (Set a, Set a) restrictBCandidates :: (Adjacency t, Ord a) => t a -> a -> Guess a -> Guess a restrictACandidates :: (DirectedGraph t, Adjacency t, Mutable t, Num a, Ord a, Eq a) => t a -> a -> Guess a -> Guess a module HGraph.Directed.Connectivity.OneWayWellLinkedness edgeWellLinkedPair :: (DirectedGraph t, Adjacency t, Mutable t, Integral a) => t a -> Int -> Maybe (Set a, Set a) edgeWellLinkedPair' :: (DirectedGraph t, Adjacency t, Mutable t, Integral a, Eq a, Ord a) => t a -> Int -> Guess a -> Maybe (Set a, Set a) vertexWellLinkedPair :: (Mutable t, DirectedGraph t, Integral a, Adjacency t) => t a -> Int -> Maybe (Set a, Set a) data Guess a Guess :: Set a -> Set a -> Int -> Set a -> Set a -> Guess a [aSet] :: Guess a -> Set a [bSet] :: Guess a -> Set a [numberOfVertices] :: Guess a -> Int [aCandidates] :: Guess a -> Set a [bCandidates] :: Guess a -> Set a module HGraph.Directed.Connectivity.IntegralLinkage extendLinkage :: (Mutable t, DirectedGraph t, Integral a, Adjacency t) => t a -> LinkageInstance a -> Maybe (LinkageInstance a) -- | Finds an integral linkaged connecting the given terminal pairs, if one -- exists. linkage :: (DirectedGraph t, Adjacency t, Mutable t, Eq a) => t a -> [(a, a)] -> Maybe [((a, a), [a])] -- | Special case of linkage where vertices are of type Int. -- | Faster than calling linkage if vertices of the digraph are -- already of type Int. linkageI :: (DirectedGraph t, Adjacency t, Mutable t, Integral a, Ord a, Eq a) => t a -> [(a, a)] -> Maybe [((a, a), [a])] data LinkageInstance a LinkageInstance :: Map Int (a, a) -> Map a Int -> Map Int [a] -> LinkageInstance a [liTerminalPairs] :: LinkageInstance a -> Map Int (a, a) [liLinkage] :: LinkageInstance a -> Map a Int [liPath] :: LinkageInstance a -> Map Int [a] instance GHC.Show.Show a => GHC.Show.Show (HGraph.Directed.Connectivity.IntegralLinkage.LinkageInstance a) instance GHC.Classes.Eq a => GHC.Classes.Eq (HGraph.Directed.Connectivity.IntegralLinkage.LinkageInstance a) module HGraph.Directed.Connectivity data LinkageInstance a LinkageInstance :: Map Int (a, a) -> Map a Int -> Map Int [a] -> LinkageInstance a [liTerminalPairs] :: LinkageInstance a -> Map Int (a, a) [liLinkage] :: LinkageInstance a -> Map a Int [liPath] :: LinkageInstance a -> Map Int [a] module HGraph.Directed.TopologicalMinor -- | Whether there is some subgraph of d which is isomorphic to -- some subdivision of h isMinorOf :: (Adjacency t, Adjacency t, Mutable t, DirectedGraph t, DirectedGraph t, Ord k) => t k -> t b -> Bool isMinorOfI :: (Adjacency t, Adjacency t, Mutable t, DirectedGraph t, DirectedGraph t, Ord k) => t k -> t b -> Bool isMinorEmbedding :: (Adjacency t, Mutable t, DirectedGraph t, DirectedGraph t, Ord k, Eq a) => t k -> t a -> Map k a -> Bool topologicalMinor :: (Adjacency t, Adjacency t, Mutable t, DirectedGraph t, DirectedGraph t, Ord k) => t k -> t b -> Maybe (Map k b) topologicalMinorI :: (Adjacency t, Adjacency t, Mutable t, Integral a, DirectedGraph t, DirectedGraph t, Ord k) => t k -> t a -> Maybe (Map k a) module HGraph.Directed.PathAnonymity pathAnonymity :: (Adjacency t, Ord b, Num b, DirectedGraph t) => t b -> b -- | Path anonymity of a digraph together with a path witnessing | that the -- anonymity is at least the returned value. pathAnonymityCertificate :: (Adjacency t, Ord b, Num b, DirectedGraph t) => t b -> ([b], b) -- | Path anonymity of a maximal path. | The path provided is assumed to be -- maximal. pathPathAnonymityI :: (Adjacency t, Ord a, Num a) => t a -> [a] -> a module HGraph.Directed.Packing.Cycles.Internal -- | A packing of pairwise arc-disjoint cycles of maximum size. arcMaximumI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> ([[Int]], Int) -- | Computes a packing of pairwise disjoint cycles of maximum size. maximum :: (DirectedGraph t, Mutable t, Adjacency t) => t a -> ([[a]], Int) -- | Computes a packing of pairwise disjoint cycles of maximum size. -- Vertices of the input digraph must be labeled with integers from `0` -- to `n - 1`. maximumI :: (DirectedGraph t, Mutable t, Adjacency t) => t Int -> ([[Int]], Int) maximumI' :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> Int -> Maybe ([[Int]], Int) maximumIWeak :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> Int -> Maybe ([[Int]], Int) guessArc :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> Int -> (Int, Int) -> Maybe ([[Int]], Int) packArc :: (DirectedGraph t, Mutable t, Adjacency t) => t Int -> Int -> [Int] -> Int -> (Int, Int) -> Maybe ([[Int]], Int) module HGraph.Directed.Packing.Cycles -- | A packing of pairwise arc-disjoint cycles of maximum size. arcMaximumI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> ([[Int]], Int) -- | Computes a packing of pairwise disjoint cycles of maximum size. maximum :: (DirectedGraph t, Mutable t, Adjacency t) => t a -> ([[a]], Int) -- | Computes a packing of pairwise disjoint cycles of maximum size. -- Vertices of the input digraph must be labeled with integers from `0` -- to `n - 1`. maximumI :: (DirectedGraph t, Mutable t, Adjacency t) => t Int -> ([[Int]], Int) module HGraph.Directed.AdjacencyMap data Digraph a emptyDigraph :: Ord a => Digraph a instance HGraph.Directed.DirectedGraph HGraph.Directed.AdjacencyMap.Digraph instance HGraph.Directed.Adjacency HGraph.Directed.AdjacencyMap.Digraph instance HGraph.Directed.Mutable HGraph.Directed.AdjacencyMap.Digraph