| Graph( Edges( Edge(lab1,n1,n2), ... ), Nodes( lab1, lab2, ... ) )
|
| Where Edges describes the set of edges and
Nodes describes the set of nodes. Alternatively, and only as input,
graphs can be represented with the standard notation of set of
vertices and sets of edges. In this case an edge is represented
as a set of two vertices. A node (or vertex) can be represented
by any valid object in Darwin. Usually integers are used.
Notice that the values of Edge must correspond to a node, hence if
you use complicated objects as nodes, these have to be replicated
every time you include them in an Edge.
|
| Examples
| > Graph({a,b,c},{{a,b},{a,c},{b,c}});
Graph(Edges(Edge(0,a,b),Edge(0,a,c),Edge(0,b,c)),Nodes(a,b,c))
> Graph(Edges(Edge(0,10,20),Edge(0,10,35)), Nodes(0,10,20,35));
Graph(Edges(Edge(0,10,20),Edge(0,10,35)),Nodes(0,10,20,35))
> Graph(Edges(Edge(0,10,20),Edge(0,10,35)));
Graph(Edges(Edge(0,10,20),Edge(0,10,35)),Nodes(10,20,35))
|