Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Some Visualizations using CoCalc

Views: 1342

Sage is extremely powerful for graph theory...

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)
(3,7)(4,5)(8,9),(2,6)(3,8)(4,5)(7,9),(1,4,5)(2,3,8,6,9,7),(0,1)(2,4,6,5)(3,9,8,7)\displaystyle \langle (3,7)(4,5)(8,9), (2,6)(3,8)(4,5)(7,9), (1,4,5)(2,3,8,6,9,7), (0,1)(2,4,6,5)(3,9,8,7) \rangle
H.order()
120
%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)
d3-based renderer not yet implemented
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]"