Graph Girth Calculator

shortest cycle length

CalculatorsFreeNo Signup
4.5(418 reviews)
All Tools

Loading tool...

About Graph Girth Calculator

A graph girth calculator computing g(G): shortest cycle length. g(tree)=∞. g(K_n)=3. g(K_{m,n})=4. g(Petersen)=5. Moore bound: n ≤ 1+d·Σ(d-1)^i for girth 2k+1 graphs with max degree d. Client-side.

Graph Girth Calculator Features

  • g(G) value
  • Moore bound
  • Cage graphs
  • Common graphs
  • Acyclic check
Graph girth g(G): length of shortest cycle. g=∞ for forests. g(K_n)=3, g(K_{m,n})=4 (m,n≥2), g(Petersen)=5. A (d,g)-cage is the smallest d-regular graph with girth g. Moore bound limits graph size given degree and girth.

How to Use

Select graph:

  • g(G): Girth
  • Moore: Size bound
  • Cage: Smallest regular

Moore Bound

For d-regular graph with girth g: n ≤ M(d,g). For odd g=2k+1: M = 1+d·((d-1)^k-1)/(d-2). For even g=2k: M = 2·((d-1)^k-1)/(d-2). Graphs meeting this bound are Moore graphs. Only 5 known Moore graphs!

Cage Graphs

(d,g)-cage: smallest d-regular graph with girth g. (3,5)-cage = Petersen (10 vertices). (3,6)-cage = Heawood (14). Finding cages is a major open problem. Many cages are unknown.

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Compute girth.
  3. 3Check Moore.
  4. 4Find cage.
  5. 5Compare graphs.

Graph Girth Calculator — Frequently Asked Questions

How is girth computed?+

BFS from each vertex: when BFS finds an edge to an already-visited vertex at same level, we have a cycle. Track shortest. O(n·m) total. For sparse graphs, can be faster with randomization.

What are Moore graphs?+

Graphs meeting the Moore bound exactly. Only known: K_n (girth 3), odd cycles (girth = n), Petersen (3-regular, girth 5), Hoffman-Singleton (7-regular, girth 5), and possibly one more (57-regular, girth 5, unknown).

What's the relationship with chromatic number?+

High girth graphs can still have high χ! Erdős (1959) proved: for any g,k, there exist graphs with girth≥g and χ≥k. This was proved probabilistically. Triangle-free (g≥4) graphs can have arbitrarily large χ.

Share this tool: