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 : G = graph {{1,2},{1,4},{1,6},{3,2},{3,4},{3,6},{5,2},{5,4},{5,6}}; |
i2 : relabelBipartite G o2 = Graph{0 => {3, 4, 5}} 1 => {3, 4, 5} 2 => {3, 4, 5} 3 => {0, 1, 2} 4 => {0, 1, 2} 5 => {0, 1, 2} o2 : Graph |
If any of the inputs are not bipartite graphs, then the method throws an error.
The object relabelBipartite is a method function.