PathGraph

PathGraph[{v1,v2,}]

yields a path with vertices vi and edges between vi and vi+1 .

PathGraph[{e1,e2,}]

yields a path with edges ej.

PathGraph[{v1,v2,},{e1,e2,}]

yields a path with vertices vi and edges ej.

PathGraph[{,wi[vi,],},{,wj[ej,],}]

yields a path with vertex and edge properties defined by the symbolic wrappers wk.

PathGraph[{vivj,}]

uses rules vi->vj to specify a path.

Details and Options

  • PathGraph generates a Graph object.
  • PathGraph supports the same vertices, edges, wrappers, and options as Graph.
  • An undirected path graph is a connected graph where each vertex has at most degree two.
  • A directed path graph is a connected graph where each vertex has at most in-degree one and at most out-degree one.
  • PathGraph can only represent self-avoiding paths, except for cycles.

Examples

open allclose all

Basic Examples  (2)

A path constructed from a list of vertices:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

A list of edges:

In[1]:=
Click for copyable input
Out[1]=

Scope  (6)

Options  (82)

Applications  (6)

Properties & Relations  (10)

See Also

Graph  UndirectedEdge  DirectedEdge  PathGraphQ

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)