Idris2Doc : Data.Graph.Util

Data.Graph.Util

(source)
Core and utility functionality for graphs

Definitions

match : Node->Graphen->Decompen
  Decompose a `Graph` into the `Context` found
for the given node and the remaining `Graph`.

All edges leading to `node` will be removed from the
resulting `Graph`.

Totality: total
Visibility: export
matchAny : Graphen->Decompen
  Decompose a graph into the `Context` for the largest `Node`
and the remaining `Graph`.

Totality: total
Visibility: export
isEmpty : Graphen->Bool
  True, if the given graph is empty

Totality: total
Visibility: export
contexts : Graphen->List (Contexten)
  A list of contexts of a graph

Totality: total
Visibility: export
labNodes : Graphen->List (LNoden)
  A list of all labeled nodes of a `Graph`

Totality: total
Visibility: export
lab : Graphen->Node->Mayben
  Find the label for a `Node`.

Totality: total
Visibility: export
elab : Graphen->Node->Node->Maybee
  Find the label for an `Edge`.

Totality: total
Visibility: export
nodes : Graphen->ListNode
  List all 'Node's in the 'Graph'.

Totality: total
Visibility: export
gelem : Node->Graphen->Bool
  `True` if the `Node` is present in the `Graph`.

Totality: total
Visibility: export
order : Graphen->Nat
  The number of `Node`s in a `Graph`.

Totality: total
Visibility: export
labEdges : Graphen->List (LEdgee)
  A list of all `LEdge`s in the `Graph` (in lexicographic order).

Totality: total
Visibility: export
edges : Graphen->ListEdge
  List all 'Edge's in the 'Graph'.

Totality: total
Visibility: export
size : Graphen->Nat
  The number of edges in the graph.

Totality: total
Visibility: export
lneighbours : Graphen->Node->List (Node, e)
  Find the labelled links to a `Node`.

Totality: total
Visibility: export
neighbourLabels : Graphen->Node->List (n, e)
  Return the labels of all neighbours of a node paired
with the label of the edges leading to those neighbours.

Totality: total
Visibility: export
neighbours : Graphen->Node->ListNode
  Find the neighbours for a 'Node'.

Totality: total
Visibility: export
deg : Graphen->Node->Nat
  The degree of the `Node`.

Totality: total
Visibility: export
hasNeighbour : Graphen->Node->Node->Bool
  Checks if there is an undirected edge between two nodes.

Totality: total
Visibility: export
hasEdge : Graphen->Edge->Bool
  Checks if there is an edge between two nodes.

Totality: total
Visibility: export
hasLEdge : Eqe=>Graphen->LEdgee->Bool
  Checks if there is a labelled edge between two nodes.

Totality: total
Visibility: export
add : Contexten->Graphen->Graphen
  Merge the `Context` into the `DynGraph`.

Context adjacencies should only refer to either a Node already
in a graph.

Behaviour is undefined if the specified 'Node' already exists
in the graph.

Totality: total
Visibility: export
ufold : (Contexten->c->c) ->c->Graphen->c
  Fold a function over the graph by recursively calling 'match'.

Totality: total
Visibility: export
gmap : (Contexte1n1->Contexte2n2) ->Graphe1n1->Graphe2n2
  Map a function over the graph by recursively calling `match`.

Totality: total
Visibility: export
insNode : Node->n->Graphen->Graphen
  Insert a labeled node into the `Graph`.
The behavior is undefined if the node is already
in the graph.

Totality: total
Visibility: export
insEdge : LEdgee->Graphen->Graphen
  Insert a `LEdge` into the 'Graph'.
Behavior is undefined if the edge does not
connect two nodes already in the graph.

Totality: total
Visibility: export
insNodes : List (LNoden) ->Graphen->Graphen
  Insert multiple `LNode`s into the `Graph`.

Totality: total
Visibility: export
insEdges : List (LEdgee) ->Graphen->Graphen
  Insert multiple `LEdge`s into the `Graph`.

Totality: total
Visibility: export
delNode : Node->Graphen->Graphen
  Remove a 'Node' from the 'Graph'.

Totality: total
Visibility: export
delNodes : ListNode->Graphen->Graphen
  Remove multiple 'Node's from the 'Graph'.

Totality: total
Visibility: export
delEdge : Edge->Graphen->Graphen
  Remove an 'Edge' from the 'Graph'.

Totality: total
Visibility: export
delEdges : ListEdge->Graphen->Graphen
  Remove multiple 'Edge's from the 'Graph'.

Totality: total
Visibility: export
labnfilter : (LNoden->Bool) ->Graphen->Graphen
  Returns the subgraph only containing the labelled nodes which
satisfy the given predicate.

Totality: total
Visibility: export
nfilter : (Node->Bool) ->Graphen->Graphen
  Returns the subgraph only containing the nodes which satisfy the
given predicate.

Totality: total
Visibility: export
labfilter : (n->Bool) ->Graphen->Graphen
  Returns the subgraph only containing the nodes whose labels
satisfy the given predicate.

Totality: total
Visibility: export
pairWithNeighbours : Graphen->Graphe (n, List (n, e))
  Retruns the same graph additionaly containing list of connecting
edges and labels to each node.

Totality: total
Visibility: export
pairWithNeighbours' : Graphen->Graphe (n, Listn)
  Returns the same graph additionaly containing list of connecting
labels to each node.

Totality: total
Visibility: export
empty : Graphen
  An empty `Graph`

Totality: total
Visibility: export
mkGraph : List (LNoden) ->List (LEdgee) ->Graphen
  Create a `Graph` from the list of labeled nodes and
edges.

TODO: Can we easily enforce that the edges only point
To the nodes in the list?

Totality: total
Visibility: export
pretty : (e->String) -> (n->String) ->Graphen->String
Totality: total
Visibility: export