# 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 itself has no cut vertices. Two distinct blocks cannot overlap in more than a single cut vertex. OUTPUT: ( B, C ), where B is a list of blocks- each is a list of vertices and the blocks are the corresponding induced subgraphs- and C is a list of cut vertices. OUTPUT: ``( B, C )``, where ``B`` is a list of blocks- each is a list of vertices and the blocks are the corresponding induced subgraphs-and ``C`` is a list of cut vertices. EXAMPLES:: ... NotImplementedError: ... ALGORITHM: 8.3.8 in . Notice that the termination condition on line (23) of the algorithm uses "p[v] == 0" which in the book means that the parent is undefined; in this case, v must be the root s.  Since our vertex names start with 0, we substitute instead the condition "v == s".  This is the terminating condition used ALGORITHM: 8.3.8 in [Jungnickel05]_. Notice that the termination condition on line (23) of the algorithm uses ``p[v] == 0`` which in the book means that the parent is undefined; in this case, `v` must be the root `s`.  Since our vertex names start with `0`, we substitute instead the condition ``v == s``.  This is the terminating condition used in the general Depth First Search tree in Algorithm 8.2.1. REFERENCE: -  D. Jungnickel, Graphs, Networks and Algorithms, .. [Jungnickel05] D. Jungnickel, Graphs, Networks and Algorithms, Springer, 2005. """ if not self: # empty graph This function returns a list of such paths. NOTE: This function is topological : it does not take the eventual weights of the edges into account. .. NOTE:: This function is topological : it does not take the eventual weights of the edges into account. EXAMPLE: ordered list. The clustering coefficient of a graph is the fraction of possible triangles that are triangles, c_i = triangles_i / (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, . A coefficient for the whole graph is the average of the c_i. triangles that are triangles, `c_i = triangles_i / (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, . A coefficient for the whole graph is the average of the `c_i`. Transitivity is the fraction of all possible triangles which are triangles, T = 3\*triangles/triads, [HSSNX]_. Returns the average clustering coefficient. The clustering coefficient of a graph is the fraction of possible triangles that are triangles, c_i = triangles_i / (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, . A coefficient for the whole graph is the average of the c_i. triangles that are triangles, `c_i = triangles_i / (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, . A coefficient for the whole graph is the average of the `c_i`. Transitivity is the fraction of all possible triangles which are triangles, T = 3\*triangles/triads, . ordered list. The clustering coefficient of a graph is the fraction of possible triangles that are triangles, c_i = triangles_i / (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, . A coefficient for the whole graph is the average of the c_i. triangles that are triangles, `c_i = triangles_i / (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, . A coefficient for the whole graph is the average of the `c_i`. Transitivity is the fraction of all possible triangles which are triangles, T = 3\*triangles/triads, . graph. The clustering coefficient of a graph is the fraction of possible triangles that are triangles, c_i = triangles_i / (k_i\*(k_i-1)/2) where k_i is the degree of vertex i, . A coefficient for the whole graph is the average of the c_i. triangles that are triangles, `c_i = triangles_i / (k_i\*(k_i-1)/2)` where `k_i` is the degree of vertex `i`, . A coefficient for the whole graph is the average of the `c_i`. Transitivity is the fraction of all possible triangles which are triangles, T = 3\*triangles/triads, . REFERENCE: -  Aric Hagberg, Dan Schult and Pieter Swart. NetworkX ..  Aric Hagberg, Dan Schult and Pieter Swart. NetworkX documentation. [Online] Available: https://networkx.lanl.gov/reference/networkx/ """ Returns the Cartesian product of self and other. The Cartesian product of G and H is the graph L with vertex set V(L) equal to the Cartesian product of the vertices V(G) and V(H), and ((u,v), (w,x)) is an edge iff either - (u, w) is an edge of self and v = x, or - (v, x) is an edge of other and u = w. The Cartesian product of `G` and `H` is the graph `L` with vertex set `V(L)` equal to the Cartesian product of the vertices `V(G)` and `V(H)`, and `((u,v), (w,x))` is an edge iff either - `(u, w)` is an edge of self and `v = x`, or - `(v, x)` is an edge of other and `u = w`. EXAMPLES:: Returns the tensor product, also called the categorical product, of self and other. The tensor product of G and H is the graph L with vertex set V(L) equal to the Cartesian product of the vertices V(G) and V(H), and ((u,v), (w,x)) is an edge iff - (u, w) is an edge of self, and - (v, x) is an edge of other. The tensor product of `G` and `H` is the graph `L` with vertex set `V(L)` equal to the Cartesian product of the vertices `V(G)` and `V(H)`, and `((u,v), (w,x))` is an edge iff - `(u, w)` is an edge of self, and - `(v, x)` is an edge of other. EXAMPLES::
• ## sage/graphs/graph.py

`diff -r 9de022253f37 -r f17430f5f6f1 sage/graphs/graph.py`
 a as a Graph object. - When no solution exists, returns ``False`` NOTES: .. NOTE:: - This algorithm computes the degree-constrained subgraph of minimum weight. - If the graph's edges are weighted, these are taken into account. - This problem can be solved in polynomial time. - This algorithm computes the degree-constrained subgraph of minimum weight. - If the graph's edges are weighted, these are taken into account. - This problem can be solved in polynomial time. EXAMPLES: A digraph representing an orientation of the current graph. NOTES: .. NOTE:: - This method assumes the graph is connected. - This algorithm works in O(m). - This method assumes the graph is connected. - This algorithm works in O(m). EXAMPLE: by a list of vertices. A clique is an induced complete subgraph, and a maximal clique is one not contained in a larger one. NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. ALGORITHM: by a list of vertices. A clique is an induced complete subgraph, and a maximum clique is one of maximal order. NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. ALGORITHM: """ Returns the vertex set of a maximal order complete subgraph. NOTE: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. ALGORITHM: Returns the order of the largest clique of the graph (the clique number). NOTE: .. NOTE:: - Currently only implemented for undirected graphs. Use ``to_undirected`` to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use ``to_undirected`` to convert a digraph to an undirected graph. INPUT: Returns a list of the number of maximal cliques containing each vertex. (Returns a single value if only one input vertex). NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. INPUT: edges between maximal cliques with common members in the original graph. NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. INPUT: graph. Right and left vertices are connected if the bottom vertex belongs to the clique represented by a top vertex. NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. EXAMPLES:: Returns a maximal independent set, which is a set of vertices which induces an empty subgraph. Uses Cliquer [NisOst2003]_. NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. EXAMPLES:: Returns a list of sizes of the largest maximal cliques containing each vertex. (Returns a single value if only one input vertex). NOTES: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. INPUT: Returns the cliques containing each vertex, represented as a list of lists. (Returns a single list if only one input vertex). NOTE: .. NOTE:: - Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. INPUT: