=== modified file 'src/components.c' --- src/components.c 2010-10-06 11:54:50 +0000 +++ src/components.c 2011-02-03 00:07:49 +0000 @@ -219,7 +219,7 @@ } /* for */ /* OK, we've the 'out' values for the nodes, let's use them in - descreasing order with the help of a heap */ + decreasing order with the help of a heap */ igraph_vector_null(&next_nei); /* mark already added vertices */ @@ -274,7 +274,7 @@ * \function igraph_is_connected * \brief Decides whether the graph is (weakly or strongly) connected. * - * A graph with zero vertices is connected by definition. + * A graph with zero vertices (i.e. the null graph) is connected by definition. * * \param graph The graph object to analyze. * \param res Pointer to a logical variable, the result will be stored @@ -283,7 +283,7 @@ * weak or strong connectedness. Possible values: * \c IGRAPH_WEAK, * \c IGRAPH_STRONG. This argument is - * igrored for undirected graphs. + * ignored for undirected graphs. * \return Error code: * \c IGRAPH_EINVAL: invalid mode argument. * @@ -292,7 +292,6 @@ * plus the number of edges in the graph. */ - int igraph_is_connected(const igraph_t *graph, igraph_bool_t *res, igraph_connectedness_t mode) { if (igraph_vcount(graph) == 0) { @@ -314,6 +313,25 @@ return 0; } +/** + * \ingroup structural + * \function igraph_is_connected_weak + * \brief Query whether the graph is weakly connected. + * + * A graph with zero vertices (i.e. the null graph) is weakly connected by + * definition. A directed graph is weakly connected if its undirected version + * is connected. In the case of undirected graphs, weakly connected and + * connected are equivalent. + * + * \param graph The graph object to analyze. + * \param res Pointer to a logical variable; the result will be stored here. + * \return Error code: + * \c IGRAPH_ENOMEM: unable to allocate requested memory. + * + * Time complexity: O(|V|+|E|), the number of vertices plus the number of + * edges in the graph. + */ + int igraph_is_connected_weak(const igraph_t *graph, igraph_bool_t *res) { long int no_of_nodes=igraph_vcount(graph); @@ -325,7 +343,7 @@ if (no_of_nodes == 0) { *res = 1; - return IGRAPH_SUCCESS; + return IGRAPH_SUCCESS; } already_added=igraph_Calloc(no_of_nodes, char); @@ -368,7 +386,7 @@ /** * \function igraph_decompose_destroy - * \brief Free the memory allocated by \ref igraph_decompose() + * \brief Free the memory allocated by \ref igraph_decompose(). * * \param complist The list of graph components, as returned by * \ref igraph_decompose(). @@ -411,7 +429,7 @@ * the number of components. * \param minelements The minimum number of vertices a component * should contain in order to place it in the \p components - * vector. Eg. supply 2 here to ignore isolate vertices. + * vector. Eg. supply 2 here to ignore isolated vertices. * \return Error code, \c IGRAPH_ENOMEM if there is not enough memory * to perform the operation. * @@ -556,7 +574,7 @@ * one biconnected component. Note that this is not true for * vertices: the same vertex can be part of many biconnected * components. - * \param graph The input graph + * \param graph The input graph. * \param no The number of biconnected components will be stored here. * \param tree_edges If not a NULL pointer, then the found components * are stored here, in a list of vectors. Every vector in the list === modified file 'src/games.c' --- src/games.c 2011-02-03 14:49:43 +0000 +++ src/games.c 2011-02-03 18:57:29 +0000 @@ -409,7 +409,7 @@ * \cli IGRAPH_BARABASI_BAG * This is the algorithm that was previously (before version * 0.6) solely implemented in igraph. It works by putting the - * ids of the vertices into a bag (mutliset, really), exactly + * ids of the vertices into a bag (multiset, really), exactly * as many times as their (in-)degree, plus once more. Then * the required number of cited vertices are drawn from the * bag, with replacement. This method might generate multiple @@ -731,7 +731,7 @@ * \p type, \p n, * \p p or \p m * parameter. - * \c IGRAPH_ENOMEM: there is not enought + * \c IGRAPH_ENOMEM: there is not enough * memory for the operation. * * Time complexity: O(|V|+|E|), the @@ -833,7 +833,7 @@ long int from=RNG_INTEGER(0, bagp1-1); long int to=RNG_INTEGER(0, bagp2-1); igraph_vector_push_back(&edges, bag1[from]); /* safe, already reserved */ - igraph_vector_push_back(&edges, bag2[to]); /* detto */ + igraph_vector_push_back(&edges, bag2[to]); /* ditto */ bag1[from]=bag1[bagp1-1]; bag2[to]=bag2[bagp2-1]; bagp1--; bagp2--; @@ -846,7 +846,7 @@ bag1[from]=bag1[bagp1-1]; bagp1--; to=RNG_INTEGER(0, bagp1-1); - igraph_vector_push_back(&edges, bag1[to]); /* detto */ + igraph_vector_push_back(&edges, bag1[to]); /* ditto */ bag1[to]=bag1[bagp1-1]; bagp1--; } @@ -1444,7 +1444,7 @@ VECTOR(edges)[edgeptr++] = i; VECTOR(edges)[edgeptr++] = to; } - /* update probabilites */ + /* update probabilities */ for (j=0; j