Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class DirectedGraph t where
- class Adjacency t where
- outneighbors :: t a -> a -> [a]
- inneighbors :: t a -> a -> [a]
- outdegree :: Integral b => t a -> a -> b
- indegree :: Integral b => t a -> a -> b
- incomingArcs :: t a -> a -> [(a, a)]
- outgoingArcs :: t a -> a -> [(a, a)]
- arcExists :: t a -> (a, a) -> Bool
- metaBfs :: Ord a => t a -> a -> ([a] -> [a]) -> ([a] -> [a]) -> [a]
- class Mutable t where
- addVertex :: a -> t a -> t a
- removeVertex :: a -> t a -> t a
- addArc :: (a, a) -> t a -> t a
- removeArc :: (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
- 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
- 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
- splitVertices :: (Mutable t, DirectedGraph t, Num a) => t a -> t a
- union :: (Mutable t, DirectedGraph t) => t a -> t a -> t a
Documentation
class DirectedGraph t where Source #
vertices :: t a -> [a] Source #
numVertices :: Integral b => t a -> b Source #
arcs :: t a -> [(a, a)] Source #
numArcs :: Integral b => t a -> b Source #
linearizeVertices :: t a -> (t Int, [(Int, a)]) Source #
Instances
DirectedGraph Digraph Source # | |
Defined in HGraph.Directed.AdjacencyMap |
class Adjacency t where Source #
outneighbors :: t a -> a -> [a] Source #
inneighbors :: t a -> a -> [a] Source #
outdegree :: Integral b => t a -> a -> b Source #
indegree :: Integral b => t a -> a -> b Source #
incomingArcs :: t a -> a -> [(a, a)] Source #
outgoingArcs :: t a -> a -> [(a, a)] Source #
arcExists :: t a -> (a, a) -> Bool Source #
metaBfs :: Ord a => t a -> a -> ([a] -> [a]) -> ([a] -> [a]) -> [a] Source #
Instances
Adjacency Digraph Source # | |
Defined in HGraph.Directed.AdjacencyMap outneighbors :: Digraph a -> a -> [a] Source # inneighbors :: Digraph a -> a -> [a] Source # outdegree :: Integral b => Digraph a -> a -> b Source # indegree :: Integral b => Digraph a -> a -> b Source # incomingArcs :: Digraph a -> a -> [(a, a)] Source # outgoingArcs :: Digraph a -> a -> [(a, a)] Source # arcExists :: Digraph a -> (a, a) -> Bool Source # metaBfs :: Ord a => Digraph a -> a -> ([a] -> [a]) -> ([a] -> [a]) -> [a] Source # |
subgraphAround :: (DirectedGraph t, Adjacency t, Mutable t) => Int -> t a -> a -> t a Source #
renameVertices :: (DirectedGraph t, Mutable t, Ord a) => Map a b -> t b -> t a -> t b Source #
topologicalOrdering :: (DirectedGraph t, Mutable t, Adjacency t, Ord a) => t a -> Maybe [a] Source #
inducedSubgraph :: (Mutable t, DirectedGraph t, Ord a) => t a -> Set a -> t a Source #
lineDigraphI :: (DirectedGraph t, Adjacency t, Mutable t) => t Int -> (t Int, [(Int, (Int, Int))]) Source #
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
.
transitiveClosure :: (Mutable t, DirectedGraph t, Adjacency t, Ord t) => t t -> t t Source #
isIsomorphicTo :: (Adjacency t, Adjacency t, DirectedGraph t, DirectedGraph t) => t a -> t a -> Bool Source #
Find an isomorphism from d0
to d1
, if it exists.
isIsomorphicToI :: forall {t} {t} {a} {k}. (Adjacency t, Adjacency t, DirectedGraph t, DirectedGraph t, Ord k, Ord a) => t k -> t a -> Bool Source #
splitVertices :: (Mutable t, DirectedGraph t, Num a) => t a -> t a Source #
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.
union :: (Mutable t, DirectedGraph t) => t a -> t a -> t a Source #