Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
2188 views
1
'''
2
This file assumes that the conjecturing spkg and nauty spkg is installed and that 'conjecturing.py' and
3
'graphtheory.py' are loaded.
4
'''
5
6
def automatedGraphSearch(objects, invariants, minimumVertices, maximumVertices, upperBound=True, steps=10, mainInvariant=1):
7
for _ in range(steps):
8
l = conjecture(objects, invariants, mainInvariant, upperBound=upperBound)
9
noCounterExample = True
10
for i in range(minimumVertices, maximumVertices+1):
11
for g in graphs.nauty_geng('-c {}'.format(i)):
12
if any([not c.evaluate(g) for c in l]):
13
print "Adding {}: {}".format(g, g.graph6_string())
14
objects.append(g)
15
noCounterExample = False
16
break
17
if not noCounterExample: break
18
if noCounterExample:
19
print "No counterexample found"
20
break
21
return l
22
23
objects = [graphs.CompleteGraph(3)]
24
25
mainInvariant = invariants.index(dominationNumber)
26
27
conjectures = automatedGraphSearch(objects, invariants, 3, 10, mainInvariant=mainInvariant, steps=100, upperBound=False)
28
29
print("The conjectures are stored in the variable conjectures.")
30
31