Ticket #7378: trac_7378-ref.patch

File trac_7378-ref.patch, 3.0 KB (added by rlm, 11 years ago)

Apply after trac_7378.patch

  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User Robert L. Miller <rlm@rlmiller.org>
    # Date 1277141856 25200
    # Node ID 0eb881d40a6bc4b417858f5a090f3614e2bbe215
    # Parent  62c942908fef7bb16007873c6bf5847d3aa5343b
    #7378: Referee suggestions.
    
    diff -r 62c942908fef -r 0eb881d40a6b sage/graphs/generic_graph.py
    a b  
    54505450
    54515451        INPUT:
    54525452
    5453         The following forms are all accepted to subdivide `8` times
    5454         the edge between vertices `1` and `2` labeled with
    5455         ``"my_label"``.
    5456        
    5457         - ``G.subdivide_edge( 1, 2, 8 )``
    5458         - ``G.subdivide_edge( (1, 2), 8 )``       
    5459         - ``G.subdivide_edge( (1, 2, "my_label"), 8 )``       
     5453        The following forms are all accepted to subdivide the edge `(u, v)`
     5454        with label `l` into `k` edges.
     5455       
     5456        - ``G.subdivide_edge( u, v, k )``
     5457        - ``G.subdivide_edge( (u, v), k )``       
     5458        - ``G.subdivide_edge( (u, v, l), k )``       
     5459        - ``G.subdivide_edge( u, v, l, k )``       
    54605460
    54615461        .. NOTE::
    54625462
    5463             * If the given edge is labelled with `l`, all the edges
    5464               created by the subdivision will have the same label.
     5463            * New edges will have the same label as the edge they
     5464              have subdivided.
    54655465
    54665466            * If no label is given, the label used will be the one
    54675467              returned by the method :meth:`edge_label` on the pair
     
    54695469       
    54705470        EXAMPLE:
    54715471
    5472         Subdividing `5` times an edge in a path of length
    5473         `3` makes it a path of length `8`::
     5472        Subdividing an edge in a path of length `3` into `5` edges
     5473        makes it a path of length `8`::
    54745474
    54755475            sage: g = graphs.PathGraph(3)
    54765476            sage: edge = g.edges()[0]
     
    54785478            sage: g.is_isomorphic(graphs.PathGraph(8))
    54795479            True
    54805480
    5481         Subdividing a labelled edge in two ways ::
     5481        Subdividing a labelled edge in two ways::
    54825482
    54835483            sage: g = Graph()
    54845484            sage: g.add_edge(0,1,"label1")
    54855485            sage: g.add_edge(1,2,"label2")
    5486             sage: print sorted(g.edges())
     5486            sage: sorted(g.edges())
    54875487            [(0, 1, 'label1'), (1, 2, 'label2')]
    54885488
    54895489        Specifying the label::
    54905490
    54915491            sage: g.subdivide_edge(0,1,"label1", 3)
    5492             sage: print sorted(g.edges())
     5492            sage: sorted(g.edges())
    54935493            [(0, 3, 'label1'), (1, 2, 'label2'), (1, 5, 'label1'), (3, 4, 'label1'), (4, 5, 'label1')]
    54945494
    54955495        The lazy way::
    54965496
    5497             sage: g.subdivide_edge(1,2,"label2", 5)
    5498             sage: print sorted(g.edges())
     5497            sage: g.subdivide_edge(1,2, 5)
     5498            sage: sorted(g.edges())
    54995499            [(0, 3, 'label1'), (1, 5, 'label1'), (1, 6, 'label2'), (2, 10, 'label2'), (3, 4, 'label1'), (4, 5, 'label1'), (6, 7, 'label2'), (7, 8, 'label2'), (8, 9, 'label2'), (9, 10, 'label2')]
    55005500
    55015501        If too many arguments are given, an exception is raised ::