diff --git a/graph_tools/parameters.py b/graph_tools/parameters.py index e57cd6010720c6a9360f1471ecffa6feb4d4f9dd..e484005d60ab2a9b24b02ec4d3312a31153447f2 100644 --- a/graph_tools/parameters.py +++ b/graph_tools/parameters.py @@ -174,67 +174,6 @@ def _init_(): def finalize(self, b): return b[0].value - @Singleton - class HamiltonianCycle(GraphParameterBase): - FREE_EDGE = [ BV((1, 1), 1), BV((None, None), 1) ] - CUBIC_VERTEX = [ - BV((1, 1, None), 1), - BV((1, None, 1), 1), - BV((None, 1, 1), 1) - ] - - def join_boundaries(self, x, _): - offsets = [ 0 ] - try: - for b in x: - offsets.append(offsets[-1] + max_(b.boundary)) - except ValueError: - return - - def shift(k, off): - if k is None: return None - return k + off - - ret_b = tuple(chain(*[ - [ shift(x, offsets[i]) for x in b.boundary ] for i, b in enumerate(x) - ])) - - yield BV(ret_b, prod( b.value for b in x )) - - def join_edges(self, b, e1, e2): - # print("%s %s %s" % (b, e1, e2)) - c1 = b.boundary[e1] - c2 = b.boundary[e2] - - if c1 is None and c2 is None: yield b - if c1 is None or c2 is None: return - - if c1 != c2: - if c1 > c2: c1, c2 = c2, c1 - boundary = tuple( v if v != c2 else c1 for v in b.boundary ) - yield BV(boundary, b.value) - elif max_(b.boundary) == 1: - yield b - - def project_and_canonize(self, p, b): - boundary = select(p, b) - rename = { None: None } - i = 1 - for x in boundary: - if x not in rename: - rename[x] = i - i += 1 - boundary = tuple( rename[x] for x in boundary ) - return boundary - - def finalize(self, b): - assert len(b) <= 1 - if len(b) == 0: return 0 - assert b[0].boundary == tuple() - return b[0].value - - - @Singleton class CircuitDoubleCover(GraphParameterBase): FREE_EDGE = [ BV(((1,2), (1,2), None), Fraction(1, 2)) ]