-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_dual.py
More file actions
38 lines (28 loc) · 1.23 KB
/
Copy pathpython_dual.py
File metadata and controls
38 lines (28 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
''' python_dual.py '''
#include "util.py"
#include "undirected_graph.py"
#include "fullerenes.py"
K4 = [[1, 3, 2], [2, 3, 0], [0, 3, 1], [0, 1, 2]]
K5me = [[1, 2, 3, 4], [2, 0, 4], [4, 3, 0, 1], [4, 0, 2], [1, 0, 3, 2]]
K = from_adjacency_list(K5me)
assert is_embedding(K)
print("is_embedding(K5-e) verified, has " + str(n_faces_planar(K)) + " faces")
print_graph(K, "K5-e: ")
D = dual_graph(K)
assert is_embedding(D)
print("is_embedding(dual_graph(K5-e)) verified, has " + str(n_faces_planar(D)) + " faces")
print_graph(D, "dual_graph(K5-e): ")
print_graph(dual_graph(D), "dual_graph(dual_graph(K5-e)): ")
#pragma assert is_identical_graph(K, dual_graph(D))
#pragma print("is_identical(K5-e, dual_graph(dual_graph(K5-e))) verified")
#pragma print_graph(dual_graph(D), "dual_graph(dual_graph(K5-e)): ")
#pragma assert is_same_embedding(K, dual_graph(D))
#pragma print("is_same_embedding(K5-e, dual_graph(dual_graph(K5-e))) verified")
for [c, L] in list(enumerate(F)):
K = from_adjacency_list(L)
assert is_embedding(K)
D = dual_graph(K)
assert is_embedding(D)
assert is_embedding(dual_graph(D))
assert is_embedding(dual_graph(D))
print("is_embedding() for C" + str(20 + c * 10) + ", its dual and dual(dual()) verified")