IsTriangleFree - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

IsTriangleFree

  

test if graph is triangle-free

 

Calling Sequence

Parameters

Options

Description

Definition

Examples

Compatibility

Calling Sequence

IsTriangleFree(G,opts)

Parameters

G

-

graph

opts

-

(optional) equation of the form usecached=true or usecached=false

Options

• 

usecached : keyword option of the form usecached=true or usecached=false. This specifies whether a previously stored clique number should be used, if available. The default is true.

Description

• 

The IsTriangleFree(G) command returns true if G is a triangle-free graph and false otherwise.

Definition

• 

An undirected graph G is triangle-free if it does not contain any cycle of length 3. This is equivalent to stating the clique number of G is less than 3.

Examples

withGraphTheory:

withSpecialGraphs:

GGraph1,2,1,3,2,3,3,4

GGraph 1: an undirected graph with 4 vertices and 4 edge(s)

(1)

IsTriangleFreeG

false

(2)

PPetersenGraph

PGraph 2: an undirected graph with 10 vertices and 15 edge(s)

(3)

IsTriangleFreeP

true

(4)

DrawGraphP

CClebschGraph

CGraph 3: an undirected graph with 16 vertices and 40 edge(s)

(5)

IsTriangleFreeC

true

(6)

DrawGraphC

Compatibility

• 

The GraphTheory[IsTriangleFree] command was introduced in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

CliqueNumber

CycleBasis