How to find the girth of a graph?

Is there a general rule for finding the girth of a graph.
For example in complete graph, of more than 2 vertices, the girth appears to be always 3.


I am writing this answer by considering that the graph is connected and undirected. (If the graph is not connected just run one BFS or DFS to obtain connected components and run algorithm separately on each of connected component).

The main idea behind the approach below is to check, for each vertex, the length of the shortest cycle it is a part of. If a vertex is in a cycle, there must exist a circular path, starting and ending on itself. BFS can help us find the shortest such path.

We can use BFS to get a naive O( $|V|^2$ +|V||E|). We can do this by running BFS multiple times, each time with the different node as the source. Modify the BFS to stop when it explores a node identical to its root and return its level. This level is the length shortest cycle involving the source (zero-based indexing of levels).

Keep a track of minimum cycle length returned and you have your algorithm working.