Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc-example-files
Path: blob/master/sage/interact/Graph/automorphism.sagews
Views: 1118
@interact def _(graph=['CycleGraph', 'CubeGraph', 'RandomGNP'], n=selector([1..10],nrows=1), p=selector([10,20,..,100],nrows=1)): print graph if graph == 'CycleGraph': print "n = %s (number of vertices)"%n G = graphs.CycleGraph(n) elif graph == 'CubeGraph': if n > 8: print "n reduced to 8" n = 8 print "n = %s (dimension)"%n G = graphs.CubeGraph(n) elif graph == 'RandomGNP': print "n = %s (number of vertices)"%n print "p = %s%% (edge probability)"%p G = graphs.RandomGNP(n, p/100.0) print G.automorphism_group() show(plot(G))
Interact: please open in CoCalc