GraphPower[g,n]
gives the graph-n
power of the graph g.
GraphPower[{vw,…},…]
uses rules vw to specify the graph g.
GraphPower
GraphPower[g,n]
gives the graph-n
power of the graph g.
GraphPower[{vw,…},…]
uses rules vw to specify the graph g.
Details and Options
- The graph-n
power has the same vertices, and vertex vi is adjacent to vertex vj only if there is a path of at most length n from vi to vj. - GraphPower works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (1)
Scope (5)
GraphPower works with undirected graphs:
GraphPower[[image], 2]GraphPower[[image], 2]GraphPower[[image], 2]GraphPower[[image], 2]Use rules to specify the graph:
GraphPower[{1 -> 2, 2 -> 3, 3 -> 1, 3 -> 4}, 2]Properties & Relations (2)
Raising a connected graph to the power of its graph diameter gives a complete graph:
CycleGraph[7]GraphPower[%, GraphDiameter[%]]CompleteGraphQ[%]Graph-![]()
powers can be obtained by the sum of the first
powers of the adjacency matrix:
g = CycleGraph[7]m = AdjacencyMatrix[g];{GraphPower[g, 3], SimpleGraph[AdjacencyGraph[Clip[m + m.m + m.m.m]]]}See Also
Related Guides
Text
Wolfram Research (2010), GraphPower, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphPower.html (updated 2015).
CMS
Wolfram Language. 2010. "GraphPower." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphPower.html.
APA
Wolfram Language. (2010). GraphPower. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphPower.html
BibTeX
@misc{reference.wolfram_2026_graphpower, author="Wolfram Research", title="{GraphPower}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GraphPower.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_graphpower, organization={Wolfram Research}, title={GraphPower}, year={2015}, url={https://reference.wolfram.com/language/ref/GraphPower.html}, note=[Accessed: 13-June-2026]}