xxxxxxxxxx
@cached_function
def statistic(w):
def children(m):
for (a,b),(c,d) in m.crossings():
m_new = list(m)
m_new.remove((a,b))
m_new.remove((c,d))
A, B = min(a,b), max(a,b)
C, D = min(c,d), max(c,d)
if C < A:
(A,B),(C,D) = (C,D),(A,B)
yield PerfectMatching(m_new + [(A,C), (B,D)])
yield PerfectMatching(m_new + [(A,D), (B,C)])
w = PerfectMatching(sorted([sorted(a) for a in w]))
l = [statistic(v) for v in children(w)]
if len(l) == 0:
return 0
else:
return 1+min(l)
parent_initializer = PerfectMatchings
element_repr = lambda m: str(sorted(tuple(sorted(b)) for b in m))
levels = [2, 4, 6, 8]
for level in levels:
for elt in parent_initializer(level):
print('%s => %s' % (element_repr(elt), statistic(elt)))
Sorry, this statistic was not found in the database
go back and search again
or
add this statistic to the database – it's very simple and we need your support!