Unlabeled node
Modulefgl-5.8.2.0Haskell98
Data.Graph.Inductive.Graph
Static and Dynamic Inductive Graphs
- 17 types
- 2 classes
- 66 values
- Packagefgl-5.8.2.0
- Exports85
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceGraph.hs
General Type Defintions
0 declarationsNode and Edge Types
Labeled node
Quasi-unlabeled node
Unlabeled edge
Labeled edge
Quasi-unlabeled edge
Types Supporting Inductive Graph View
Labeled links to or from a Node.
The same as Decomp, only more sure of itself.
Unlabeled context.
Unlabeled decomposition.
Unlabeled path
Quasi-unlabeled path
Graph Type Classes
2 declarationsWe define two graph classes:
Graph: static, decomposable graphs. Static means that a graph itself cannot be changed
DynGraph: dynamic, extensible graphs. Dynamic graphs inherit all operations from static graphs but also offer operations to extend and change graphs.
Each class contains in addition to its essential operations those derived operations that might be overwritten by a more efficient implementation in an instance definition.
Note that labNodes is essentially needed because the default definition for matchAny is based on it: we need some node from the graph to define matchAny in terms of match. Alternatively, we could have made matchAny essential and have labNodes defined in terms of ufold and matchAny. However, in general, labNodes seems to be (at least) as easy to define as matchAny. We have chosen labNodes instead of the function nodes since nodes can be easily derived from labNodes, but not vice versa.
Methods
empty :: gr a bAn empty Graph.
isEmpty :: gr a b -> BoolTrue if the given Graph is empty.
match :: Node -> gr a b -> Decomp gr a bmkGraph :: [LNode a] -> [LEdge b] -> gr a blabNodes :: gr a b -> [LNode a]matchAny :: gr a b -> GDecomp gr a bnoNodes :: gr a b -> IntnodeRange :: gr a b -> (Node, Node)labEdges :: gr a b -> [LEdge b]
Operations
3 declarationsA synonym for &, to avoid conflicts with the similarly named operator in Data.Function.
The number of nodes in the graph. An alias for noNodes.
The number of edges in the graph.
Note that this counts every edge found, so if you are representing an unordered graph by having each edge mirrored this will be incorrect.
If you created an unordered graph by either mirroring every edge
(including loops!) or using the undir function in
Data.Graph.Inductive.Basic then you can safely halve the value
returned by this.
Graph Folds and Maps
Fold a function over the graph by recursively calling match.
Map a function over the graph by recursively calling match.
Map a function over the Node labels in a graph.
Map a function over the Edge labels in a graph.
Graph Projection
Drop the label component of an edge.
The label in an edge.
Add a label to an edge.
Graph Construction and Destruction
Remove an LEdge from the Graph.
NOTE: in the case of multiple edges with the same label, this will only delete the first such edge. To delete all such edges, please use delAllLEdge.
Remove all edges equal to the one specified.
Build a quasi-unlabeled Graph.
Subgraphs
Build a graph out of the contexts for which the predicate is satisfied by recursively calling match.
Returns the subgraph only containing the nodes which satisfy the given predicate.
Returns the subgraph only containing the labelled nodes which satisfy the given predicate.
Returns the subgraph only containing the nodes whose labels satisfy the given predicate.
Returns the subgraph induced by the supplied nodes.
Graph Inspection
Find the label for a Node.
Find the neighbors for a Node.
Find the labelled links coming into or going from a Context.
The outward-bound degree of the Node.
The inward-bound degree of the Node.
The degree of the Node.
Checks if there is a directed edge between two nodes.
Checks if there is an undirected edge between two nodes.
Checks if there is a labelled edge between two nodes.
Checks if there is an undirected labelled edge between two nodes.
Context Inspection
The label in a Context.
All labelled links coming into or going from a Context.
The outward degree of a Context.
The inward degree of a Context.
The degree of a Context.
Pretty-printing
2 declarationsPretty-print the graph. Note that this loses a lot of information, such as edge inverses, etc.
Pretty-print the graph to stdout.
Ordering of Graphs
1 declarationOrdGr comes equipped with an Ord instance, so that graphs can be used as e.g. Map keys.
Instances4Eq, Ord, Read, Show
(Graph gr, Ord a, Ord b) => Eq (OrdGr gr a b)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.Graph(Graph gr, Ord a, Ord b) => Ord (OrdGr gr a b)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.GraphRead (gr a b) => Read (OrdGr gr a b)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.GraphShow (gr a b) => Show (OrdGr gr a b)Defined in fgl-5.8.2.0 · Data.Graph.Inductive.Graph