### 3.3. `igraph_neighborhood_graphs` — Create graphs from the neighborhood(s) of some vertex/vertices

```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:

 `graph`: The input graph. `res`: Pointer to a pointer vector, the result will be stored here, ie. `res` will contain pointers to `igraph_t` objects. It will be resized if needed but note that the objects in the pointer vector will not be freed. `vids`: The vertices for which the calculation is performed. `order`: Integer giving the order of the neighborhood. `mode`: Specifies how to use the direction of the edges if a directed graph is analyzed. For `IGRAPH_OUT` only the outgoing edges are followed, so all vertices reachable from the source vertex in at most `order` steps are counted. For `IGRAPH_IN` all vertices from which the source vertex is reachable in at most `order` steps are counted. `IGRAPH_ALL` ignores the direction of the edges. This argument is ignored for undirected graphs.

Returns:

 Error code.

 `igraph_neighborhood_size()` for calculating the neighborhood sizes only, `igraph_neighborhood()` for calculating the neighborhoods (but not creating graphs).