>

$\mathrm{with}\left(\mathrm{GraphTheory}\right)\:$

>

$\mathrm{with}\left(\mathrm{SpecialGraphs}\right)\:$

>

$C\u2254\mathrm{CycleGraph}\left(5\right)$

${C}{\u2254}{\mathrm{Graph\; 1:\; an\; undirected\; unweighted\; graph\; with\; 5\; vertices\; and\; 5\; edge(s)}}$
 (1) 
>

$\mathrm{IsHamiltonian}\left(C\right)$

>

$\mathrm{FindHamiltonianCycle}\left(C\right)$

$\left[{1}{\,}{2}{\,}{3}{\,}{4}{\,}{5}{\,}{1}\right]$
 (3) 
>

$\mathrm{FindHamiltonianCycle}\left(C\,\mathrm{startvertex}=4\right)$

$\left[{4}{\,}{3}{\,}{2}{\,}{1}{\,}{5}{\,}{4}\right]$
 (4) 
The Petersen graph is not Hamiltonian (that is, it does not contain a Hamiltonian cycle), but it does contain a Hamiltonian path.
>

$P\u2254\mathrm{PetersenGraph}\left(\right)$

${P}{\u2254}{\mathrm{Graph\; 2:\; an\; undirected\; unweighted\; graph\; with\; 10\; vertices\; and\; 15\; edge(s)}}$
 (5) 
>

$\mathrm{IsHamiltonian}\left(P\right)$

>

$\mathrm{FindHamiltonianPath}\left(P\right)$

$\left[{10}{\,}{9}{\,}{8}{\,}{7}{\,}{6}{\,}{1}{\,}{5}{\,}{4}{\,}{3}{\,}{2}\right]$
 (7) 
The Petersen graph has a Hamiltonian path starting at 8 and ending at 4.
>

$\mathrm{FindHamiltonianPath}\left(P\,\mathrm{startvertex}=8\,\mathrm{endvertex}=4\right)$

$\left[{8}{\,}{9}{\,}{10}{\,}{6}{\,}{7}{\,}{3}{\,}{2}{\,}{1}{\,}{5}{\,}{4}\right]$
 (8) 
The Petersen graph does not have a Hamiltonian path starting at 8 and ending at 9.
>

$\mathrm{FindHamiltonianPath}\left(P\,\mathrm{startvertex}=8\,\mathrm{endvertex}=9\right)$
