GraphTheory
IsTriangleFree
test if graph is triangle-free
Calling Sequence
Parameters
Options
Description
Definition
Examples
Compatibility
IsTriangleFree(G,opts)
G
-
graph
opts
(optional) equation of the form usecached=true or usecached=false
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.
The IsTriangleFree(G) command returns true if G is a triangle-free graph and false otherwise.
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.
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 edge(s)
IsTriangleFree⁡G
false
P≔PetersenGraph⁡
P≔Graph 2: an undirected graph with 10 vertices and 15 edge(s)
IsTriangleFree⁡P
true
DrawGraph⁡P
C≔ClebschGraph⁡
C≔Graph 3: an undirected graph with 16 vertices and 40 edge(s)
IsTriangleFree⁡C
DrawGraph⁡C
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
Download Help Document