GraphPower

GraphPower[g,n]

gives the graph-n^(th) power of the graph g.

GraphPower[{vw,},]

uses rules vw to specify the graph g.

Details and Options

  • The graph-n^(th) 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 allclose all

Basic Examples  (1)

Graph power of cycle graphs:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (5)

Properties & Relations  (2)

See Also

Graph  AdjacencyMatrix

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)