Some Visualizations using CoCalc
See the reference manual on graph theory
G = graphs.HouseGraph() G.plot().save('graph.pdf')
graphs.[tab key]
G = graphs.PetersenGraph() G.show(vertex_colors=G.coloring(hex_colors=True))
H = G.automorphism_group() show(H)
H.order()
%md There is also interactive plotting, but it doesn't support colors (yet):
There is also interactive plotting, but it doesn't support colors (yet):
show(G)
G = graphs.PappusGraph() G.show(vertex_colors=G.coloring(hex_colors=True))
C = graphs.CubeGraph(9) color = {} for v in C.vertices(): b = v.count('1')/9 g = 1 - b if (0, g, b) in color: color[(0, g, b)].append(v) else: color[(0, g, b)] = [v] C.show(vertex_labels=False, graph_border=True, vertex_colors=color, figsize=[9,8])
# Try typing "graphs.[tab key]"... and "graphs.something([tab key]"