networks[girth] - finds shortest cycle in an undirected graph
|
Calling Sequence
|
|
girth(G)
girth(G, shortcycle)
|
|
Parameters
|
|
G
|
-
|
undirected multigraph
|
shortcycle
|
-
|
name used to return edges of the shortest cycle
|
|
|
|
|
Description
|
|
•
|
The girth of a graph is the length of the shortest cycle. This routine returns the girth (or infinity if the graph G has no cycle).
|
•
|
If a name such as shortcycle is specified, then this name is assigned the set of edges forming that shortest cycle.
|
•
|
This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[girth](...).
|
|
|
Examples
|
|
Important: The networks package has been deprecated. Use the superseding command GraphTheory[Girth] instead.
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
>
|
|
| (4) |
>
|
|
>
|
|
| (5) |
>
|
|
| (6) |
|
|
Download Help Document
Was this information helpful?