This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


gives the graph-n^(th) power of the graph g.
  • The graph-n^(th) power has the same vertices and vertex is adjacent to vertex only if there is a path of at most length n from to .
Graph power of cycle graphs:
Graph power of cycle graphs:
Click for copyable input
Click for copyable input
GraphPower works with undirected graphs:
Directed graphs:
Raising a connected graph to the power of its graph diameter gives a complete graph:
Graph-^(th) powers can be obtained by the sum of the first powers of the adjacency matrix:
New in 8