Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Return the girth of a graph
ResourceFunction["Girth"][g] returns the girth of the graph g. |
Find the girth of a graph:
In[1]:= | ![]() |
Out[1]= | ![]() |
Works with undirected graphs:
In[2]:= | ![]() |
Out[2]= | ![]() |
Directed graphs:
In[3]:= | ![]() |
Out[3]= | ![]() |
Weighted graphs:
In[4]:= | ![]() |
Out[4]= | ![]() |
Multigraphs:
In[5]:= | ![]() |
Out[5]= | ![]() |
Acyclic graphs have infinite girth:
In[6]:= | ![]() |
Out[6]= | ![]() |
Check the smallest directed cage graph for girth 5:
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
We can check the girth of some famous cage graphs:
In[9]:= | ![]() |
Out[9]= | ![]() |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License