def test_against_A000111(n): poset = zigzag(n) if n <= 2: a_b_pairs = [] else: a_b_pairs = [(2 * i - 1, 2 * i) for i in range(1, n // 2 + 1)] L = [pi[:] for pi in gen_all_no_sign(n, poset, a_b_pairs)] S = set(tuple(pi) for pi in L) T = (len(L), len(S), A000111[n]) print(T) if len(set(T)) > 1: print("WARNING: Zigzag poset linear extensions " "were not correctly generated.")
def test_zig_zag(): n = 5 poset = zigzag(n) a_b_pairs = [(1, 2), (3, 4)] S = set() for pi in gen_all(n, poset, a_b_pairs): s = to_str(pi) print(s) if s in S: print("DUPLICATE - something went wrong!") S.add(s) print(len(S))