Ticket #7386: trac_7386.patch

File trac_7386.patch, 2.0 KB (added by ncohen, 10 years ago)
  • sage/graphs/graph_generators.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1259504385 -3600
    # Node ID fb11b390bb2381eb9808ec664173f5187017b1b6
    # Parent  fee71ad457d0b6881f989cbe69b9bfe2eee0cd55
    Dosctring in grqphs_generqtors.CubeGraph()
    
    diff -r fee71ad457d0 -r fb11b390bb23 sage/graphs/graph_generators.py
    a b  
    25002500        return bipartite_graph.BipartiteGraph(G, pos=pos_dict, name="Complete bipartite graph")
    25012501
    25022502    def CubeGraph(self, n):
    2503         """       
    2504         AUTHORS:
    2505 
    2506         - Robert Miller
    2507        
    2508         PLOTTING: See commented source code.
    2509        
    2510         EXAMPLES: Plot several n-cubes in a Sage Graphics Array
    2511        
    2512         ::
     2503        r"""
     2504        Returns the hypercube in `n` dimensions.
     2505
     2506        The hypercube in `n` dimension is build upon the binary
     2507        strings on `n` bits, two of them being adjacent if
     2508        they differ in exactly one bit. Hence, the distance
     2509        between two vertices in the hypercube is the Hamming
     2510        distance.
     2511
     2512        EXAMPLES:
     2513       
     2514        The distance between `0100110` and `1011010` is
     2515        `5`, as expected ::
     2516
     2517            sage: g = graphs.CubeGraph(7)
     2518            sage: g.distance('0100110','1011010')
     2519            5
     2520
     2521        Plot several `n`-cubes in a Sage Graphics Array ::
    25132522       
    25142523            sage: g = []
    25152524            sage: j = []
     
    25262535            sage: G = sage.plot.plot.GraphicsArray(j)
    25272536            sage: G.show(figsize=[6,4]) # long time
    25282537       
    2529         Use the plot options to display larger n-cubes
     2538        Use the plot options to display larger `n`-cubes
    25302539       
    25312540        ::
    25322541       
    25332542            sage: g = graphs.CubeGraph(9)
    25342543            sage: g.show(figsize=[12,12],vertex_labels=False, vertex_size=20) # long time
     2544
     2545        AUTHORS:
     2546
     2547        - Robert Miller
    25352548        """
    25362549        from sage.rings.integer import Integer
    25372550        # generate vertex labels: