This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# PathGraphQ

 PathGraphQ[g] yields True if the graph g is a path and False otherwise.
• 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.
Test whether a graph is a path:
The vertex degree is at most 2:
A complete graph is not a path:
The vertex degree is greater than 2:
Test whether a graph is a path:
 Out[1]=
 Out[2]=
The vertex degree is at most 2:
 Out[3]=

A complete graph is not a path:
 Out[1]=
 Out[2]=
The vertex degree is greater than 2:
 Out[3]=
 Scope   (3)
Test undirected and directed graphs:
PathGraphQ gives False for anything that is not a path graph:
Test large graphs:
A path graph is loop-free if it has more than one vertex:
A one-vertex path graph can have a loop:
A path graph does not necessarily have edges:
Or vertices:
A path graph that starts and ends in the same vertex is a cycle graph:
A path graph with no repeated vertices is a tree:
An acyclic path graph is simple:
And also bipartite:
GridGraph are all path graphs:
A path graph is connected and each vertex has at most degree 2:
The line graph of a path is isomorphic to :
PathGraphQ gives False for non-explicit graphs:
New in 8