next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Graphs :: graphPower

graphPower -- constructs a graph raised to a power

Synopsis

Description

Gk is the graph with the same vertices as G, where the vertices of Gk are adjacent if they are separated by distance less than or equal to k in graph G. If the diameter of G is d, Gd 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 :