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

# ladderGraph -- Returns a ladder graph

- Usage:
    `G = ladderGraph n`
- Inputs:
  - n, an integer, The length length of the ladder
- Outputs:
  - G, a graph, The ladder Graph

## Description

A ladder graph of length n is two path graphs of size n each joined by a set of n edges. The first edge connects the top elements, the second the second elements and the last edge connects the bottom elements, making a 2 by n grid that looks like a ladder.

    i1 : ladderGraph 5

    o1 = Graph{0 => {1, 5}   }
               1 => {0, 2, 6}
               2 => {1, 3, 7}
               3 => {2, 4, 8}
               4 => {3, 9}
               5 => {0, 6}
               6 => {1, 5, 7}
               7 => {2, 6, 8}
               8 => {3, 7, 9}
               9 => {4, 8}

    o1 : Graph

## See also

- circularLadder -- Returns a circular ladder graph

## Ways to use ladderGraph:

- `ladderGraph(ZZ)`

## For the programmer

The object ladderGraph is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Graphs.m2:2657:0.