1.1. igraph_permute_vertices — Permute the vertices

int igraph_permute_vertices(const igraph_t *graph, igraph_t *res,
			    const igraph_vector_t *permutation);

This function creates a new graph from the input graph by permuting its vertices according to the specified mapping. Call this function with the output of igraph_canonical_permutation() to create the canonical form of a graph.

Arguments: 

graph:

The input graph.

res:

Pointer to an uninitialized graph object. The new graph is created here.

permutation:

The permutation to apply. Vertex 0 is mapped to the first element of the vector, vertex 1 to the second, etc. Note that it is not checked that the vector contains every element only once, and no range checking is performed either.

Returns: 

Error code.

Time complexity: O(|V|+|E|), linear in terms of the number of vertices and edges.