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

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

> 

with⁡GraphTheory:

> 

with⁡SpecialGraphs:

> 

G≔Graph⁡1,2,1,3,2,3,3,4

G≔Graph 1: an undirected graph with 4 vertices and 4 edges

(1)
> 

IsTriangleFree⁡G

false

(2)
> 

P≔PetersenGraph⁡

P≔Graph 2: an undirected graph with 10 vertices and 15 edges

(3)
> 

IsTriangleFree⁡P

true

(4)
> 

DrawGraph⁡P

> 

C≔ClebschGraph⁡

C≔Graph 3: an undirected graph with 16 vertices and 40 edges

(5)
> 

IsTriangleFree⁡C

true

(6)
> 

DrawGraph⁡C

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