add-path ( graph nodes -- graph' )
Graphviz > Graphviz data structures

Prev:add-nodes ( graph nodes -- graph' )


Vocabulary
graphviz

Inputs and outputs
grapha graph or a subgraph
nodesa sequence
graph'a graph or a subgraph


Word description
Adds edges to graph corresponding to a path through nodes.

That is, an edge is added between each object and the one immediately following it in nodes. Thus, the following two lines are equivalent:
{ A B C D E } add-path A B add-edge B C add-edge C D add-edge D E add-edge


Examples
USING: accessors graphviz prettyprint sequences ; <graph> f add-path statements>> empty? .
t


USING: accessors graphviz prettyprint sequences ; <graph> { "the cheese stands alone" } add-path statements>> empty? .
t


USING: accessors graphviz io kernel sequences ; <digraph> { 1 2 3 4 5 } add-path statements>> [ dup tail>> write " -> " write head>> print ] each
1 -> 2 2 -> 3 3 -> 4 4 -> 5


USING: accessors graphviz io kernel sequences ; <strict-digraph> { "cycle" "cycle" } add-path statements>> [ dup tail>> write " -> " write head>> print ] each
cycle -> cycle


See also
add, add-node, add-nodes

Definition