Macaulay2 » Documentation
Packages » Nauty :: relabelBipartite
next | previous | forward | backward | up | index | toc

# relabelBipartite -- relabels a bipartite graph so all vertices of a given class are contiguous

- Usage:
    `L' = relabelBipartite L`
    `T = relabelBipartite S`
    `H = relabelBipartite G`
- Inputs:
  - L, a list, a list of bipartite graphs in various formats
  - S, a string, a bipartite graph encoded in either Sparse6 or Graph6 format
  - G, a graph, a bipartite graph
- Outputs:
  - L', a list, a list of graphs isomorphic to $S$
  - T, a string, a graph isomorphic to $S$ encoded in either Sparse6 or Graph6 format
  - H, a graph, a graph isomorphic to $G$

## Description

A bipartite graph can be labeled so all vertices of a given class are contiguous. This method does precisely that to a bipartite graph.

    i1 : R = QQ[a..f];

    i2 : G = graph flatten apply({a,c,e}, v->v*{b,d,f})

    o2 = Graph{"edges" => {{a, b}, {b, c}, {a, d}, {c, d}, {b, e}, {d, e}, {a, f}, {c, f}, {e, f}}}
               "ring" => R
               "vertices" => {a, b, c, d, e, f}

    o2 : Graph

    i3 : relabelBipartite G

    o3 = Graph{"edges" => {{a, d}, {b, d}, {c, d}, {a, e}, {b, e}, {c, e}, {a, f}, {b, f}, {c, f}}}
               "ring" => R
               "vertices" => {a, b, c, d, e, f}

    o3 : Graph

If any of the inputs are not bipartite graphs, then the method throws an error.

## See also

- relabelGraph -- applies a vertex invariant based refinement to a graph

## Ways to use relabelBipartite:

- `relabelBipartite(Graph)`
- `relabelBipartite(List)`
- `relabelBipartite(String)`

## For the programmer

The object relabelBipartite is a method function.

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