1.6. igraph_layout_kamada_kawai — Places the vertices on a plane according the Kamada-Kawai algorithm.

int igraph_layout_kamada_kawai(const igraph_t *graph, igraph_matrix_t *res,
			       igraph_integer_t niter, igraph_real_t sigma, 
			       igraph_real_t initemp, igraph_real_t coolexp,
			       igraph_real_t kkconst, igraph_bool_t use_seed);

This is a force directed layout, see Kamada, T. and Kawai, S.: An Algorithm for Drawing General Undirected Graphs. Information Processing Letters, 31/1, 7--15, 1989. This function was ported from the SNA R package.

Arguments: 

graph:

A graph object.

res:

Pointer to an initialized matrix object. This will contain the result and will be resized if needed.

niter:

The number of iterations to perform.

sigma:

Sets the base standard deviation of position change proposals.

initemp:

Sets the initial temperature for the annealing.

coolexp:

The cooling exponent of the annealing.

kkconst:

The Kamada-Kawai vertex attraction constant.

use_seed:

Boolean, whether to use the values cupplied in the res argument as the initial configuration. If zero then a random initial configuration is used.

Returns: 

Error code.

Time complexity: O(|V|^2) for each iteration, |V| is the number of vertices in the graph.