#N=4 h4_list=[] h4_list.append(Graph({0:[1,3], 1:[2], 2:[3]})) h4_graphs=[] for g in graphs.nauty_geng("4 -c"): if not g.is_planar(): continue for h in h4_list: if g in h4_list or g.subgraph_search(h) is not None: h4_graphs.append(g) break for g in h4_graphs: is_base=False for h in h4_list: if g.is_isomorphic(h): is_base=True break if is_base: c='#FF9900' else: c='#00FF00' g.show(layout="planar", vertex_color=c) #N=5 h5_list=[] h5_list.append(Graph({0:[1,3,4], 1:[2,4], 2:[3], 3:[4]})) h5_graphs=[] for g in graphs.nauty_geng("5 -c"): if not g.is_planar(): continue for h in h5_list: if g in h5_list or g.subgraph_search(h) is not None: h5_graphs.append(g) break for g in h5_graphs: is_base=False for h in h5_list: if g.is_isomorphic(h): is_base=True break if is_base: c='#FF9900' else: c='#00FF00' g.show(layout="planar", vertex_color=c) #N=6 h6_list=[] h6_list.append(Graph({0:[1,3,5], 1:[2,5], 2:[3,4], 3:[4], 4:[5]})) h6_list.append(Graph({0:[1,2,3,5], 1:[2,4], 2:[3,4], 3:[4], 4:[5]})) h6_list.append(Graph({0:[1,4,5], 1:[2,3,5], 2:[3,4], 3:[4], 4:[5]})) h6_graphs=[] for g in graphs.nauty_geng("6 -c"): if not g.is_planar(): continue for h in h6_list: if g in h6_list or g.subgraph_search(h) is not None: h6_graphs.append(g) break for g in h6_graphs: is_base=False for h in h6_list: if g.is_isomorphic(h): is_base=True break if is_base: c='#FF9900' else: c='#00FF00' g.show(layout="planar", vertex_color=c) #N=7 h7_list=[] h7_list.append(Graph({0:[1,2,4,5,6], 1:[2,3], 2:[3,6], 3:[4,5], 4:[5], 5:[6]})) h7_list.append(Graph({0:[1,3,6], 1:[2,3,6], 2:[3,6], 3:[4,5], 4:[5,6], 5:[6]})) h7_list.append(Graph({0:[1,3,4,6], 1:[2,3,6], 2:[3,5], 3:[4], 4:[5], 5:[6]})) h7_graphs=[] for g in graphs.nauty_geng("7 -c"): if not g.is_planar(): continue for h in h7_list: if g in h7_list or g.subgraph_search(h) is not None: h7_graphs.append(g) break for g in h7_graphs: is_base=False for h in h7_list: if g.is_isomorphic(h): is_base=True break if is_base: c='#FF9900' else: c='#00FF00' g.show(layout="planar", vertex_color=c) #N=8 h8_list=[] h8_list.append(Graph({0:[1,2,6,7], 1:[2,3,7], 2:[3,4], 3:[4,5], 4:[5,6], 5:[6,7], 6:[7]})) h8_list.append(Graph({0:[1,5,7], 1:[2,3,4,6,7], 2:[3,5], 3:[4,5], 4:[5], 5:[6,7], 6:[7]})) h8_list.append(Graph({0:[1,2,5,6,7], 1:[2,4], 2:[3,4,7], 3:[4,6,7], 4:[5,6], 5:[6], 6:[7]})) h8_list.append(Graph({0:[1,2,3,4,7], 1:[2,6], 2:[3,5,6], 3:[4], 4:[5,6,7], 5:[6], 6:[7]})) h8_graphs=[] for g in graphs.nauty_geng("8 -c"): if not g.is_planar(): continue for h in h8_list: if g in h8_list or g.subgraph_search(h) is not None: h8_graphs.append(g) break for g in h8_graphs: is_base=False for h in h8_list: if g.is_isomorphic(h): is_base=True break if is_base: c='#FF9900' else: c='#00FF00' g.show(layout="planar", vertex_color=c)