WLJS LogoWLJS Notebook

PathGraphQ

PathGraphQ[g] yields True if the graph g is a path and False otherwise.

Examples

PathGraphQ[PathGraph[{1, 2, 3, 4}]]
(* True *)
PathGraphQ[CycleGraph[4]]
(* False *)

Please visit the official Wolfram Language Reference for more details.

On this page