# girth -- A method for computing the girth of a graph

## Synopsis

• Usage:
g = girth G
• Inputs:
• G, an instance of the type Graph,
• Outputs:

## Description

This method computes the girth (the smallest n such that G contains an n-cycle) of any graph. If the graph has no n-cycle as a subgraph, the output will be infinity.

 i1 : girth completeGraph 6 o1 = 3 i2 : girth pathGraph 6 o2 = infinity o2 : InfiniteNumber

## Ways to use girth :

• "girth(Graph)"

## For the programmer

The object girth is .