graph1
http://www.dse.nl/~postma/graph1.ocd
2006-06-01
experimental
2004-06-01
0
12
This CD defines symbols for handling directed and undirected graphs.
Authored by Hans Cuypers and Erik Postma.
This version is edited by amc.
graph
This symbol represents an undirected graph. It takes two
arguments: the vertex set of the graph and the edge set.
The vertices can be arbitrary OpenMath objects. Each edge should be a set consisting of two vertices.
A path of length 2.
1
2
3
1
2
2
3
vertexset
This symbol represents the vertex set of a (directed or undirected) graph. It takes one argument, the graph.
If Gamma is a graph, the following function tests whether its argument v is a vertex of Gamma.
edgeset
This symbol represents the set of edges of an undirected graph. It takes one argument, the undirected graph.
Given a graph Gamma and two of its vertices v and w, this predicate asserts that they are adjacent.
Every edge in an undirected graph Gamma is a subset of the vertex set of size two.
2
digraph
This symbol refers to a digraph. It has two arguments. The first is the set of vertices, the second is the set of arrows. Arrows are represented by lists of length two, where a list represents the arrow from the first element to the second.
The two-sided infinite directed path.
1
arrowset
This symbol represents the set of arrows of a directed graph. It takes one argument, the directed graph.
The arrow set of the loop consists of one loop.
1
1
1
1
1
source
Given an arrow, this symbol refers to the vertex where the arrow starts. It takes one argument, the arrow.
The arrow [a, b] starts at a.
target
Given an arrow, this symbol refers to the vertex the arrow points to. It takes one argument, the arrow.
The arrow [a, b] points to b.