GraphTheory
Trail
construct a trail through a graph
Calling Sequence
Parameters
Description
Examples
Trail(vseq)
vseq
-
list or sequence of vertices
The Trail inert function is used as a short form description of edges in a graph passing through a vertex sequence/list in the given order. For example, Trail(1,2,3,4) or Trail([1,2,3,4]) are short forms to specify a trail through the vertices that generates the edges 1,2, 2,3 and 3,4.
The Trail function is only understood by the functions that construct graphs (Graph and Digraph) as well as functions that add edges to a graph or remove edges from a graph (AddEdge, DeleteEdge, AddArc, and DeleteArc). It is also used as a return value for a specified path (IsEulerian).
with⁡GraphTheory:
G≔Graph⁡4,Trail⁡1,2,3,4,1
G≔Graph 1: an undirected graph with 4 vertices and 4 edge(s)
Edges⁡G
1,2,1,4,2,3,3,4
G≔Digraph⁡4,Trail⁡1,2,3,4,1
G≔Graph 2: a directed graph with 4 vertices and 4 arc(s)
1,2,2,3,3,4,4,1
G≔Graph⁡4
G≔Graph 3: an undirected graph with 4 vertices and 0 edge(s)
AddEdge⁡G,Trail⁡1,2,3,4,1,inplace=true
Graph 3: an undirected graph with 4 vertices and 4 edge(s)
IsEulerian⁡G,T
true
T
Trail⁡1,2,3,4,1
G≔Digraph⁡4
G≔Graph 4: a directed graph with 4 vertices and 0 arc(s)
AddArc⁡G,Trail⁡4,3,2,1,4,inplace=true
Graph 4: a directed graph with 4 vertices and 4 arc(s)
1,4,2,1,3,2,4,3
See Also
AddArc
AddEdge
DeleteArc
DeleteEdge
Digraph
Graph
Download Help Document