Ticket #8513: trac_8513_graph_theory_documentation-smallfixes.patch

File trac_8513_graph_theory_documentation-smallfixes.patch, 13.0 KB (added by mvngu, 11 years ago)
  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1269341571 -3600
    # Node ID f17430f5f6f16cd7968ddd265b53d545d69408f0
    # Parent  9de022253f37a53a8319d6964e4113db7988ac21
    #8513: small fixes in the docstrings of generic graph and undirected graph classes
    
    diff -r 9de022253f37 -r f17430f5f6f1 sage/graphs/generic_graph.py
    a b  
    29162916        itself has no cut vertices. Two distinct blocks cannot overlap in
    29172917        more than a single cut vertex.
    29182918       
    2919         OUTPUT: ( B, C ), where B is a list of blocks- each is a list of
    2920         vertices and the blocks are the corresponding induced subgraphs-
    2921         and C is a list of cut vertices.
     2919        OUTPUT: ``( B, C )``, where ``B`` is a list of blocks- each is
     2920        a list of vertices and the blocks are the corresponding induced
     2921        subgraphs-and ``C`` is a list of cut vertices.
    29222922       
    29232923        EXAMPLES::
    29242924       
     
    29492949            ...
    29502950            NotImplementedError: ...
    29512951
    2952         ALGORITHM: 8.3.8 in [1]. Notice that the termination condition on
    2953         line (23) of the algorithm uses "p[v] == 0" which in the book
    2954         means that the parent is undefined; in this case, v must be the
    2955         root s.  Since our vertex names start with 0, we substitute instead
    2956         the condition "v == s".  This is the terminating condition used
     2952        ALGORITHM: 8.3.8 in [Jungnickel05]_. Notice that the termination condition on
     2953        line (23) of the algorithm uses ``p[v] == 0`` which in the book
     2954        means that the parent is undefined; in this case, `v` must be the
     2955        root `s`.  Since our vertex names start with `0`, we substitute instead
     2956        the condition ``v == s``.  This is the terminating condition used
    29572957        in the general Depth First Search tree in Algorithm 8.2.1.
    29582958       
    29592959        REFERENCE:
    29602960
    2961         - [1] D. Jungnickel, Graphs, Networks and Algorithms,
     2961        .. [Jungnickel05] D. Jungnickel, Graphs, Networks and Algorithms,
    29622962          Springer, 2005.
    29632963        """
    29642964        if not self: # empty graph
     
    38263826
    38273827        This function returns a list of such paths.
    38283828
    3829         NOTE:
    3830 
    3831         This function is topological : it does not take the eventual
    3832         weights of the edges into account.
     3829        .. NOTE::
     3830
     3831            This function is topological : it does not take the eventual
     3832            weights of the edges into account.
    38333833
    38343834        EXAMPLE:
    38353835
     
    65836583        ordered list.
    65846584       
    65856585        The clustering coefficient of a graph is the fraction of possible
    6586         triangles that are triangles, c_i = triangles_i /
    6587         (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, [1]. A
    6588         coefficient for the whole graph is the average of the c_i.
     6586        triangles that are triangles, `c_i = triangles_i /
     6587        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     6588        coefficient for the whole graph is the average of the `c_i`.
    65896589        Transitivity is the fraction of all possible triangles which are
    65906590        triangles, T = 3\*triangles/triads, [HSSNX]_.
    65916591       
     
    66226622        Returns the average clustering coefficient.
    66236623       
    66246624        The clustering coefficient of a graph is the fraction of possible
    6625         triangles that are triangles, c_i = triangles_i /
    6626         (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, [1]. A
    6627         coefficient for the whole graph is the average of the c_i.
     6625        triangles that are triangles, `c_i = triangles_i /
     6626        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     6627        coefficient for the whole graph is the average of the `c_i`.
    66286628        Transitivity is the fraction of all possible triangles which are
    66296629        triangles, T = 3\*triangles/triads, [1].
    66306630       
     
    66486648        ordered list.
    66496649       
    66506650        The clustering coefficient of a graph is the fraction of possible
    6651         triangles that are triangles, c_i = triangles_i /
    6652         (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, [1]. A
    6653         coefficient for the whole graph is the average of the c_i.
     6651        triangles that are triangles, `c_i = triangles_i /
     6652        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     6653        coefficient for the whole graph is the average of the `c_i`.
    66546654        Transitivity is the fraction of all possible triangles which are
    66556655        triangles, T = 3\*triangles/triads, [1].
    66566656       
     
    66976697        graph.
    66986698       
    66996699        The clustering coefficient of a graph is the fraction of possible
    6700         triangles that are triangles, c_i = triangles_i /
    6701         (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, [1]. A
    6702         coefficient for the whole graph is the average of the c_i.
     6700        triangles that are triangles, `c_i = triangles_i /
     6701        (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, [1]. A
     6702        coefficient for the whole graph is the average of the `c_i`.
    67036703        Transitivity is the fraction of all possible triangles which are
    67046704        triangles, T = 3\*triangles/triads, [1].
    67056705       
    67066706        REFERENCE:
    67076707
    6708         - [1] Aric Hagberg, Dan Schult and Pieter Swart. NetworkX
     6708        .. [1] Aric Hagberg, Dan Schult and Pieter Swart. NetworkX
    67096709          documentation. [Online] Available:
    67106710          https://networkx.lanl.gov/reference/networkx/
    67116711       
     
    85268526        """
    85278527        Returns the Cartesian product of self and other.
    85288528       
    8529         The Cartesian product of G and H is the graph L with vertex set
    8530         V(L) equal to the Cartesian product of the vertices V(G) and V(H),
    8531         and ((u,v), (w,x)) is an edge iff either - (u, w) is an edge of
    8532         self and v = x, or - (v, x) is an edge of other and u = w.
     8529        The Cartesian product of `G` and `H` is the graph `L` with vertex set
     8530        `V(L)` equal to the Cartesian product of the vertices `V(G)` and `V(H)`,
     8531        and `((u,v), (w,x))` is an edge iff either - `(u, w)` is an edge of
     8532        self and `v = x`, or - `(v, x)` is an edge of other and `u = w`.
    85338533       
    85348534        EXAMPLES::
    85358535       
     
    85738573        Returns the tensor product, also called the categorical product, of
    85748574        self and other.
    85758575       
    8576         The tensor product of G and H is the graph L with vertex set V(L)
    8577         equal to the Cartesian product of the vertices V(G) and V(H), and
    8578         ((u,v), (w,x)) is an edge iff - (u, w) is an edge of self, and -
    8579         (v, x) is an edge of other.
     8576        The tensor product of `G` and `H` is the graph `L` with vertex set `V(L)`
     8577        equal to the Cartesian product of the vertices `V(G)` and `V(H)`, and
     8578        `((u,v), (w,x))` is an edge iff - `(u, w)` is an edge of self, and -
     8579        `(v, x)` is an edge of other.
    85808580       
    85818581        EXAMPLES::
    85828582       
  • sage/graphs/graph.py

    diff -r 9de022253f37 -r f17430f5f6f1 sage/graphs/graph.py
    a b  
    14111411          as a Graph object.
    14121412        - When no solution exists, returns ``False``
    14131413
    1414         NOTES:
     1414        .. NOTE::
    14151415
    1416         - This algorithm computes the degree-constrained subgraph of minimum weight.
    1417         - If the graph's edges are weighted, these are taken into account.
    1418         - This problem can be solved in polynomial time.
     1416            - This algorithm computes the degree-constrained subgraph of minimum weight.
     1417            - If the graph's edges are weighted, these are taken into account.
     1418            - This problem can be solved in polynomial time.
    14191419
    14201420        EXAMPLES:
    14211421
     
    14911491
    14921492        A digraph representing an orientation of the current graph.
    14931493
    1494         NOTES:
     1494        .. NOTE::
    14951495       
    1496         - This method assumes the graph is connected.
    1497         - This algorithm works in O(m).
     1496            - This method assumes the graph is connected.
     1497            - This algorithm works in O(m).
    14981498
    14991499        EXAMPLE:
    15001500
     
    21632163        by a list of vertices. A clique is an induced complete subgraph, and a
    21642164        maximal clique is one not contained in a larger one.
    21652165       
    2166         NOTES:
     2166        .. NOTE::
    21672167       
    2168          - Currently only implemented for undirected graphs. Use to_undirected
    2169            to convert a digraph to an undirected graph.
     2168           Currently only implemented for undirected graphs. Use to_undirected
     2169            to convert a digraph to an undirected graph.
    21702170       
    21712171        ALGORITHM:
    21722172       
     
    22232223        by a list of vertices. A clique is an induced complete subgraph, and a
    22242224        maximum clique is one of maximal order.
    22252225       
    2226         NOTES:
     2226        .. NOTE::
    22272227       
    2228         - Currently only implemented for undirected graphs. Use to_undirected
    2229           to convert a digraph to an undirected graph.
     2228            Currently only implemented for undirected graphs. Use to_undirected
     2229            to convert a digraph to an undirected graph.
    22302230       
    22312231        ALGORITHM:
    22322232       
     
    22622262        """
    22632263        Returns the vertex set of a maximal order complete subgraph.
    22642264       
    2265         NOTE:
     2265        .. NOTE::
    22662266       
    2267          - Currently only implemented for undirected graphs. Use to_undirected
    2268            to convert a digraph to an undirected graph.
     2267           Currently only implemented for undirected graphs. Use to_undirected
     2268            to convert a digraph to an undirected graph.
    22692269       
    22702270        ALGORITHM:
    22712271       
     
    22892289        Returns the order of the largest clique of the graph (the clique
    22902290        number).
    22912291
    2292         NOTE:
     2292        .. NOTE::
    22932293       
    2294          - Currently only implemented for undirected graphs. Use ``to_undirected``
    2295            to convert a digraph to an undirected graph.
     2294           Currently only implemented for undirected graphs. Use ``to_undirected``
     2295            to convert a digraph to an undirected graph.
    22962296
    22972297        INPUT:
    22982298       
     
    23342334        Returns a list of the number of maximal cliques containing each
    23352335        vertex. (Returns a single value if only one input vertex).
    23362336       
    2337         NOTES:
     2337        .. NOTE::
    23382338       
    2339          - Currently only implemented for undirected graphs. Use to_undirected
    2340            to convert a digraph to an undirected graph.
     2339           Currently only implemented for undirected graphs. Use to_undirected
     2340            to convert a digraph to an undirected graph.
    23412341       
    23422342        INPUT:
    23432343       
     
    23872387        edges between maximal cliques with common members in the original
    23882388        graph.
    23892389       
    2390         NOTES:
     2390        .. NOTE::
    23912391       
    2392          - Currently only implemented for undirected graphs. Use to_undirected
    2393            to convert a digraph to an undirected graph.
     2392           Currently only implemented for undirected graphs. Use to_undirected
     2393            to convert a digraph to an undirected graph.
    23942394       
    23952395        INPUT:
    23962396       
     
    24172417        graph. Right and left vertices are connected if the bottom vertex
    24182418        belongs to the clique represented by a top vertex.
    24192419       
    2420         NOTES:
     2420        .. NOTE::
    24212421       
    2422          - Currently only implemented for undirected graphs. Use to_undirected
    2423            to convert a digraph to an undirected graph.
     2422           Currently only implemented for undirected graphs. Use to_undirected
     2423            to convert a digraph to an undirected graph.
    24242424       
    24252425        EXAMPLES::
    24262426       
     
    24422442        Returns a maximal independent set, which is a set of vertices which
    24432443        induces an empty subgraph. Uses Cliquer [NisOst2003]_.
    24442444       
    2445         NOTES:
     2445        .. NOTE::
    24462446       
    2447          - Currently only implemented for undirected graphs. Use to_undirected
    2448            to convert a digraph to an undirected graph.
     2447           Currently only implemented for undirected graphs. Use to_undirected
     2448            to convert a digraph to an undirected graph.
    24492449       
    24502450        EXAMPLES::
    24512451       
     
    24622462        Returns a list of sizes of the largest maximal cliques containing
    24632463        each vertex. (Returns a single value if only one input vertex).
    24642464       
    2465         NOTES:
     2465        .. NOTE::
    24662466       
    2467          - Currently only implemented for undirected graphs. Use to_undirected
    2468            to convert a digraph to an undirected graph.
     2467           Currently only implemented for undirected graphs. Use to_undirected
     2468            to convert a digraph to an undirected graph.
    24692469       
    24702470        INPUT:
    24712471       
     
    25352535        Returns the cliques containing each vertex, represented as a list
    25362536        of lists. (Returns a single list if only one input vertex).
    25372537       
    2538         NOTE:
     2538        .. NOTE::
    25392539       
    2540          - Currently only implemented for undirected graphs. Use to_undirected
    2541            to convert a digraph to an undirected graph.
     2540           Currently only implemented for undirected graphs. Use to_undirected
     2541            to convert a digraph to an undirected graph.
    25422542       
    25432543        INPUT:
    25442544