Macaulay2 » Documentation
Packages » Graphs :: numberOfTriangles
next | previous | forward | backward | up | index | toc

numberOfTriangles -- counts how many subtriangles are present in a graph

Description

A triangle is formed by three vertexSet which are mutually adjacent.

i1 : G = graph({{1,2},{2,3},{3,1},{3,4},{2,4}},EntryMode=>"edges");
i2 : numberOfTriangles G

o2 = 2

See also

Ways to use numberOfTriangles:

  • numberOfTriangles(Graph)

For the programmer

The object numberOfTriangles is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.25.06+ds/M2/Macaulay2/packages/Graphs.m2:3965:0.