Differences between revisions 14 and 16 (spanning 2 versions)
Revision 14 as of 2012-05-09 03:21:19
Size: 9363
Editor: jason
Comment:
Revision 16 as of 2019-04-06 06:17:36
Size: 9933
Editor: chapoton
Comment: py3 print
Deletions are marked like this. Additions are marked like this.
Line 33: Line 33:
    print docs[0:doc_ex_loc].replace('\n ','\n')     print(docs[0:doc_ex_loc].replace('\n ','\n'))
Line 38: Line 38:
            print "Invalid arguments, using default"             print("Invalid arguments, using default")
Line 55: Line 55:
    print graph     print(graph)
Line 57: Line 57:
       print "n = %s (number of vertices)"%n        print("n = %s (number of vertices)" % n)
Line 61: Line 61:
           print "n reduced to 8"            print("n reduced to 8")
Line 63: Line 63:
       print "n = %s (dimension)"%n        print("n = %s (dimension)" % n)
Line 66: Line 66:
       print "n = %s (number of vertices)"%n
       print "p = %s%% (edge probability)"%p
       G = graphs.RandomGNP(n, p/100.0)
    print G.automorphism_group()
       print("n = %s (number of vertices)" % n)
       print("p = %s%% (edge probability)" % p)
       G = graphs.RandomGNP(n, p / 100.0)
    print(G.automorphism_group())
Line 98: Line 98:
def animate_contraction(g, e, frames = 12, **kwds):
    v1, v2 = e
    if not g.has_edge(v1,v2):
        raise ValueError, "Given edge not found on Graph"
    ls = []
    posd = g.get_pos()
    for j in range(frames):
        gp = Graph(g)
        posdp = dict(posd)
        p1 = posdp[v1]
        p2 = posdp[v2]
        posdp[v2] = [a*(frames-j)/frames + b*j/frames
                    for a,b in zip(p2,p1)]

        gp.set_pos(posdp)
        ls.append(plot(gp, **kwds))
    return ls
Line 234: Line 252:
      g = selector(graph_list.keys(), buttons = True),       g = selector(graph_list.keys(), buttons = True,default='CompleteGraph4'),
Line 236: Line 254:
      m = selector(graph_list.keys(), buttons = True),
      u3 = text_control(value='''? It is has, show it to me,
      m = selector(graph_list.keys(), buttons = True,default='CycleGraph4'),
      u3 = text_control(value='''? If it has, show it to me,
Line 251: Line 269:

Sage Interactions - Graph Theory

goto interact main page

Graph Browser

by Marshall Hampton

graph_browse.png

Automorphism Groups of some Graphs

by William Stein:

auto_graph2.png

View an induced subgraph

by Jason Grout

subgraph-interact.png

Animations of Graph Minors

by Pablo Angulo

wagner.gif

interact/graph_theory (last edited 2020-02-08 12:53:38 by chapoton)