[ library(graph_algorithms) | Reference Manual | Alphabetic Index ]

make_graph_symbolic(+NodeNameArray, ++SymbolicEdgeList, -Graph)

Creates a graph using node names
array of ground data, usually node names
(possibly empty) list of edge/3 structures in no particular order
will be bound to a graph structure


This predicate is similar to make_graph/3 in that it creates a graph data structure according to the given information. If the nodes have names, then make_graph_symbolic/3 allows to specify the graph in a more readable way by using the node names rather than node numbers in the edge specifications. The node names are given as the array NodeNameArray, and the symbolic edges are written in the form

	edge(SourceName, TargetName, EdgeData)
where SourceName and TargetName should match an entry (usually the node name) in NodeNameArray. Note the use of the functor edge/3 for the symbolic edge representation as opposed to e/3 for the internal edge representation.

Modes and Determinism


    % the 13-node undirected graph from Sedgewick:Algorithms
	[ edge(a,f,1),edge(a,b,1),edge(a,g,1),edge(c,a,1),edge(d,f,1),edge(e,d,1),
	  edge(j,k,1),edge(j,l,1),edge(j,m,1),edge(l,g,1),edge(l,m,1),edge(m,l,1) ],

See Also

make_graph / 3, library(graphviz)