This method generates all bipartite graphs on n vertices. The The size of the bipartition is specified by giving the size of one part; the other part is determined automatically from the number of vertices.
If a PolynomialRing R is supplied instead, then the number of vertices is the number of generators. Moreover, the Strings are automatically converted to graphs in R.
i1 : R = QQ[a..e]; |
i2 : generateBipartiteGraphs(R, 2) o2 = {Graph{edges => {} }, Graph{edges => {{a, e}} }, ring => R ring => R vertices => {a, b, c, d, e} vertices => {a, b, c, d, e} ------------------------------------------------------------------------ Graph{edges => {{a, e}, {b, e}} }, Graph{edges => {{a, d}, {a, e}} }, ring => R ring => R vertices => {a, b, c, d, e} vertices => {a, b, c, d, e} ------------------------------------------------------------------------ Graph{edges => {{a, d}, {b, e}} }, Graph{edges => {{a, d}, {a, e}, {b, ring => R ring => R vertices => {a, b, c, d, e} vertices => {a, b, c, d, e} ------------------------------------------------------------------------ e}}}, Graph{edges => {{a, d}, {b, d}, {a, e}, {b, e}}}, ring => R vertices => {a, b, c, d, e} ------------------------------------------------------------------------ Graph{edges => {{a, c}, {a, d}, {a, e}}}, Graph{edges => {{a, c}, {a, ring => R ring => R vertices => {a, b, c, d, e} vertices => {a, b, c, ------------------------------------------------------------------------ d}, {a, e}, {b, e}}}, Graph{edges => {{a, c}, {b, d}, {a, e}}}, ring => R d, e} vertices => {a, b, c, d, e} ------------------------------------------------------------------------ Graph{edges => {{a, c}, {b, d}, {a, e}, {b, e}}}, ring => R vertices => {a, b, c, d, e} ------------------------------------------------------------------------ Graph{edges => {{a, c}, {a, d}, {b, d}, {a, e}, {b, e}}}, ring => R vertices => {a, b, c, d, e} ------------------------------------------------------------------------ Graph{edges => {{a, c}, {b, c}, {a, d}, {b, d}, {a, e}, {b, e}}}} ring => R vertices => {a, b, c, d, e} o2 : List |