1.8. igraph_layout_grid_fruchterman_reingold — Force based layout generator for large graphs.

int igraph_layout_grid_fruchterman_reingold(const igraph_t *graph, 
					    igraph_matrix_t *res,
					    igraph_integer_t niter, igraph_real_t maxdelta, 
					    igraph_real_t area, igraph_real_t coolexp,
					    igraph_real_t repulserad, 
					    igraph_real_t cellsize,
					    igraph_bool_t use_seed);

This algorithm is the same as the Fruchterman-Reingold layout generator, but it partitions the 2d space to a grid and and vertex repulsion is calculated only for vertices nearby.

Arguments: 

graph:

The graph object.

res:

The result, the coordinates in a matrix. The parameter should point to an initialized matrix object and will be resized.

niter:

Number of iterations to perform.

maxdelta:

Maximum distance to move a vertex in an iteration.

area:

The area of the square on which the vertices will be placed.

coolexp:

The cooling exponent.

repulserad:

Determines the radius at which vertex-vertex repulsion cancels out attraction of adjacenct vertices.

cellsize:

The size of the grid cells.

use_seed:

Logical, if true, the coordinates passed in res (should have the appropriate size) will be used for the first iteration.

Returns: 

Error code.

Added in version 0.2.

Time complexity: ideally (constant number of vertices in each cell) O(niter*(|V|+|E|)), in the worst case O(niter*(|V|^2+|E|)).