networks(deprecated)/girth - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : networks(deprecated)/girth

networks

  

girth

  

finds shortest cycle in an undirected graph

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

girth(G)

girth(G, shortcycle)

Parameters

G

-

undirected multigraph

shortcycle

-

name used to return edges of the shortest cycle

Description

• 

Important: The networks package has been deprecated.  Use the superseding command GraphTheory[Girth] instead.

• 

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.

> 

with⁡networks:

> 

G≔cycle⁡6:

> 

girth⁡G,scyc

6

(1)
> 

scyc

e1,e2,e3,e4,e5,e6

(2)
> 

ends⁡scyc,G

1,2,2,3,3,4,4,5,5,6,1,6

(3)
> 

delete⁡e1,G:

> 

girth⁡G

∞

(4)
> 

addedge⁡1,G:

> 

girth⁡G,short

1

(5)
> 

ends⁡short,G

1

(6)

See Also

GraphTheory

GraphTheory[Girth]

networks(deprecated)[cycle]