import sys, re, fractions
from fractions import Fraction
+import bounds
+
results = {}
def got(n, m, minfrag, matrix):
for count, col in sorted(colout, reverse=True):
print " %d x (%s)" % (count, " + ".join(map(str,col)))
+ # See what our upper bound techniques have to say about this.
+ bound, reason = bounds.upper_bound(n, m)
+ assert bound >= minfrag, \
+ "(%d,%d) solution %s exceeds upper bound %s" % (
+ n, m, minfrag, bound)
+ if bound == minfrag:
+ print " Proved optimal by", reason
+ else:
+ print " Best upper bound proof (%s) gives %s" % (reason, bound)
+
heading_re = re.compile(r'^(\d+) into (\d+): min fragment ([\d\.]+)')
def read_file(f):