Ticket #13862: trac_13862-code_reformatting.patch

File trac_13862-code_reformatting.patch, 64.2 KB (added by ncohen, 7 years ago)
  • sage/graphs/generators/basic.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1356522951 -3600
    # Node ID 8be85655c3738f90894ca52e44b278abca582eb3
    # Parent  1caeed35bcfb1376ba784b3c95ce248fae4a7e3a
    Split graph_generators into several files - Doc and code reformatting
    
    diff --git a/sage/graphs/generators/basic.py b/sage/graphs/generators/basic.py
    a b  
    11r"""
    22Basic Graphs
    3 ==================
     3
     4The methods defined here appear in sage.graphs.grah_generators.
    45
    56"""
    67###########################################################################
     
    2324#   Basic Structures
    2425#######################################################################
    2526
    26 def BarbellGraph(self, n1, n2):
     27def BarbellGraph(n1, n2):
    2728    r"""
    2829    Returns a barbell graph with ``2*n1 + n2`` nodes. The argument ``n1``
    2930    must be greater than or equal to 2.
     
    167168    return graph.Graph(G, pos=pos_dict, name="Barbell graph")
    168169
    169170
    170 def BuckyBall(self):
     171def BuckyBall():
    171172    r"""
    172173    Create the Bucky Ball graph.
    173174
     
    286287
    287288    return g
    288289
    289 def BullGraph(self):
     290def BullGraph():
    290291    r"""
    291292    Returns a bull graph with 5 nodes.
    292293
     
    359360    G = networkx.bull_graph()
    360361    return graph.Graph(G, pos=pos_dict, name="Bull graph")
    361362
    362 def ButterflyGraph(self):
     363def ButterflyGraph():
    363364    r"""
    364365    Returns the butterfly graph.
    365366
     
    417418        4: [0, 0]}
    418419    return graph.Graph(edge_dict, pos=pos_dict, name="Butterfly graph")
    419420
    420 def CircularLadderGraph(self, n):
     421def CircularLadderGraph(n):
    421422    """
    422423    Returns a circular ladder graph with 2\*n nodes.
    423424
     
    475476    G = networkx.circular_ladder_graph(n)
    476477    return graph.Graph(G, pos=pos_dict, name="Circular Ladder graph")
    477478   
    478 def ClawGraph(self):
     479def ClawGraph():
    479480    """
    480481    Returns a claw graph.
    481482   
     
    503504    G = networkx.complete_bipartite_graph(1,3)
    504505    return graph.Graph(G, pos=pos_dict, name="Claw graph")
    505506
    506 def CycleGraph(self, n):
     507def CycleGraph(n):
    507508    r"""
    508509    Returns a cycle graph with n nodes.
    509510   
     
    582583    G = networkx.cycle_graph(n)
    583584    return graph.Graph(G, pos=pos_dict, name="Cycle graph")
    584585   
    585 def DiamondGraph(self):
     586def DiamondGraph():
    586587    """
    587588    Returns a diamond graph with 4 nodes.
    588589   
     
    609610    G = networkx.diamond_graph()
    610611    return graph.Graph(G, pos=pos_dict, name="Diamond Graph")
    611612   
    612 def EmptyGraph(self):
     613def EmptyGraph():
    613614    """
    614615    Returns an empty graph (0 nodes and 0 edges).
    615616   
     
    648649    """
    649650    return graph.Graph(sparse=True)
    650651
    651 def ToroidalGrid2dGraph(self,n1,n2):
     652def ToroidalGrid2dGraph(n1, n2):
    652653    r"""
    653654    Returns a toroidal 2-dimensional grid graph with `n_1n_2` nodes (`n_1`
    654655    rows and `n_2` columns).
     
    672673        True
    673674    """
    674675
    675     g = self.Grid2dGraph(n1,n2)
     676    g = Grid2dGraph(n1,n2)
    676677
    677678    g.add_edges([((i,0),(i,n2-1)) for i in range(n1)] + [((0,i),(n1-1,i)) for i in range(n2)])
    678679
     
    691692
    692693    return g
    693694
    694 def Toroidal6RegularGrid2dGraph(self, n1, n2):
     695def Toroidal6RegularGrid2dGraph(n1, n2):
    695696    r"""
    696697    Returns a toroidal 6-regular grid.
    697698
     
    739740    if n1 <= 3 or n2 <= 3:
    740741        raise ValueError("Parameters n1 and n2 must be integers larger than 3 !")
    741742
    742     g = self.ToroidalGrid2dGraph(n1,n2)
     743    g = ToroidalGrid2dGraph(n1,n2)
    743744    for u,v in g:
    744745        g.add_edge((u,v),((u+1)%n1,(v+1)%n2))
    745746
    746747    g.name("Toroidal Hexagonal Grid graph on "+str(n1)+"x"+str(n2)+" elements")
    747748    return g
    748749
    749 def Grid2dGraph(self, n1, n2):
     750def Grid2dGraph(n1, n2):
    750751    r"""
    751752    Returns a `2`-dimensional grid graph with `n_1n_2` nodes (`n_1` rows and
    752753    `n_2` columns).
     
    798799    G = networkx.grid_2d_graph(n1,n2)
    799800    return graph.Graph(G, pos=pos_dict, name="2D Grid Graph")
    800801
    801 def GridGraph(self, dim_list):
     802def GridGraph(dim_list):
    802803    """
    803804    Returns an n-dimensional grid graph.
    804805   
     
    833834
    834835
    835836
    836 def HouseGraph(self):
     837def HouseGraph():
    837838    """
    838839    Returns a house graph with 5 nodes.
    839840   
     
    863864    G = networkx.house_graph()
    864865    return graph.Graph(G, pos=pos_dict, name="House Graph")
    865866   
    866 def HouseXGraph(self):
     867def HouseXGraph():
    867868    """
    868869    Returns a house X graph with 5 nodes.
    869870   
     
    894895    G = networkx.house_x_graph()
    895896    return graph.Graph(G, pos=pos_dict, name="House Graph")
    896897
    897 def KrackhardtKiteGraph(self):
     898def KrackhardtKiteGraph():
    898899    """
    899900    Returns a Krackhardt kite graph with 10 nodes.
    900901   
     
    938939    G = networkx.krackhardt_kite_graph()
    939940    return graph.Graph(G, pos=pos_dict, name="Krackhardt Kite Graph")
    940941
    941 def LadderGraph(self, n):
     942def LadderGraph(n):
    942943    """
    943944    Returns a ladder graph with 2\*n nodes.
    944945   
     
    989990    G = networkx.ladder_graph(n)
    990991    return graph.Graph(G, pos=pos_dict, name="Ladder graph")
    991992
    992 def LollipopGraph(self, n1, n2):
     993def LollipopGraph(n1, n2):
    993994    """
    994995    Returns a lollipop graph with n1+n2 nodes.
    995996   
     
    10471048    G = networkx.lollipop_graph(n1,n2)
    10481049    return graph.Graph(G, pos=pos_dict, name="Lollipop Graph")
    10491050   
    1050 def PathGraph(self, n, pos=None):
     1051def PathGraph(n, pos=None):
    10511052    """
    10521053    Returns a path graph with n nodes. Pos argument takes a string
    10531054    which is either 'circle' or 'line', (otherwise the default is
     
    11441145    G = networkx.path_graph(n)
    11451146    return graph.Graph(G, pos=pos_dict, name="Path Graph")
    11461147
    1147 def StarGraph(self, n):
     1148def StarGraph(n):
    11481149    """
    11491150    Returns a star graph with n+1 nodes.
    11501151   
     
    12291230    G = networkx.star_graph(n)
    12301231    return graph.Graph(G, pos=pos_dict, name="Star graph")
    12311232
    1232 def WheelGraph(self, n):
     1233def WheelGraph(n):
    12331234    """
    12341235    Returns a Wheel graph with n nodes.
    12351236   
  • sage/graphs/generators/chessboard.py

    diff --git a/sage/graphs/generators/chessboard.py b/sage/graphs/generators/chessboard.py
    a b  
    2525# Chessboard graphs
    2626###########################################################################
    2727
    28 def ChessboardGraphGenerator(self, dim_list,
     28def ChessboardGraphGenerator(dim_list,
    2929                             rook = True,    rook_radius = None,
    3030                             bishop = True,  bishop_radius = None,
    3131                             knight = True, knight_x = 1, knight_y = 2,
     
    235235    return G, dimstr
    236236
    237237
    238 def QueenGraph(self, dim_list, radius=None, relabel=False):
     238def QueenGraph(dim_list, radius=None, relabel=False):
    239239    r"""
    240240    Returns the `d`-dimensional Queen Graph with prescribed dimensions.
    241241
     
    297297        ...              print "that's not good!"
    298298
    299299    """
    300     G, dimstr = self.ChessboardGraphGenerator(dim_list,
    301                                               rook=True, rook_radius=radius,
    302                                               bishop=True, bishop_radius=radius,
    303                                               knight=False,
    304                                               relabel=relabel)
     300    G, dimstr = ChessboardGraphGenerator(dim_list,
     301                                         rook=True, rook_radius=radius,
     302                                         bishop=True, bishop_radius=radius,
     303                                         knight=False,
     304                                         relabel=relabel)
    305305    if radius is None:
    306306        G.name(dimstr+"-Queen Graph")
    307307    else:
     
    309309    return G
    310310
    311311
    312 def KingGraph(self, dim_list, radius=None, relabel=False):
     312def KingGraph(dim_list, radius=None, relabel=False):
    313313    r"""
    314314    Returns the `d`-dimensional King Graph with prescribed dimensions.
    315315
     
    359359        sage: G.is_isomorphic( H )
    360360        True
    361361    """
    362     G, dimstr = self.ChessboardGraphGenerator(dim_list,
    363                                               rook=True, rook_radius=(1 if radius is None else radius),
    364                                               bishop=True, bishop_radius=(1 if radius is None else radius),
    365                                               knight=False,
    366                                               relabel=relabel)
     362    G, dimstr = ChessboardGraphGenerator(dim_list,
     363                                         rook=True, rook_radius=(1 if radius is None else radius),
     364                                         bishop=True, bishop_radius=(1 if radius is None else radius),
     365                                         knight=False,
     366                                         relabel=relabel)
    367367    if radius is None:
    368368        G.name(dimstr+"-King Graph")
    369369    else:
     
    371371    return G
    372372
    373373
    374 def KnightGraph(self, dim_list, one=1, two=2, relabel=False):
     374def KnightGraph(dim_list, one=1, two=2, relabel=False):
    375375    r"""
    376376    Returns the d-dimensional Knight Graph with prescribed dimensions.
    377377
     
    420420        sage: G.is_hamiltonian()
    421421        True
    422422    """
    423     G, dimstr = self.ChessboardGraphGenerator(dim_list,
    424                                               rook=False, bishop=False,
    425                                               knight=True, knight_x=one, knight_y=two,
    426                                               relabel=relabel)
     423    G, dimstr = ChessboardGraphGenerator(dim_list,
     424                                         rook=False, bishop=False,
     425                                         knight=True, knight_x=one, knight_y=two,
     426                                         relabel=relabel)
    427427    if one+two == 3:
    428428        G.name(dimstr+"-Knight Graph")
    429429    else:
     
    431431    return G
    432432
    433433
    434 def RookGraph(self, dim_list, radius=None, relabel=False):
     434def RookGraph(dim_list, radius=None, relabel=False):
    435435    r"""
    436436    Returns the `d`-dimensional Rook's Graph with prescribed dimensions.
    437437
     
    475475        sage: G.is_isomorphic( H )
    476476        True
    477477    """
    478     G, dimstr = self.ChessboardGraphGenerator(dim_list,
    479                                               rook=True, rook_radius=radius,
    480                                               bishop=False, knight=False,
    481                                               relabel=relabel)
     478    G, dimstr = ChessboardGraphGenerator(dim_list,
     479                                         rook=True, rook_radius=radius,
     480                                         bishop=False, knight=False,
     481                                         relabel=relabel)
    482482    if radius is None:
    483483        G.name(dimstr+"-Rook Graph")
    484484    else:
     
    486486    return G
    487487
    488488
    489 def BishopGraph(self, dim_list, radius=None, relabel=False):
     489def BishopGraph(dim_list, radius=None, relabel=False):
    490490    r"""
    491491    Returns the `d`-dimensional Bishop Graph with prescribed dimensions.
    492492
     
    531531        ...              print "that's not good!"
    532532
    533533    """
    534     G, dimstr = self.ChessboardGraphGenerator(dim_list,
    535                                               rook=False, knight=False,
    536                                               bishop=True, bishop_radius=radius,
    537                                               relabel=relabel)
     534    G, dimstr = ChessboardGraphGenerator(dim_list,
     535                                         rook=False, knight=False,
     536                                         bishop=True, bishop_radius=radius,
     537                                         relabel=relabel)
    538538    if radius is None:
    539539        G.name(dimstr+"-Bishop Graph")
    540540    else:
  • sage/graphs/generators/degree_sequence.py

    diff --git a/sage/graphs/generators/degree_sequence.py b/sage/graphs/generators/degree_sequence.py
    a b  
    11r"""
    22Degree Sequence
    3 =========
     3
     4The methods defined here appear in sage.graphs.grah_generators.
    45"""
    56
    67###########################################################################
     
    2425#   Graphs with a given degree sequence
    2526################################################################################
    2627
    27 def DegreeSequence(self, deg_sequence):
     28def DegreeSequence(deg_sequence):
    2829    """
    2930    Returns a graph with the given degree sequence. Raises a NetworkX
    3031    error if the proposed degree sequence cannot be that of a graph.
     
    7273    import networkx
    7374    return graph.Graph(networkx.havel_hakimi_graph([int(i) for i in deg_sequence]))
    7475
    75 def DegreeSequenceBipartite(self, s1 ,s2 ):
     76def DegreeSequenceBipartite(s1 ,s2 ):
    7677    r"""
    7778    Returns a bipartite graph whose two sets have the given
    7879    degree sequences.
     
    137138    else:
    138139        return Graph(BipartiteGraph(m))
    139140
    140 def DegreeSequenceConfigurationModel(self, deg_sequence, seed=None):
     141def DegreeSequenceConfigurationModel(deg_sequence, seed=None):
    141142    """
    142143    Returns a random pseudograph with the given degree sequence. Raises
    143144    a NetworkX error if the proposed degree sequence cannot be that of
     
    183184    import networkx
    184185    return graph.Graph(networkx.configuration_model([int(i) for i in deg_sequence], seed=seed), loops=True, multiedges=True, sparse=True)
    185186
    186 def DegreeSequenceTree(self, deg_sequence):
     187def DegreeSequenceTree(deg_sequence):
    187188    """
    188189    Returns a tree with the given degree sequence. Raises a NetworkX
    189190    error if the proposed degree sequence cannot be that of a tree.
     
    206207    import networkx
    207208    return graph.Graph(networkx.degree_sequence_tree([int(i) for i in deg_sequence]))
    208209
    209 def DegreeSequenceExpected(self, deg_sequence, seed=None):
     210def DegreeSequenceExpected(deg_sequence, seed=None):
    210211    """
    211212    Returns a random graph with expected given degree sequence. Raises
    212213    a NetworkX error if the proposed degree sequence cannot be that of
  • sage/graphs/generators/families.py

    diff --git a/sage/graphs/generators/families.py b/sage/graphs/generators/families.py
    a b  
    11r"""
    22Families of graphs
    3 ==================
    43
    5 This file gathers generators for some families of graphs.
    6 - :meth:`RingedTree <GraphGenerators.RingedTree>`
     4The methods defined here appear in sage.graphs.grah_generators.
    75
    86AUTHORS:
    97
     
    2624from sage.graphs import graph
    2725from math import sin, cos, pi
    2826
    29 def HararyGraph( self, k, n ):
     27def HararyGraph( k, n ):
    3028    r"""
    3129    Returns the Harary graph on `n` vertices and connectivity `k`, where
    3230    `2 \leq k < n`.
     
    7068        raise ValueError("Number of vertices n should be greater than k.")
    7169
    7270    if k%2 == 0:
    73         G = self.CirculantGraph( n, range(1,k/2+1) )
     71        G = CirculantGraph( n, range(1,k/2+1) )
    7472    else:
    7573        if n%2 == 0:
    76             G = self.CirculantGraph( n, range(1,(k-1)/2+1) )
     74            G = CirculantGraph( n, range(1,(k-1)/2+1) )
    7775            for i in range(n):
    7876                G.add_edge( i, (i+n/2)%n )
    7977        else:
    80             G = self.HararyGraph( k-1, n )
     78            G = HararyGraph( k-1, n )
    8179            for i in range((n-1)/2+1):
    8280                G.add_edge( i, (i+(n-1)/2)%n )
    8381    G.name('Harary graph {0}, {1}'.format(k,n))
    8482    return G
    8583
    86 def DorogovtsevGoltsevMendesGraph(self, n):
     84def DorogovtsevGoltsevMendesGraph(n):
    8785    """
    8886    Construct the n-th generation of the Dorogovtsev-Goltsev-Mendes
    8987    graph.
     
    104102    return graph.Graph(networkx.dorogovtsev_goltsev_mendes_graph(n),\
    105103           name="Dorogovtsev-Goltsev-Mendes Graph, %d-th generation"%n)
    106104
    107 def IntervalGraph(self,intervals):
     105def IntervalGraph(intervals):
    108106    r"""
    109107    Returns the graph corresponding to the given intervals.
    110108
     
    182180
    183181    return g
    184182
    185 def MycielskiGraph(self, k=1, relabel=True):
     183def MycielskiGraph(k=1, relabel=True):
    186184    r"""
    187185    Returns the `k`-th Mycielski Graph.
    188186
     
    252250        g.add_edge(0,1)
    253251        return g
    254252
    255     g0 = MycielskiGraph(self,k-1)
    256     g = MycielskiStep(self,g0)
     253    g0 = MycielskiGraph(k-1)
     254    g = MycielskiStep(g0)
    257255    g.name("Mycielski Graph " + str(k))
    258256    if relabel: g.relabel()
    259257
    260258    return g
    261259
    262 def MycielskiStep(self, g):
     260def MycielskiStep(g):
    263261    r"""
    264262    Perform one iteration of the Mycielski construction.
    265263
     
    300298    return gg
    301299
    302300
    303 def KneserGraph(self,n,k):
     301def KneserGraph(n,k):
    304302    r"""
    305303    Returns the Kneser Graph with parameters `n, k`.
    306304
     
    356354#   Families of Graphs
    357355###########################################################################
    358356
    359 def BalancedTree(self, r, h):
     357def BalancedTree(r, h):
    360358    r"""
    361359    Returns the perfectly balanced tree of height `h \geq 1`,
    362360    whose root has degree `r \geq 2`.
     
    444442    import networkx
    445443    return graph.Graph(networkx.balanced_tree(r, h), name="Balanced tree")
    446444
    447 def BubbleSortGraph(self, n):
     445def BubbleSortGraph(n):
    448446    r"""
    449447    Returns the bubble sort graph `B(n)`.
    450448
     
    503501        raise ValueError(
    504502            "Invalid number of symbols to permute, n should be >= 1")
    505503    if n == 1:
    506         return graph.Graph(self.CompleteGraph(n), name="Bubble sort")
     504        from sage.graphs.generators.families import CompleteGraph
     505        return graph.Graph(CompleteGraph(n), name="Bubble sort")
    507506    from sage.combinat.permutation import Permutations
    508507    #create set from which to permute
    509508    label_set = [str(i) for i in xrange(1, n + 1)]
     
    524523        d[''.join(v)] = tmp_dict
    525524    return graph.Graph(d, name="Bubble sort")
    526525
    527 def CirculantGraph(self, n, adjacency):
     526def CirculantGraph(n, adjacency):
    528527    r"""
    529528    Returns a circulant graph with n nodes.
    530529
     
    630629        G.add_edges([(v,(v-j)%n) for j in adjacency])
    631630    return G
    632631
    633 def CompleteGraph(self, n):
     632def CompleteGraph(n):
    634633    """
    635634    Returns a complete graph on n nodes.
    636635
     
    724723    G = networkx.complete_graph(n)
    725724    return graph.Graph(G, pos=pos_dict, name="Complete graph")
    726725
    727 def CompleteBipartiteGraph(self, n1, n2):
     726def CompleteBipartiteGraph(n1, n2):
    728727    """
    729728    Returns a Complete Bipartite Graph sized n1+n2, with each of the
    730729    nodes [0,(n1-1)] connected to each of the nodes [n1,(n2-1)] and
     
    849848    G = networkx.complete_bipartite_graph(n1,n2)
    850849    return Graph(G, pos=pos_dict, name="Complete bipartite graph")
    851850
    852 def CompleteMultipartiteGraph(self, l):
     851def CompleteMultipartiteGraph(l):
    853852    r"""
    854853    Returns a complete multipartite graph.
    855854
     
    873872    """
    874873
    875874    from sage.graphs.graph import Graph
     875    from sage.graphs.generators.families import CompleteGraph
    876876    g = Graph()
    877877    for i in l:
    878         g = g + self.CompleteGraph(i)
     878        g = g + CompleteGraph(i)
    879879
    880880    g = g.complement()
    881881    g.name("Multipartite Graph with set sizes "+str(l))
    882882
    883883    return g
    884884
    885 def CubeGraph(self, n):
     885def CubeGraph(n):
    886886    r"""
    887887    Returns the hypercube in `n` dimensions.
    888888
     
    966966
    967967    return r
    968968
    969 def FriendshipGraph(self, n):
     969def FriendshipGraph(n):
    970970    r"""
    971971    Returns the friendship graph `F_n`.
    972972
     
    10621062        raise ValueError("n must be a positive integer")
    10631063    # construct the friendship graph
    10641064    if n == 1:
    1065         G = self.CycleGraph(3)
     1065        from sage.graphs.generators.basic import CycleGraph
     1066        G = CycleGraph(3)
    10661067        G.name("Friendship graph")
    10671068        return G
    10681069    # build the edge and position dictionaries
     
    10841085    pos_dict.setdefault(N - 1, [0, 0])
    10851086    return graph.Graph(edge_dict, pos=pos_dict, name="Friendship graph")
    10861087
    1087 def FuzzyBallGraph(self, partition, q):
     1088def FuzzyBallGraph(partition, q):
    10881089    r"""
    10891090    Construct a Fuzzy Ball graph with the integer partition
    10901091    ``partition`` and ``q`` extra vertices.
     
    11261127    if len(partition)<1:
    11271128        raise ValueError, "partition must be a nonempty list of positive integers"
    11281129    n=q+sum(partition)
    1129     g=CompleteGraph(self,n)
     1130    g=CompleteGraph(n)
    11301131    curr_vertex=0
    11311132    for e,p in enumerate(partition):
    11321133        g.add_edges([(curr_vertex+i, 'a{0}'.format(e+1)) for i in range(p)])
    11331134        curr_vertex+=p
    11341135    return g
    11351136
    1136 def FibonacciTree(self, n):
     1137def FibonacciTree(n):
    11371138    r"""
    11381139    Returns the graph of the Fibonacci Tree `F_{i}` of order `n`.
    11391140    `F_{i}` is recursively defined as the a tree with a root vertex
     
    11901191
    11911192    return T
    11921193
    1193 def GeneralizedPetersenGraph(self, n,k):
     1194def GeneralizedPetersenGraph(n,k):
    11941195    r"""
    11951196    Returns a generalized Petersen graph with `2n` nodes. The variables
    11961197    `n`, `k` are integers such that `n>2` and `0<k\leq\lfloor(n-1)`/`2\rfloor`
     
    12551256        G.add_edge(i+n, n + (i+k) % n)
    12561257    return graph.Graph(G, pos=pos_dict, name="Generalized Petersen graph (n="+str(n)+",k="+str(k)+")")
    12571258
    1258 def HyperStarGraph(self,n,k):
     1259def HyperStarGraph(n,k):
    12591260    r"""
    12601261    Returns the hyper-star graph HS(n,k).
    12611262
     
    13101311
    13111312    return g
    13121313
    1313 def LCFGraph(self, n, shift_list, repeats):
     1314def LCFGraph(n, shift_list, repeats):
    13141315    """
    13151316    Returns the cubic graph specified in LCF notation.
    13161317
     
    13891390    return graph.Graph(networkx.LCF_graph(n, shift_list, repeats),\
    13901391                       pos=pos_dict, name="LCF Graph")
    13911392
    1392 def NKStarGraph(self,n,k):
     1393def NKStarGraph(n,k):
    13931394    r"""
    13941395    Returns the (n,k)-star graph.
    13951396
     
    14511452        d["".join(v)] = tmp_dict
    14521453    return graph.Graph(d, name="(%d,%d)-star"%(n,k))
    14531454
    1454 def NStarGraph(self,n):
     1455def NStarGraph(n):
    14551456    r"""
    14561457    Returns the n-star graph.
    14571458
     
    14991500        d["".join(v)] = tmp_dict
    15001501    return graph.Graph(d, name = "%d-star"%n)
    15011502
    1502 def OddGraph(self,n):
     1503def OddGraph(n):
    15031504    r"""
    15041505    Returns the Odd Graph with parameter `n`.
    15051506
     
    15321533
    15331534    if not n>1:
    15341535        raise ValueError, "Parameter n should be an integer strictly greater than 1"
    1535     g = self.KneserGraph(2*n-1,n-1)
     1536    g = KneserGraph(2*n-1,n-1)
    15361537    g.name("Odd Graph with parameter %s" % n)
    15371538    return g
    15381539
    1539 def PaleyGraph(self,q):
     1540def PaleyGraph(q):
    15401541    r"""
    15411542    Paley graph with `q` vertices
    15421543
     
    15631564    loops=False, name = "Paley graph with parameter %d"%q)
    15641565    return g
    15651566
    1566 def PermutationGraph(self, second_permutation, first_permutation = None):
     1567def PermutationGraph(second_permutation, first_permutation = None):
    15671568    r"""
    15681569    Builds a permutation graph from one (or two) permutations.
    15691570
     
    16551656
    16561657    return g
    16571658
    1658 def HanoiTowerGraph(self, pegs, disks, labels=True, positions=True):
     1659def HanoiTowerGraph(pegs, disks, labels=True, positions=True):
    16591660    r"""
    16601661    Returns the graph whose vertices are the states of the
    16611662    Tower of Hanoi puzzle, with edges representing legal moves between states.
     
    19071908
    19081909    return H
    19091910
    1910 def line_graph_forbidden_subgraphs(self):
     1911def line_graph_forbidden_subgraphs():
    19111912    r"""
    19121913    Returns the 9 forbidden subgraphs of a line graph.
    19131914
     
    19321933
    19331934    """
    19341935    from sage.graphs.all import Graph
    1935     graphs = [self.ClawGraph()]
     1936    from sage.graphs.generators.basic import ClawGraph
     1937    graphs = [ClawGraph()]
    19361938
    19371939    graphs.append(Graph({
    19381940                0: [1, 2, 3],
     
    19911993
    19921994    return graphs
    19931995
    1994 def trees(self, vertices):
     1996def trees(vertices):
    19951997    r"""
    19961998    Returns a generator of the distinct trees on a fixed number of vertices.
    19971999
     
    20392041    from sage.graphs.trees import TreeIterator
    20402042    return iter(TreeIterator(vertices))
    20412043
    2042 def RingedTree(self, k, vertex_labels = True):
     2044def RingedTree(k, vertex_labels = True):
    20432045    r"""
    20442046    Return the ringed tree on k-levels.
    20452047
  • sage/graphs/generators/platonic_solids.py

    diff --git a/sage/graphs/generators/platonic_solids.py b/sage/graphs/generators/platonic_solids.py
    a b  
    11r"""
    22Platonic solids
    3 ==================
    43
    5 Platonic solids
    6 ---------------
    7 
    8 - :meth:`DodecahedralGraph <GraphGenerators.DodecahedralGraph>`
    9 - :meth:`HexahedralGraph <GraphGenerators.HexahedralGraph>`
    10 - :meth:`IcosahedralGraph <GraphGenerators.IcosahedralGraph>`
    11 - :meth:`OctahedralGraph <GraphGenerators.OctahedralGraph>`
    12 - :meth:`TetrahedralGraph <GraphGenerators.TetrahedralGraph>`
    13 
     4The methods defined here appear in sage.graphs.grah_generators.
    145
    156"""
    167###########################################################################
     
    3324#   Platonic Solids
    3425################################################################################
    3526
    36 def TetrahedralGraph(self):
     27def TetrahedralGraph():
    3728    """
    3829    Returns a tetrahedral graph (with 4 nodes).
    3930
     
    8778                         3 : (cos(5.5*pi/3), sin(5.5*pi/3))}
    8879                       )
    8980
    90 def HexahedralGraph(self):
     81def HexahedralGraph():
    9182    """
    9283    Returns a hexahedral graph (with 8 nodes).
    9384
     
    144135                          6 : (1.5,1.5)
    145136                          })
    146137
    147 def OctahedralGraph(self):
     138def OctahedralGraph():
    148139    """
    149140    Returns an Octahedral graph (with 6 nodes).
    150141
     
    205196
    206197    return graph.Graph(G, name="Octahedron", pos=pos)
    207198
    208 def IcosahedralGraph(self):
     199def IcosahedralGraph():
    209200    """
    210201    Returns an Icosahedral graph (with 12 nodes).
    211202
     
    266257
    267258    return graph.Graph(G, name="Icosahedron", pos = pos)
    268259
    269 def DodecahedralGraph(self):
     260def DodecahedralGraph():
    270261    """
    271262    Returns a Dodecahedral graph (with 20 nodes)
    272263
  • sage/graphs/generators/random.py

    diff --git a/sage/graphs/generators/random.py b/sage/graphs/generators/random.py
    a b  
    11r"""
    22Random Graphs
    3 ==================
     3
     4The methods defined here appear in sage.graphs.grah_generators.
    45
    56"""
    67###########################################################################
     
    2324#   Random Graphs
    2425################################################################################
    2526
    26 def RandomGNP(self, n, p, seed=None, fast=True, method='Sage'):
     27def RandomGNP(n, p, seed=None, fast=True, method='Sage'):
    2728    r"""
    2829    Returns a random graph on `n` nodes. Each edge is inserted independently
    2930    with probability `p`.
     
    114115        seed = current_randstate().long_seed()
    115116    if p == 1:
    116117        from sage.graphs.generators.families import CompleteGraph
    117         return CompleteGraph(self,n)
     118        return CompleteGraph(n)
    118119
    119120    if method == 'networkx':
    120121        import networkx
     
    130131    else:
    131132        raise ValueError("'method' must be equal to 'networkx' or to 'Sage'.")
    132133
    133 def RandomBarabasiAlbert(self, n, m, seed=None):
     134def RandomBarabasiAlbert(n, m, seed=None):
    134135    u"""
    135136    Return a random graph created using the Barabasi-Albert preferential
    136137    attachment model.
     
    186187    import networkx
    187188    return graph.Graph(networkx.barabasi_albert_graph(n,m,seed=seed))
    188189
    189 def RandomBipartite(self, n1,n2, p):
     190def RandomBipartite(n1,n2, p):
    190191    r"""
    191192    Returns a bipartite graph with `n1+n2` vertices
    192193    such that any edge from `[n1]` to `[n2]` exists
     
    250251
    251252    return g
    252253
    253 def RandomGNM(self, n, m, dense=False, seed=None):
     254def RandomGNM(n, m, dense=False, seed=None):
    254255    """
    255256    Returns a graph randomly picked out of all graphs on n vertices
    256257    with m edges.
     
    306307    else:
    307308        return graph.Graph(networkx.gnm_random_graph(n, m, seed=seed))
    308309
    309 def RandomNewmanWattsStrogatz(self, n, k, p, seed=None):
     310def RandomNewmanWattsStrogatz(n, k, p, seed=None):
    310311    """
    311312    Returns a Newman-Watts-Strogatz small world random graph on n
    312313    vertices.
     
    355356    import networkx
    356357    return graph.Graph(networkx.newman_watts_strogatz_graph(n, k, p, seed=seed))
    357358
    358 def RandomHolmeKim(self, n, m, p, seed=None):
     359def RandomHolmeKim(n, m, p, seed=None):
    359360    """
    360361    Returns a random graph generated by the Holme and Kim algorithm for
    361362    graphs with power law degree distribution and approximate average
     
    414415    import networkx
    415416    return graph.Graph(networkx.powerlaw_cluster_graph(n, m, p, seed=seed))
    416417
    417 def RandomInterval(self,n):
     418def RandomInterval(n):
    418419    """
    419420    Returns a random interval graph.
    420421
     
    463464
    464465    intervals = [tuple(sorted((random(), random()))) for i in range(n)]
    465466
    466     return self.IntervalGraph(intervals)
     467    from sage.graphs.generators.families import IntervalGraph
     468    return IntervalGraph(intervals)
    467469
    468 def RandomLobster(self, n, p, q, seed=None):
     470def RandomLobster(n, p, q, seed=None):
    469471    """
    470472    Returns a random lobster.
    471473
     
    503505    import networkx
    504506    return graph.Graph(networkx.random_lobster(n, p, q, seed=seed))
    505507
    506 def RandomTree(self, n):
     508def RandomTree(n):
    507509    """
    508510    Returns a random tree on `n` nodes numbered `0` through `n-1`.
    509511
     
    570572
    571573    return g
    572574
    573 def RandomTreePowerlaw(self, n, gamma=3, tries=100, seed=None):
     575def RandomTreePowerlaw(n, gamma=3, tries=100, seed=None):
    574576    """
    575577    Returns a tree with a power law degree distribution. Returns False
    576578    on failure.
     
    615617    except networkx.NetworkXError:
    616618        return False
    617619
    618 def RandomRegular(self, d, n, seed=None):
     620def RandomRegular(d, n, seed=None):
    619621    """
    620622    Returns a random d-regular graph on n vertices, or returns False on
    621623    failure.
     
    666668    except StandardError:
    667669        return False
    668670
    669 def RandomShell(self, constructor, seed=None):
     671def RandomShell(constructor, seed=None):
    670672    """
    671673    Returns a random shell graph for the constructor given.
    672674
  • sage/graphs/generators/smallgraphs.py

    diff --git a/sage/graphs/generators/smallgraphs.py b/sage/graphs/generators/smallgraphs.py
    a b  
    11r"""
    22Small graphs
    3 ==================
    4 
    5 Add naury graphs to the list
    6 Virer GraphGenerators() from the code
     3
     4The methods defined here appear in sage.graphs.grah_generators.
     5
    76"""
    87
    98
     
    2726#   Named Graphs
    2827#######################################################################
    2928
    30 def HarriesGraph(self, embedding=1):
     29def HarriesGraph(embedding=1):
    3130    r"""
    3231    Returns the Harries Graph.
    3332
     
    8584
    8685    """
    8786    from sage.graphs.generators.families import LCFGraph
    88     g = LCFGraph(self, 70, [-29, -19, -13, 13, 21, -27, 27, 33, -13, 13,
     87    g = LCFGraph(70, [-29, -19, -13, 13, 21, -27, 27, 33, -13, 13,
    8988                             19, -21, -33, 29], 5)
    9089    g.name("Harries Graph")
    9190
    9291    if embedding == 1:
    9392        gpos = g.get_pos()
    94         ppos = PetersenGraph(self).get_pos()
     93        ppos = PetersenGraph().get_pos()
    9594
    9695        # The graph's four orbits
    9796        o = [None]*4
     
    146145    else:
    147146        raise ValueError("The value of embedding must be 1 or 2.")
    148147
    149 def HarriesWongGraph(self, embedding=1):
     148def HarriesWongGraph(embedding=1):
    150149    r"""
    151150    Returns the Harries-Wong Graph.
    152151
     
    218217         -27, -21, 15, -9, 29, -29, 33, -9, -25]
    219218
    220219    from sage.graphs.generators.families import LCFGraph
    221     g = LCFGraph(self, 70, L, 1)
     220    g = LCFGraph(70, L, 1)
    222221    g.name("Harries-Wong graph")
    223222
    224223    if embedding == 1:
     
    267266    else:
    268267        raise ValueError("The value of embedding must be 1 or 2.")
    269268
    270 def HallJankoGraph(self, from_string=True):
     269def HallJankoGraph(from_string=True):
    271270    r"""
    272271    Returns the Hall-Janko graph.
    273272
     
    403402    g.name("Hall-Janko graph")
    404403    return g
    405404
    406 def Balaban10Cage(self, embedding=1):
     405def Balaban10Cage(embedding=1):
    407406    r"""
    408407    Returns the Balaban 10-cage.
    409408
     
    464463          -17, -25, 9, 31, 13, -9, -21, -33, -17, -29, 29]
    465464
    466465    from sage.graphs.generators.families import LCFGraph
    467     g = LCFGraph(self, 70, L, 1)
     466    g = LCFGraph(70, L, 1)
    468467    g.name("Balaban 10-cage")
    469468
    470469    if embedding == 2:
     
    493492
    494493    return g
    495494
    496 def Balaban11Cage(self, embedding = 1):
     495def Balaban11Cage(embedding = 1):
    497496    r"""
    498497    Returns the Balaban 11-cage.
    499498
     
    650649             42, -26, -36, 16]
    651650
    652651        from sage.graphs.generators.families import LCFGraph
    653         g = LCFGraph(self, 112, L, 1)
     652        g = LCFGraph(112, L, 1)
    654653        g.name("Balaban 11-cage")
    655654
    656655        if embedding == 3:
     
    691690    else:
    692691        raise ValueError("The value of embedding must be 1, 2, or 3.")
    693692
    694 def BidiakisCube(self):
     693def BidiakisCube():
    695694    r"""
    696695    Returns the Bidiakis cube.
    697696
     
    751750        11: [-0.5, 0.866025403784439]}
    752751    return graph.Graph(edge_dict, pos=pos_dict, name="Bidiakis cube")
    753752
    754 def BiggsSmithGraph(self, embedding=1):
     753def BiggsSmithGraph(embedding=1):
    755754    r"""
    756755    Returns the Biggs-Smith graph.
    757756
     
    802801         -24, -14, -21, -8, 44, -31, -38, -28, 37]
    803802
    804803    from sage.graphs.generators.families import LCFGraph
    805     g = LCFGraph(self, 102, L, 1)
     804    g = LCFGraph(102, L, 1)
    806805    g.name("Biggs-Smith graph")
    807806
    808807    if embedding == 1:
     
    839838
    840839    return g
    841840
    842 def BrinkmannGraph(self):
     841def BrinkmannGraph():
    843842    r"""
    844843    Returns the Brinkmann graph.
    845844
     
    928927        20: [-0.433883739117558, 0.900968867902419]}
    929928    return graph.Graph(edge_dict, pos=pos_dict, name="Brinkmann graph")
    930929
    931 def DoubleStarSnark(self):
     930def DoubleStarSnark():
    932931    r"""
    933932    Returns the double star snark.
    934933
     
    990989
    991990    return g
    992991
    993 def ChvatalGraph(self):
     992def ChvatalGraph():
    994993    r"""
    995994    Returns the Chvatal graph.
    996995
     
    10331032
    10341033    return graph.Graph(networkx.chvatal_graph(), pos=pos_dict, name="Chvatal graph")
    10351034
    1036 def ClebschGraph(self):
     1035def ClebschGraph():
    10371036    r"""
    10381037    Return the Clebsch graph.
    10391038
     
    10671066
    10681067    return g
    10691068
    1070 def CoxeterGraph(self):
     1069def CoxeterGraph():
    10711070    r"""
    10721071    Return the Coxeter graph.
    10731072
     
    11051104
    11061105    return g
    11071106
    1108 def DesarguesGraph(self):
     1107def DesarguesGraph():
    11091108    """
    11101109    Returns the Desargues graph.
    11111110
     
    11251124      1994.
    11261125    """
    11271126    from sage.graphs.generators.families import GeneralizedPetersenGraph
    1128     G = GeneralizedPetersenGraph(self,10,3)
     1127    G = GeneralizedPetersenGraph(10,3)
    11291128    G.name("Desargues Graph")
    11301129    return G
    11311130
    1132 def DurerGraph(self):
     1131def DurerGraph():
    11331132    r"""
    11341133    Returns the Dürer graph.
    11351134
     
    11911190        11: [0.5, -0.866025403784439]}
    11921191    return graph.Graph(edge_dict, pos=pos_dict, name="Durer graph")
    11931192
    1194 def DyckGraph(self):
     1193def DyckGraph():
    11951194    """
    11961195    Returns the Dyck graph.
    11971196
     
    12841283
    12851284    return graph.Graph(edge_dict, pos=pos_dict, name="Dyck graph")
    12861285
    1287 def EllinghamHorton54Graph(self):
     1286def EllinghamHorton54Graph():
    12881287    r"""
    12891288    Returns the Ellingham-Horton 54-graph.
    12901289
     
    13191318
    13201319        sage: g.show() # long time
    13211320    """
    1322     from sage.graphs.graph_generators import GraphGenerators
    1323     up = GraphGenerators().CycleGraph(16)
    1324     low = 2*GraphGenerators().CycleGraph(6)
     1321    from sage.graphs.generators.basic import CycleGraph
     1322    up = CycleGraph(16)
     1323    low = 2*CycleGraph(6)
    13251324
    13261325    for v in range(6):
    13271326        low.add_edge(v, v + 12)
     
    13731372
    13741373    return g
    13751374
    1376 def EllinghamHorton78Graph(self):
     1375def EllinghamHorton78Graph():
    13771376    r"""
    13781377    Returns the Ellingham-Horton 78-graph.
    13791378
     
    14531452
    14541453    return g
    14551454
    1456 def ErreraGraph(self):
     1455def ErreraGraph():
    14571456    r"""
    14581457    Returns the Errera graph.
    14591458
     
    15211520        14: [16]}
    15221521    return graph.Graph(edge_dict, name="Errera graph")
    15231522
    1524 def FlowerSnark(self):
     1523def FlowerSnark():
    15251524    """
    15261525    Returns a Flower Snark.
    15271526
     
    15661565                        12:[13,19],13:[14],15:[19],16:[15,17],18:[17,19]}, \
    15671566                        pos=pos_dict, name="Flower Snark")
    15681567
    1569 def FosterGraph(self):
     1568def FosterGraph():
    15701569    """
    15711570    Returns the Foster graph.
    15721571
     
    15901589        True
    15911590    """
    15921591    from sage.graphs.generators.families import LCFGraph
    1593     g= LCFGraph(self, 90, [17, -9, 37, -37, 9, -17], 15)
     1592    g= LCFGraph(90, [17, -9, 37, -37, 9, -17], 15)
    15941593    g.name("Foster Graph")
    15951594    return g
    15961595
    15971596
    1598 def FranklinGraph(self):
     1597def FranklinGraph():
    15991598    r"""
    16001599    Returns the Franklin graph.
    16011600
     
    16651664        11: [0.5, -0.866025403784439]}
    16661665    return graph.Graph(edge_dict, pos=pos_dict, name="Franklin graph")
    16671666
    1668 def FruchtGraph(self):
     1667def FruchtGraph():
    16691668    """
    16701669    Returns a Frucht Graph.
    16711670
     
    17081707    G = networkx.frucht_graph()
    17091708    return graph.Graph(G, pos=pos_dict, name="Frucht graph")
    17101709
    1711 def GoldnerHararyGraph(self):
     1710def GoldnerHararyGraph():
    17121711    r"""
    17131712    Return the Goldner-Harary graph.
    17141713
     
    17771776
    17781777    return graph.Graph(edge_dict, pos = pos, name="Goldner-Harary graph")
    17791778
    1780 def GrayGraph(self, embedding=1):
     1779def GrayGraph(embedding=1):
    17811780    r"""
    17821781    Returns the Gray graph.
    17831782
     
    18121811    """
    18131812
    18141813    from sage.graphs.generators.families import LCFGraph
    1815     g = LCFGraph(self, 54, [-25,7,-7,13,-13,25], 9)
     1814    g = LCFGraph(54, [-25,7,-7,13,-13,25], 9)
    18161815    g.name("Gray graph")
    18171816
    18181817    if embedding == 1:
     
    18251824
    18261825    return g
    18271826
    1828 def GrotzschGraph(self):
     1827def GrotzschGraph():
    18291828    r"""
    18301829    Returns the Grötzsch graph.
    18311830
     
    19071906    g.name("Grotzsch graph")
    19081907    return g
    19091908
    1910 def HeawoodGraph(self):
     1909def HeawoodGraph():
    19111910    """
    19121911    Returns a Heawood graph.
    19131912
     
    19471946    G = networkx.heawood_graph()
    19481947    return graph.Graph(G, pos=pos_dict, name="Heawood graph")
    19491948
    1950 def HerschelGraph(self):
     1949def HerschelGraph():
    19511950    r"""
    19521951    Returns the Herschel graph.
    19531952
     
    20162015        10: [0, 0]}
    20172016    return graph.Graph(edge_dict, pos=pos_dict, name="Herschel graph")
    20182017
    2019 def HigmanSimsGraph(self, relabel=True):
     2018def HigmanSimsGraph(relabel=True):
    20202019    r"""
    20212020    The Higman-Sims graph is a remarkable strongly regular
    20222021    graph of degree 22 on 100 vertices.  For example, it can
     
    21822181    HS.set_pos(pos_dict)
    21832182    return HS
    21842183
    2185 def HoffmanSingletonGraph(self):
     2184def HoffmanSingletonGraph():
    21862185    r"""
    21872186    Returns the Hoffman-Singleton graph.
    21882187
     
    22752274    H.set_pos(pos_dict)
    22762275    return H
    22772276
    2278 def HoffmanGraph(self):
     2277def HoffmanGraph():
    22792278    r"""
    22802279    Returns the Hoffman Graph.
    22812280
     
    23192318
    23202319    return g
    23212320
    2322 def HoltGraph(self):
     2321def HoltGraph():
    23232322    r"""
    23242323    Returns the Holt graph (also called the Doyle graph)
    23252324
     
    23622361
    23632362    return g
    23642363
    2365 def LjubljanaGraph(self, embedding=1):
     2364def LjubljanaGraph(embedding=1):
    23662365    r"""
    23672366    Returns the Ljubljana Graph.
    23682367
     
    24072406         -39, 33, -9, -51, 51, -47, -33, 19, 51, -21, 29, 21, -31, -39]
    24082407
    24092408    from sage.graphs.generators.families import LCFGraph
    2410     g = LCFGraph(self, 112, L, 2)
     2409    g = LCFGraph(112, L, 2)
    24112410    g.name("Ljubljana graph")
    24122411
    24132412    if embedding == 1:
    24142413        return g
    24152414
    24162415    elif embedding == 2:
    2417         dh = HeawoodGraph(self).get_pos()
     2416        dh = HeawoodGraph().get_pos()
    24182417
    24192418        # Correspondence between the vertices of the Heawood Graph and
    24202419        # 8-sets of the Ljubljana Graph.
     
    24482447    else:
    24492448        raise ValueError("The value of embedding must be 1 or 2.")
    24502449
    2451 def McGeeGraph(self, embedding=2):
     2450def McGeeGraph(embedding=2):
    24522451    r"""
    24532452    Returns the McGee Graph.
    24542453
     
    24882487         -39, 33, -9, -51, 51, -47, -33, 19, 51, -21, 29, 21, -31, -39]
    24892488
    24902489    from sage.graphs.generators.families import LCFGraph
    2491     g = LCFGraph(self, 24, [12, 7, -7], 8)
     2490    g = LCFGraph(24, [12, 7, -7], 8)
    24922491    g.name('McGee graph')
    24932492
    24942493    if embedding == 1:
     
    25092508    else:
    25102509        raise ValueError("The value of embedding must be 1 or 2.")
    25112510
    2512 def MoebiusKantorGraph(self):
     2511def MoebiusKantorGraph():
    25132512    """
    25142513    Returns a Moebius-Kantor Graph.
    25152514
     
    25372536        sage: (graphs.MoebiusKantorGraph()).show() # long time
    25382537    """
    25392538    from sage.graphs.generators.families import GeneralizedPetersenGraph
    2540     G=GeneralizedPetersenGraph(self,8,3)
     2539    G=GeneralizedPetersenGraph(8,3)
    25412540    G.name("Moebius-Kantor Graph")
    25422541    return G
    25432542
    2544 def MoserSpindle(self):
     2543def MoserSpindle():
    25452544    r"""
    25462545    Returns the Moser spindle.
    25472546
     
    25982597    return graph.Graph(edge_dict, pos=pos_dict, name="Moser spindle")
    25992598
    26002599
    2601 def NauruGraph(self, embedding=2):
     2600def NauruGraph(embedding=2):
    26022601    """
    26032602    Returns the Nauru Graph.
    26042603
     
    26362635
    26372636    if embedding == 1:
    26382637        from sage.graphs.generators.families import LCFGraph
    2639         g = LCFGraph(self, 24, [5, -9, 7, -7, 9, -5], 4)
     2638        g = LCFGraph(24, [5, -9, 7, -7, 9, -5], 4)
    26402639        g.name('Nauru Graph')
    26412640        return g
    26422641    elif embedding == 2:
    26432642        from sage.graphs.generators.families import GeneralizedPetersenGraph
    2644         g = GeneralizedPetersenGraph(self, 12, 5)
     2643        g = GeneralizedPetersenGraph(12, 5)
    26452644        g.name("Nauru Graph")
    26462645        return g
    26472646    else:
    26482647        raise ValueError("The value of embedding must be 1 or 2.")
    26492648
    2650 def PappusGraph(self):
     2649def PappusGraph():
    26512650    """
    26522651    Returns the Pappus graph, a graph on 18 vertices.
    26532652
     
    26752674                        10:[15,17],11:[12,16],12:[15],13:[16],14:[17]},\
    26762675                       pos=pos_dict, name="Pappus Graph")
    26772676
    2678 def PetersenGraph(self):
     2677def PetersenGraph():
    26792678    """
    26802679    The Petersen Graph is a named graph that consists of 10 vertices
    26812680    and 15 edges, usually drawn as a five-point star embedded in a
     
    26962695        sage: petersen_database.show() # long time
    26972696    """
    26982697    from sage.graphs.generators.families import GeneralizedPetersenGraph
    2699     P=GeneralizedPetersenGraph(self, 5,2)
     2698    P=GeneralizedPetersenGraph(5,2)
    27002699    P.name("Petersen graph")
    27012700    return P
    27022701
    2703 def ShrikhandeGraph(self):
     2702def ShrikhandeGraph():
    27042703    """
    27052704    Returns the Shrikhande graph.
    27062705
     
    27902789
    27912790    return graph.Graph(edge_dict, pos=pos_dict, name="Shrikhande graph")
    27922791
    2793 def ThomsenGraph(self):
     2792def ThomsenGraph():
    27942793    """
    27952794    Returns the Thomsen Graph.
    27962795
     
    28132812    G = networkx.complete_bipartite_graph(3,3)
    28142813    return graph.Graph(G, pos=pos_dict, name="Thomsen graph")
    28152814
    2816 def Tutte12Cage(self):
     2815def Tutte12Cage():
    28172816    r"""
    28182817    Returns Tutte's 12-Cage.
    28192818
     
    28372836         -21, -57, 59, -17]
    28382837
    28392838    from sage.graphs.generators.families import LCFGraph
    2840     g = LCFGraph(self, 126, L, 7)
     2839    g = LCFGraph(126, L, 7)
    28412840    g.name("Tutte 12-Cage")
    28422841    return g
    28432842
    2844 def TutteCoxeterGraph(self, embedding=2):
     2843def TutteCoxeterGraph(embedding=2):
    28452844    r"""
    28462845    Returns the Tutte-Coxeter graph.
    28472846
     
    28762875    """
    28772876
    28782877    from sage.graphs.generators.families import LCFGraph
    2879     g = LCFGraph(self, 30, [-13, -9, 7, -7, 9, 13], 5)
     2878    g = LCFGraph(30, [-13, -9, 7, -7, 9, 13], 5)
    28802879    g.name("Tutte-Coxeter graph")
    28812880
    28822881    if embedding == 1:
     
    29042903    else:
    29052904        raise ValueError("The value of embedding must be 1 or 2.")
    29062905
    2907 def WagnerGraph(self):
     2906def WagnerGraph():
    29082907    """
    29092908    Returns the Wagner Graph.
    29102909
     
    29252924        sage: g.show()
    29262925    """
    29272926    from sage.graphs.generators.families import LCFGraph
    2928     g = LCFGraph(self, 8, [4], 8)
     2927    g = LCFGraph(8, [4], 8)
    29292928    g.name("Wagner Graph")
    29302929    return g
    29312930
  • sage/graphs/generators/world_map.py

    diff --git a/sage/graphs/generators/world_map.py b/sage/graphs/generators/world_map.py
    a b  
    11r"""
    22World Map
    3 =========
     3
     4The methods defined here appear in sage.graphs.grah_generators.
    45"""
    56
    67###########################################################################
     
    1819from sage.graphs import graph
    1920from math import sin, cos, pi
    2021
    21 def WorldMap(self):
     22def WorldMap():
    2223    """
    2324    Returns the Graph of all the countries, in which two countries are adjacent
    2425    in the graph if they have a common boundary.
  • sage/graphs/graph_generators.py

    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    7575**Platonic solids**
    7676"""
    7777
    78 __append_to_doc(["DodecahedralGraph",
    79 "HexahedralGraph",
    80 "IcosahedralGraph",
    81 "OctahedralGraph",
    82 "TetrahedralGraph"])
     78__append_to_doc(
     79    ["DodecahedralGraph",
     80     "HexahedralGraph",
     81     "IcosahedralGraph",
     82     "OctahedralGraph",
     83     "TetrahedralGraph"])
    8384
    8485__doc__ += """
    8586**Small Graphs**
     
    890891###########################################################################
    891892
    892893    import sage.graphs.generators.chessboard
    893     ChessboardGraphGenerator = sage.graphs.generators.chessboard.ChessboardGraphGenerator
    894     BishopGraph = sage.graphs.generators.chessboard.BishopGraph
    895     KingGraph = sage.graphs.generators.chessboard.KingGraph
    896     KnightGraph = sage.graphs.generators.chessboard.KnightGraph
    897     QueenGraph = sage.graphs.generators.chessboard.QueenGraph
    898     RookGraph = sage.graphs.generators.chessboard.RookGraph
     894    ChessboardGraphGenerator = staticmethod(sage.graphs.generators.chessboard.ChessboardGraphGenerator)
     895    BishopGraph              = staticmethod(sage.graphs.generators.chessboard.BishopGraph)
     896    KingGraph                = staticmethod(sage.graphs.generators.chessboard.KingGraph)
     897    KnightGraph              = staticmethod(sage.graphs.generators.chessboard.KnightGraph)
     898    QueenGraph               = staticmethod(sage.graphs.generators.chessboard.QueenGraph)
     899    RookGraph                = staticmethod(sage.graphs.generators.chessboard.RookGraph)
    899900
    900901###########################################################################
    901902# Families
    902903###########################################################################
    903904
    904905    import sage.graphs.generators.families
    905     MycielskiGraph = sage.graphs.generators.families.MycielskiGraph
    906     MycielskiStep = sage.graphs.generators.families.MycielskiStep
    907     KneserGraph = sage.graphs.generators.families.KneserGraph
    908     BalancedTree = sage.graphs.generators.families.BalancedTree
    909     BubbleSortGraph = sage.graphs.generators.families.BubbleSortGraph
    910     CirculantGraph = sage.graphs.generators.families.CirculantGraph
    911     CompleteGraph = sage.graphs.generators.families.CompleteGraph
    912     CompleteBipartiteGraph = sage.graphs.generators.families.CompleteBipartiteGraph
    913     CompleteMultipartiteGraph = sage.graphs.generators.families.CompleteMultipartiteGraph
    914     CubeGraph = sage.graphs.generators.families.CubeGraph
    915     DorogovtsevGoltsevMendesGraph = sage.graphs.generators.families.DorogovtsevGoltsevMendesGraph
    916     FriendshipGraph = sage.graphs.generators.families.FriendshipGraph
    917     FuzzyBallGraph = sage.graphs.generators.families.FuzzyBallGraph
    918     FibonacciTree = sage.graphs.generators.families.FibonacciTree
    919     GeneralizedPetersenGraph = sage.graphs.generators.families.GeneralizedPetersenGraph
    920     HyperStarGraph = sage.graphs.generators.families.HyperStarGraph
    921     HararyGraph = sage.graphs.generators.families.HararyGraph
    922     IntervalGraph = sage.graphs.generators.families.IntervalGraph
    923     LCFGraph = sage.graphs.generators.families.LCFGraph
    924     NKStarGraph = sage.graphs.generators.families.NKStarGraph
    925     NStarGraph = sage.graphs.generators.families.NStarGraph
    926     OddGraph = sage.graphs.generators.families.OddGraph
    927     PaleyGraph = sage.graphs.generators.families.PaleyGraph
    928     PermutationGraph = sage.graphs.generators.families.PermutationGraph
    929     HanoiTowerGraph = sage.graphs.generators.families.HanoiTowerGraph
    930     line_graph_forbidden_subgraphs = sage.graphs.generators.families.line_graph_forbidden_subgraphs
    931     trees = sage.graphs.generators.families.trees
    932     RingedTree = sage.graphs.generators.families.RingedTree
     906    MycielskiGraph         = staticmethod(sage.graphs.generators.families.MycielskiGraph)
     907    MycielskiStep          = staticmethod(sage.graphs.generators.families.MycielskiStep)
     908    KneserGraph            = staticmethod(sage.graphs.generators.families.KneserGraph)
     909    BalancedTree           = staticmethod(sage.graphs.generators.families.BalancedTree)
     910    BubbleSortGraph        = staticmethod(sage.graphs.generators.families.BubbleSortGraph)
     911    CirculantGraph         = staticmethod(sage.graphs.generators.families.CirculantGraph)
     912    CompleteGraph          = staticmethod(sage.graphs.generators.families.CompleteGraph)
     913    CompleteBipartiteGraph = staticmethod(sage.graphs.generators.families.CompleteBipartiteGraph)
     914    CompleteMultipartiteGraph = staticmethod(sage.graphs.generators.families.CompleteMultipartiteGraph)
     915    CubeGraph              = staticmethod(sage.graphs.generators.families.CubeGraph)
     916    DorogovtsevGoltsevMendesGraph = staticmethod(sage.graphs.generators.families.DorogovtsevGoltsevMendesGraph)
     917    FriendshipGraph        = staticmethod(sage.graphs.generators.families.FriendshipGraph)
     918    FuzzyBallGraph         = staticmethod(sage.graphs.generators.families.FuzzyBallGraph)
     919    FibonacciTree          = staticmethod(sage.graphs.generators.families.FibonacciTree)
     920    GeneralizedPetersenGraph = staticmethod(sage.graphs.generators.families.GeneralizedPetersenGraph)
     921    HyperStarGraph         = staticmethod(sage.graphs.generators.families.HyperStarGraph)
     922    HararyGraph            = staticmethod(sage.graphs.generators.families.HararyGraph)
     923    IntervalGraph          = staticmethod(sage.graphs.generators.families.IntervalGraph)
     924    LCFGraph               = staticmethod(sage.graphs.generators.families.LCFGraph)
     925    NKStarGraph            = staticmethod(sage.graphs.generators.families.NKStarGraph)
     926    NStarGraph             = staticmethod(sage.graphs.generators.families.NStarGraph)
     927    OddGraph               = staticmethod(sage.graphs.generators.families.OddGraph)
     928    PaleyGraph             = staticmethod(sage.graphs.generators.families.PaleyGraph)
     929    PermutationGraph       = staticmethod(sage.graphs.generators.families.PermutationGraph)
     930    HanoiTowerGraph        = staticmethod(sage.graphs.generators.families.HanoiTowerGraph)
     931    line_graph_forbidden_subgraphs = staticmethod(sage.graphs.generators.families.line_graph_forbidden_subgraphs)
     932    trees                  = staticmethod(sage.graphs.generators.families.trees)
     933    RingedTree             = staticmethod(sage.graphs.generators.families.RingedTree)
    933934
    934935###########################################################################
    935936# Small Graphs
    936937###########################################################################
    937938    import sage.graphs.generators.smallgraphs
    938     Balaban10Cage = sage.graphs.generators.smallgraphs.Balaban10Cage
    939     Balaban11Cage = sage.graphs.generators.smallgraphs.Balaban11Cage
    940     BidiakisCube = sage.graphs.generators.smallgraphs.BidiakisCube
    941     BiggsSmithGraph = sage.graphs.generators.smallgraphs.BiggsSmithGraph
    942     BrinkmannGraph = sage.graphs.generators.smallgraphs.BrinkmannGraph
    943     ChvatalGraph = sage.graphs.generators.smallgraphs.ChvatalGraph
    944     ClebschGraph = sage.graphs.generators.smallgraphs.ClebschGraph
    945     CoxeterGraph = sage.graphs.generators.smallgraphs.CoxeterGraph
    946     DesarguesGraph = sage.graphs.generators.smallgraphs.DesarguesGraph
    947     DoubleStarSnark = sage.graphs.generators.smallgraphs.DoubleStarSnark
    948     DurerGraph = sage.graphs.generators.smallgraphs.DurerGraph
    949     DyckGraph = sage.graphs.generators.smallgraphs.DyckGraph
    950     EllinghamHorton54Graph = sage.graphs.generators.smallgraphs.EllinghamHorton54Graph
    951     EllinghamHorton78Graph = sage.graphs.generators.smallgraphs.EllinghamHorton78Graph
    952     ErreraGraph = sage.graphs.generators.smallgraphs.ErreraGraph
    953     FlowerSnark = sage.graphs.generators.smallgraphs.FlowerSnark
    954     FosterGraph = sage.graphs.generators.smallgraphs.FosterGraph
    955     FranklinGraph = sage.graphs.generators.smallgraphs.FranklinGraph
    956     FruchtGraph = sage.graphs.generators.smallgraphs.FruchtGraph
    957     GoldnerHararyGraph = sage.graphs.generators.smallgraphs.GoldnerHararyGraph
    958     GrayGraph = sage.graphs.generators.smallgraphs.GrayGraph
    959     GrotzschGraph = sage.graphs.generators.smallgraphs.GrotzschGraph
    960     HallJankoGraph = sage.graphs.generators.smallgraphs.HallJankoGraph
    961     HarriesGraph = sage.graphs.generators.smallgraphs.HarriesGraph
    962     HarriesWongGraph = sage.graphs.generators.smallgraphs.HarriesWongGraph
    963     HeawoodGraph = sage.graphs.generators.smallgraphs.HeawoodGraph
    964     HerschelGraph = sage.graphs.generators.smallgraphs.HerschelGraph
    965     HigmanSimsGraph = sage.graphs.generators.smallgraphs.HigmanSimsGraph
    966     HoffmanGraph = sage.graphs.generators.smallgraphs.HoffmanGraph
    967     HoffmanSingletonGraph = sage.graphs.generators.smallgraphs.HoffmanSingletonGraph
    968     HoltGraph = sage.graphs.generators.smallgraphs.HoltGraph
    969     LjubljanaGraph = sage.graphs.generators.smallgraphs.LjubljanaGraph
    970     McGeeGraph = sage.graphs.generators.smallgraphs.McGeeGraph
    971     MoebiusKantorGraph = sage.graphs.generators.smallgraphs.MoebiusKantorGraph
    972     MoserSpindle = sage.graphs.generators.smallgraphs.MoserSpindle
    973     NauruGraph = sage.graphs.generators.smallgraphs.NauruGraph
    974     PappusGraph = sage.graphs.generators.smallgraphs.PappusGraph
    975     PetersenGraph = sage.graphs.generators.smallgraphs.PetersenGraph
    976     ShrikhandeGraph = sage.graphs.generators.smallgraphs.ShrikhandeGraph
    977     ThomsenGraph = sage.graphs.generators.smallgraphs.ThomsenGraph
    978     Tutte12Cage = sage.graphs.generators.smallgraphs.Tutte12Cage
    979     TutteCoxeterGraph = sage.graphs.generators.smallgraphs.TutteCoxeterGraph
    980     WagnerGraph = sage.graphs.generators.smallgraphs.WagnerGraph
     939    Balaban10Cage            = staticmethod(sage.graphs.generators.smallgraphs.Balaban10Cage)
     940    Balaban11Cage            = staticmethod(sage.graphs.generators.smallgraphs.Balaban11Cage)
     941    BidiakisCube             = staticmethod(sage.graphs.generators.smallgraphs.BidiakisCube)
     942    BiggsSmithGraph          = staticmethod(sage.graphs.generators.smallgraphs.BiggsSmithGraph)
     943    BrinkmannGraph           = staticmethod(sage.graphs.generators.smallgraphs.BrinkmannGraph)
     944    ChvatalGraph             = staticmethod(sage.graphs.generators.smallgraphs.ChvatalGraph)
     945    ClebschGraph             = staticmethod(sage.graphs.generators.smallgraphs.ClebschGraph)
     946    CoxeterGraph             = staticmethod(sage.graphs.generators.smallgraphs.CoxeterGraph)
     947    DesarguesGraph           = staticmethod(sage.graphs.generators.smallgraphs.DesarguesGraph)
     948    DoubleStarSnark          = staticmethod(sage.graphs.generators.smallgraphs.DoubleStarSnark)
     949    DurerGraph               = staticmethod(sage.graphs.generators.smallgraphs.DurerGraph)
     950    DyckGraph                = staticmethod(sage.graphs.generators.smallgraphs.DyckGraph)
     951    EllinghamHorton54Graph   = staticmethod(sage.graphs.generators.smallgraphs.EllinghamHorton54Graph)
     952    EllinghamHorton78Graph   = staticmethod(sage.graphs.generators.smallgraphs.EllinghamHorton78Graph)
     953    ErreraGraph              = staticmethod(sage.graphs.generators.smallgraphs.ErreraGraph)
     954    FlowerSnark              = staticmethod(sage.graphs.generators.smallgraphs.FlowerSnark)
     955    FosterGraph              = staticmethod(sage.graphs.generators.smallgraphs.FosterGraph)
     956    FranklinGraph            = staticmethod(sage.graphs.generators.smallgraphs.FranklinGraph)
     957    FruchtGraph              = staticmethod(sage.graphs.generators.smallgraphs.FruchtGraph)
     958    GoldnerHararyGraph       = staticmethod(sage.graphs.generators.smallgraphs.GoldnerHararyGraph)
     959    GrayGraph                = staticmethod(sage.graphs.generators.smallgraphs.GrayGraph)
     960    GrotzschGraph            = staticmethod(sage.graphs.generators.smallgraphs.GrotzschGraph)
     961    HallJankoGraph           = staticmethod(sage.graphs.generators.smallgraphs.HallJankoGraph)
     962    HarriesGraph             = staticmethod(sage.graphs.generators.smallgraphs.HarriesGraph)
     963    HarriesWongGraph         = staticmethod(sage.graphs.generators.smallgraphs.HarriesWongGraph)
     964    HeawoodGraph             = staticmethod(sage.graphs.generators.smallgraphs.HeawoodGraph)
     965    HerschelGraph            = staticmethod(sage.graphs.generators.smallgraphs.HerschelGraph)
     966    HigmanSimsGraph          = staticmethod(sage.graphs.generators.smallgraphs.HigmanSimsGraph)
     967    HoffmanGraph             = staticmethod(sage.graphs.generators.smallgraphs.HoffmanGraph)
     968    HoffmanSingletonGraph    = staticmethod(sage.graphs.generators.smallgraphs.HoffmanSingletonGraph)
     969    HoltGraph                = staticmethod(sage.graphs.generators.smallgraphs.HoltGraph)
     970    LjubljanaGraph           = staticmethod(sage.graphs.generators.smallgraphs.LjubljanaGraph)
     971    McGeeGraph               = staticmethod(sage.graphs.generators.smallgraphs.McGeeGraph)
     972    MoebiusKantorGraph       = staticmethod(sage.graphs.generators.smallgraphs.MoebiusKantorGraph)
     973    MoserSpindle             = staticmethod(sage.graphs.generators.smallgraphs.MoserSpindle)
     974    NauruGraph               = staticmethod(sage.graphs.generators.smallgraphs.NauruGraph)
     975    PappusGraph              = staticmethod(sage.graphs.generators.smallgraphs.PappusGraph)
     976    PetersenGraph            = staticmethod(sage.graphs.generators.smallgraphs.PetersenGraph)
     977    ShrikhandeGraph          = staticmethod(sage.graphs.generators.smallgraphs.ShrikhandeGraph)
     978    ThomsenGraph             = staticmethod(sage.graphs.generators.smallgraphs.ThomsenGraph)
     979    Tutte12Cage              = staticmethod(sage.graphs.generators.smallgraphs.Tutte12Cage)
     980    TutteCoxeterGraph        = staticmethod(sage.graphs.generators.smallgraphs.TutteCoxeterGraph)
     981    WagnerGraph              = staticmethod(sage.graphs.generators.smallgraphs.WagnerGraph)
    981982
    982983
    983984###########################################################################
    984985# Basic Graphs
    985986###########################################################################
    986987    import sage.graphs.generators.basic
    987     BarbellGraph = sage.graphs.generators.basic.BarbellGraph
    988     BuckyBall = sage.graphs.generators.basic.BuckyBall
    989     BullGraph = sage.graphs.generators.basic.BullGraph
    990     ButterflyGraph = sage.graphs.generators.basic.ButterflyGraph
    991     CircularLadderGraph = sage.graphs.generators.basic.CircularLadderGraph
    992     ClawGraph = sage.graphs.generators.basic.ClawGraph
    993     CycleGraph = sage.graphs.generators.basic.CycleGraph
    994     DiamondGraph = sage.graphs.generators.basic.DiamondGraph
    995     EmptyGraph = sage.graphs.generators.basic.EmptyGraph
    996     Grid2dGraph = sage.graphs.generators.basic.Grid2dGraph
    997     GridGraph = sage.graphs.generators.basic.GridGraph
    998     HouseGraph = sage.graphs.generators.basic.HouseGraph
    999     HouseXGraph = sage.graphs.generators.basic.HouseXGraph
    1000     KrackhardtKiteGraph = sage.graphs.generators.basic.KrackhardtKiteGraph
    1001     LadderGraph = sage.graphs.generators.basic.LadderGraph
    1002     LollipopGraph = sage.graphs.generators.basic.LollipopGraph
    1003     PathGraph = sage.graphs.generators.basic.PathGraph
    1004     StarGraph = sage.graphs.generators.basic.StarGraph
    1005     Toroidal6RegularGrid2dGraph = sage.graphs.generators.basic.Toroidal6RegularGrid2dGraph
    1006     ToroidalGrid2dGraph = sage.graphs.generators.basic.ToroidalGrid2dGraph
    1007     WheelGraph = sage.graphs.generators.basic.WheelGraph
     988    BarbellGraph             = staticmethod(sage.graphs.generators.basic.BarbellGraph)
     989    BuckyBall                = staticmethod(sage.graphs.generators.basic.BuckyBall)
     990    BullGraph                = staticmethod(sage.graphs.generators.basic.BullGraph)
     991    ButterflyGraph           = staticmethod(sage.graphs.generators.basic.ButterflyGraph)
     992    CircularLadderGraph      = staticmethod(sage.graphs.generators.basic.CircularLadderGraph)
     993    ClawGraph                = staticmethod(sage.graphs.generators.basic.ClawGraph)
     994    CycleGraph               = staticmethod(sage.graphs.generators.basic.CycleGraph)
     995    DiamondGraph             = staticmethod(sage.graphs.generators.basic.DiamondGraph)
     996    EmptyGraph               = staticmethod(sage.graphs.generators.basic.EmptyGraph)
     997    Grid2dGraph              = staticmethod(sage.graphs.generators.basic.Grid2dGraph)
     998    GridGraph                = staticmethod(sage.graphs.generators.basic.GridGraph)
     999    HouseGraph               = staticmethod(sage.graphs.generators.basic.HouseGraph)
     1000    HouseXGraph              = staticmethod(sage.graphs.generators.basic.HouseXGraph)
     1001    KrackhardtKiteGraph      = staticmethod(sage.graphs.generators.basic.KrackhardtKiteGraph)
     1002    LadderGraph              = staticmethod(sage.graphs.generators.basic.LadderGraph)
     1003    LollipopGraph            = staticmethod(sage.graphs.generators.basic.LollipopGraph)
     1004    PathGraph                = staticmethod(sage.graphs.generators.basic.PathGraph)
     1005    StarGraph                = staticmethod(sage.graphs.generators.basic.StarGraph)
     1006    Toroidal6RegularGrid2dGraph = staticmethod(sage.graphs.generators.basic.Toroidal6RegularGrid2dGraph)
     1007    ToroidalGrid2dGraph      = staticmethod(sage.graphs.generators.basic.ToroidalGrid2dGraph)
     1008    WheelGraph               = staticmethod(sage.graphs.generators.basic.WheelGraph)
    10081009
    10091010###########################################################################
    10101011# Random Graphs
    10111012###########################################################################
    10121013    import sage.graphs.generators.random
    1013     RandomBarabasiAlbert = sage.graphs.generators.random.RandomBarabasiAlbert
    1014     RandomBipartite = sage.graphs.generators.random.RandomBipartite
    1015     RandomGNM = sage.graphs.generators.random.RandomGNM
    1016     RandomGNP = sage.graphs.generators.random.RandomGNP
    1017     RandomHolmeKim = sage.graphs.generators.random.RandomHolmeKim
    1018     RandomInterval = sage.graphs.generators.random.RandomInterval
    1019     RandomLobster = sage.graphs.generators.random.RandomLobster
    1020     RandomNewmanWattsStrogatz = sage.graphs.generators.random.RandomNewmanWattsStrogatz
    1021     RandomRegular = sage.graphs.generators.random.RandomRegular
    1022     RandomShell = sage.graphs.generators.random.RandomShell
    1023     RandomTreePowerlaw = sage.graphs.generators.random.RandomTreePowerlaw
    1024     RandomTree = sage.graphs.generators.random.RandomTree
     1014    RandomBarabasiAlbert     = staticmethod(sage.graphs.generators.random.RandomBarabasiAlbert)
     1015    RandomBipartite          = staticmethod(sage.graphs.generators.random.RandomBipartite)
     1016    RandomGNM                = staticmethod(sage.graphs.generators.random.RandomGNM)
     1017    RandomGNP                = staticmethod(sage.graphs.generators.random.RandomGNP)
     1018    RandomHolmeKim           = staticmethod(sage.graphs.generators.random.RandomHolmeKim)
     1019    RandomInterval           = staticmethod(sage.graphs.generators.random.RandomInterval)
     1020    RandomLobster            = staticmethod(sage.graphs.generators.random.RandomLobster)
     1021    RandomNewmanWattsStrogatz = staticmethod(sage.graphs.generators.random.RandomNewmanWattsStrogatz)
     1022    RandomRegular            = staticmethod(sage.graphs.generators.random.RandomRegular)
     1023    RandomShell              = staticmethod(sage.graphs.generators.random.RandomShell)
     1024    RandomTreePowerlaw       = staticmethod(sage.graphs.generators.random.RandomTreePowerlaw)
     1025    RandomTree               = staticmethod(sage.graphs.generators.random.RandomTree)
    10251026
    10261027###########################################################################
    10271028# Platonic Solids
    10281029###########################################################################
    10291030    import sage.graphs.generators.platonic_solids
    1030     DodecahedralGraph = sage.graphs.generators.platonic_solids.DodecahedralGraph
    1031     HexahedralGraph = sage.graphs.generators.platonic_solids.HexahedralGraph
    1032     IcosahedralGraph = sage.graphs.generators.platonic_solids.IcosahedralGraph
    1033     OctahedralGraph = sage.graphs.generators.platonic_solids.OctahedralGraph
    1034     TetrahedralGraph = sage.graphs.generators.platonic_solids.TetrahedralGraph
     1031    DodecahedralGraph        = staticmethod(sage.graphs.generators.platonic_solids.DodecahedralGraph)
     1032    HexahedralGraph          = staticmethod(sage.graphs.generators.platonic_solids.HexahedralGraph)
     1033    IcosahedralGraph         = staticmethod(sage.graphs.generators.platonic_solids.IcosahedralGraph)
     1034    OctahedralGraph          = staticmethod(sage.graphs.generators.platonic_solids.OctahedralGraph)
     1035    TetrahedralGraph         = staticmethod(sage.graphs.generators.platonic_solids.TetrahedralGraph)
    10351036
    10361037###########################################################################
    10371038# World Map
    10381039###########################################################################
    10391040    import sage.graphs.generators.world_map
    1040     WorldMap = sage.graphs.generators.world_map.WorldMap
     1041    WorldMap = staticmethod(sage.graphs.generators.world_map.WorldMap)
    10411042
    10421043###########################################################################
    10431044# Degree Sequence
    10441045###########################################################################
    10451046    import sage.graphs.generators.degree_sequence
    1046     DegreeSequence = sage.graphs.generators.degree_sequence.DegreeSequence
    1047     DegreeSequenceBipartite = sage.graphs.generators.degree_sequence.DegreeSequenceBipartite
    1048     DegreeSequenceConfigurationModel = sage.graphs.generators.degree_sequence.DegreeSequenceConfigurationModel
    1049     DegreeSequenceTree = sage.graphs.generators.degree_sequence.DegreeSequenceTree
    1050     DegreeSequenceExpected = sage.graphs.generators.degree_sequence.DegreeSequenceExpected
     1047    DegreeSequence           = staticmethod(sage.graphs.generators.degree_sequence.DegreeSequence)
     1048    DegreeSequenceBipartite  = staticmethod(sage.graphs.generators.degree_sequence.DegreeSequenceBipartite)
     1049    DegreeSequenceConfigurationModel = staticmethod(sage.graphs.generators.degree_sequence.DegreeSequenceConfigurationModel)
     1050    DegreeSequenceTree       = staticmethod(sage.graphs.generators.degree_sequence.DegreeSequenceTree)
     1051    DegreeSequenceExpected   = staticmethod(sage.graphs.generators.degree_sequence.DegreeSequenceExpected)
    10511052
    10521053def canaug_traverse_vert(g, aut_gens, max_verts, property, dig=False, loops=False, implementation='c_graph', sparse=True):
    10531054    """