OddGirth - Maple Help

GraphTheory

 OddGirth
 find length of shortest odd cycle

 Calling Sequence OddGirth(G)

Parameters

 G - undirected unweighted graph

Description

 • OddGirth returns the length of the shortest odd cycle in a simple graph.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{SpecialGraphs}\left[\mathrm{HypercubeGraph}\right]\left(3\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 8 vertices and 12 edge\left(s\right)}}$ (1)
 > $H≔\mathrm{Subdivide}\left(G,\left\{"000","001"\right\}\right)$
 ${H}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 9 vertices and 13 edge\left(s\right)}}$ (2)
 > $\mathrm{Girth}\left(H\right)$
 ${4}$ (3)
 > $\mathrm{OddGirth}\left(H\right)$
 ${5}$ (4)