GraphTriangleCount

GraphTriangleCount[g]

gives the number of triangles in the graph g.

Details

Examples

open allclose all

Basic Examples  (2)

Count triangles in a graph:

Count triangles in social networks:

Scope  (4)

GraphTriangleCount works with undirected graphs:

Directed graphs:

Use rules to specify the graph:

GraphTriangleCount works with large graphs:

Applications  (1)

Compute the transitivity of a graph:

Compare with GlobalClusteringCoefficient:

Properties & Relations  (2)

Use MatrixPower to count triangles in a graph:

Use FindCycle to list triangles in a graph:

Possible Issues  (1)

Multi-edges are ignored:

Wolfram Research (2024), GraphTriangleCount, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphTriangleCount.html.

Text

Wolfram Research (2024), GraphTriangleCount, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphTriangleCount.html.

CMS

Wolfram Language. 2024. "GraphTriangleCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GraphTriangleCount.html.

APA

Wolfram Language. (2024). GraphTriangleCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphTriangleCount.html

BibTeX

@misc{reference.wolfram_2024_graphtrianglecount, author="Wolfram Research", title="{GraphTriangleCount}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/GraphTriangleCount.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_graphtrianglecount, organization={Wolfram Research}, title={GraphTriangleCount}, year={2024}, url={https://reference.wolfram.com/language/ref/GraphTriangleCount.html}, note=[Accessed: 22-December-2024 ]}