| igraph Reference Manual |
|---|
int igraph_neighborhood_graphs(const igraph_t *graph, igraph_vector_ptr_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 finds every vertex in the neighborhood of a given parameter vertex and creates a graph from these vertices.
The first version of this function was written by Vincent Matossian, thanks Vincent.
Arguments:
|
The input graph. |
|
Pointer to a pointer vector, the result will be stored
here, ie. |
|
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*(|V|+|E|)), where n is the number vertices for which the calculation is performed, |V| and |E| are the number of vertices and edges in the original input graph.
<< 3.2. igraph_neighborhood — Calculate the neighborhood of vertices |
4. Graph Components >> |