GraphTriangleCount
✖
GraphTriangleCount
Details

- GraphTriangleCount is also known as triangle count and three-vertex clique count.
- GraphTriangleCount is typically used to measure clustering and connectivity in a graph.
- GraphTriangleCount[g] counts cycles of length 3 in the graph g.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
GraphTriangleCount works with undirected graphs:

https://wolfram.com/xid/0dc169ub65ci-b1cxtq


https://wolfram.com/xid/0dc169ub65ci-cy689y

Use rules to specify the graph:

https://wolfram.com/xid/0dc169ub65ci-bndh30

GraphTriangleCount works with large graphs:

https://wolfram.com/xid/0dc169ub65ci-lkg873

https://wolfram.com/xid/0dc169ub65ci-gfgajd


https://wolfram.com/xid/0dc169ub65ci-b5ef0w

Applications (1)Sample problems that can be solved with this function
Compute the transitivity of a graph:

https://wolfram.com/xid/0dc169ub65ci-jwozp4

https://wolfram.com/xid/0dc169ub65ci-qwcclh

Compare with GlobalClusteringCoefficient:

https://wolfram.com/xid/0dc169ub65ci-c2jxkn

Properties & Relations (2)Properties of the function, and connections to other functions
Use MatrixPower to count triangles in a graph:

https://wolfram.com/xid/0dc169ub65ci-rpqfjz

https://wolfram.com/xid/0dc169ub65ci-3tc3r


https://wolfram.com/xid/0dc169ub65ci-v32ac

Use FindCycle to list triangles in a graph:

https://wolfram.com/xid/0dc169ub65ci-w4bz9o

https://wolfram.com/xid/0dc169ub65ci-292kd0


https://wolfram.com/xid/0dc169ub65ci-7xuvse


https://wolfram.com/xid/0dc169ub65ci-tsjraj

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.
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.
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
Wolfram Language. (2024). GraphTriangleCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphTriangleCount.html
BibTeX
@misc{reference.wolfram_2025_graphtrianglecount, author="Wolfram Research", title="{GraphTriangleCount}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/GraphTriangleCount.html}", note=[Accessed: 08-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_graphtrianglecount, organization={Wolfram Research}, title={GraphTriangleCount}, year={2024}, url={https://reference.wolfram.com/language/ref/GraphTriangleCount.html}, note=[Accessed: 08-July-2025
]}