10.1. igraph_to_directed — Convert an undirected graph to a directed one

int igraph_to_directed(igraph_t *graph,
		       igraph_to_directed_t mode);

If the supplied graph is directed, this function does nothing.

Arguments: 

graph:

The graph object to convert.

mode:

Constant, specifies the details of how exactly the conversion is done. Possible values: IGRAPH_TO_DIRECTED_ARBITRARY: the number of edges in the graph stays the same, an arbitrarily directed edge is created for each undirected edge; IGRAPH_TO_DIRECTED_MUTUAL: two directed edges are created for each undirected edge, one in each direction.

Returns: 

Error code.

Time complexity: O(|V|+|E|), the number of vertices plus the number of edges.