| igraph Reference Manual |
|---|
int igraph_neighborhood_size(const igraph_t *graph, igraph_vector_t *res, igraph_vs_t vids, igraph_integer_t order, igraph_neimode_t mode);
The neighborhood of a given order of a vertex includes all vertices which are closer to the vertex than the order. Ie. order 0 is always the vertex itself, order 1 is the vertex plus its immediate neighbors, order 2 is order 1 plus the immediate neighbors of the vertices in order 1, etc.
This function calculates the size of the neighborhood of the given order for the given vertices.
Arguments:
|
The input graph. |
|
Pointer to an initialized vector, the result will be stored here. It will be resized as needed. |
|
The vertices for which the calculation is performed. |
|
Integer giving the order of the neighborhood. |
|
Specifies how to use the direction of the edges if a
directed graph is analyzed. For |
Returns:
Error code. |
See also:
|
Time complexity: O(n*d*o), where n is the number vertices for which the calculation is performed, d is the average degree, o is the order.
| << 3. Neighborhood of a vertex | 3.2. igraph_neighborhood — Calculate the neighborhood of vertices >> |