Macaulay2 » Documentation
Packages » Graphs :: graphPower
next | previous | forward | backward | up | index | toc

graphPower -- constructs a graph raised to a power

Synopsis

Description

G^k is the graph with the same vertices as G, where the vertices of G^k are adjacent if they are separated by distance less than or equal to k in graph G. If the diameter of G is d, G^d is the complete graph with the same number of vertices as G.

i1 : G = cycleGraph 6;
i2 : graphPower(G,2)

o2 = Graph{0 => {1, 2, 4, 5}}
           1 => {0, 2, 3, 5}
           2 => {0, 1, 3, 4}
           3 => {1, 2, 4, 5}
           4 => {0, 2, 3, 5}
           5 => {0, 1, 3, 4}

o2 : Graph

See also

Ways to use graphPower :

For the programmer

The object graphPower is a method function.