Ticket #12806: trac_12806-docbuild-and-links-alt.patch

File trac_12806-docbuild-and-links-alt.patch, 5.8 KB (added by kcrisman, 7 years ago)

apply if weight='weight'

  • sage/graphs/digraph.py

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1341316749 -3600
    # Node ID 3db1b869b24d1adcf1797f0f5a6d65beb73153d4
    # Parent  27ea573f3fe24add016f468e3f960f7d2566f31a
    Trac 12806: fix error building documentation
    
    diff --git a/sage/graphs/digraph.py b/sage/graphs/digraph.py
    a b  
    162162        ...      g.subgraph(component).plot()
    163163
    164164    The same methods works for strongly connected components ::
     165
    165166        sage: for component in g.strongly_connected_components():
    166167        ...      g.subgraph(component).plot()
    167168   
     
    25982599        - ``implementation`` -- Use the default Cython implementation
    25992600          (``implementation = default``), the default NetworkX library
    26002601          (``implementation = "NetworkX"``) or the recursive NetworkX
    2601           implementation (``implementation = "recursive")
     2602          implementation (``implementation = "recursive"``)
    26022603
    26032604        .. SEEALSO::
    26042605
     
    26422643        .. note::
    26432644
    26442645           There is a recursive version of this in NetworkX, it used to
    2645         have problems in earlier versions but they have since been
    2646         fixed::
     2646           have problems in earlier versions but they have since been
     2647           fixed::
    26472648
    26482649              sage: import networkx
    26492650              sage: D = DiGraph({ 0:[1,2,3], 4:[2,5], 1:[8], 2:[7], 3:[7],
  • sage/graphs/generic_graph.py

    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    1077410774
    1077510775        The clustering coefficient of a graph is the fraction of possible
    1077610776        triangles that are triangles, `c_i = triangles_i /
    10777         (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     10777        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [HSSNX]_. A
    1077810778        coefficient for the whole graph is the average of the `c_i`.
    1077910779        Transitivity is the fraction of all possible triangles which are
    1078010780        triangles, T = 3\*triangles/triads, [HSSNX]_.
     
    1080510805    def clustering_average(self):
    1080610806        r"""
    1080710807        Returns the average clustering coefficient.
    10808        
     10808
    1080910809        The clustering coefficient of a graph is the fraction of possible
    1081010810        triangles that are triangles, `c_i = triangles_i /
    10811         (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     10811        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [NTX]_. A
    1081210812        coefficient for the whole graph is the average of the `c_i`.
    1081310813        Transitivity is the fraction of all possible triangles which are
    10814         triangles, T = 3\*triangles/triads, [1].
    10815        
     10814        triangles, T = 3\*triangles/triads, [NTX]_.
     10815
    1081610816        REFERENCE:
    1081710817
    10818         - [1] Aric Hagberg, Dan Schult and Pieter Swart. NetworkX
     10818        .. [NTX] Aric Hagberg, Dan Schult and Pieter Swart. NetworkX
    1081910819          documentation. [Online] Available:
    1082010820          https://networkx.lanl.gov/reference/networkx/
    10821        
    10822         EXAMPLES::
    10823        
     10821
     10822        EXAMPLES::
     10823
    1082410824            sage: (graphs.FruchtGraph()).clustering_average()
    1082510825            0.25
    1082610826        """
     
    1082910829       
    1083010830    def clustering_coeff(self, nodes=None, weight=False, return_vertex_weights=True):
    1083110831        r"""
    10832         Returns the clustering coefficient for each vertex in `nodes` as
     10832        Returns the clustering coefficient for each vertex in ``nodes`` as
    1083310833        a dictionary keyed by vertex.
    1083410834
    1083510835        For an unweighted graph, the clustering coefficient of a node
    1083610836        `i` is the fraction of possible triangles containing `i` that
    10837         exist. `c_i = 2\*T(i) / (k_i\*(k_i-1))` where T(i)` the number
     10837        exist. `\frac{2 T(i)}{k_i (k_i-1)}` where `T(i)` the number
    1083810838        of triangles through `i` and `k_i` is the degree of vertex `i`
    10839         [1].
     10839        [NX]_.
    1084010840
    1084110841        For weighted graphs the clustering is defined as the geometric
    10842         average of the subgraph edge weights [1], normalized by the
     10842        average of the subgraph edge weights [NX]_, normalized by the
    1084310843        maximum weight in the network.
    1084410844
    1084510845        The value of `c_i` is assigned to 0 if `k_i < 2`.
     
    1084710847        A coefficient for the whole graph is the average of the `c_i`.
    1084810848
    1084910849        Transitivity is the fraction of all possible triangles which are
    10850         triangles, T = 3\*triangles/triads, [1].
     10850        triangles, T = 3\*triangles/triads, [NX]_.
    1085110851
    1085210852        INPUT:
    1085310853
    1085410854        - ``nodes`` - the vertices to inspect (default None returns data
    1085510855          on all vertices in graph)
    1085610856
    10857         - ``weight`` - string or boolean default is False. If it is
     10857        - ``weight`` - string or boolean (default is False). If it is
    1085810858          a string it used the indicated edge property as weight.
    10859           `weight = True` is equivalent to `weight = weight`
     10859          ``weight = True`` is equivalent to ``weight = 'weight'``
    1086010860
    1086110861        - ``return_vertex_weights`` is a boolean ensuring backwards
    1086210862          compatibility with deprecated features of NetworkX 1.2. It
     
    1086410864
    1086510865        REFERENCE:
    1086610866
    10867         - [1] Aric Hagberg, Dan Schult and Pieter Swart. NetworkX
     10867        .. [NX] Aric Hagberg, Dan Schult and Pieter Swart. NetworkX
    1086810868          documentation. [Online] Available:
    1086910869          https://networkx.lanl.gov/reference/networkx/
    1087010870
     
    1096210962       
    1096310963        The clustering coefficient of a graph is the fraction of possible
    1096410964        triangles that are triangles, `c_i = triangles_i /
    10965         (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     10965        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]_. A
    1096610966        coefficient for the whole graph is the average of the `c_i`.
    1096710967        Transitivity is the fraction of all possible triangles which are
    10968         triangles, T = 3\*triangles/triads, [1].
     10968        triangles, T = 3\*triangles/triads, [1]_.
    1096910969       
    1097010970        REFERENCE:
    1097110971