math1um / objects-invariants-properties

Objects, Invariants and Properties for Graph Theory (GT) automated conjecturing: in particular with the Sage program CONJECTURING: http://nvcleemp.github.io/conjecturing/
GNU General Public License v3.0
15 stars 6 forks source link

Add auxiliary function: #633

Open math1um opened 3 years ago

math1um commented 3 years ago

from: Loh, Po-Shen, and Jie Ma. "Diameter critical graphs." Journal of Combinatorial Theory, Series B 117 (2016): 34-58.

returned graph is guaranteed to be diameter-2-critical

compare Issues #631 and #632

add this in AUXILIARY FUNCTIONS

def diameter_2_critical_generator(g): #g and g_complement must be no more than diameter 2

if not g.is_connected() or g.diameter() > 2: return None gc = g.complement()

if not gc.is_connected() or gc.diameter() > 2:
    return None

h = g.disjoint_union(gc)
n = g.order()

for v in g.vertices():
    h.add_edge((0,v),(1,v))

h.relabel()
return h