1.4. The DrL layout generator

1.4.1. igraph_layout_drl_options_t — Parameters for the DrL layout generator
1.4.2. igraph_layout_drl_default_t — Predefined parameter templates for the DrL layout generator
1.4.3. igraph_layout_drl_options_init — Initialize parameters for the DrL layout generator
1.4.4. igraph_layout_drl — The DrL layout generator

DrL is a sophisticated layout generator developed and implemented by Shawn Martin et al., see http://www.cs.sandia.gov/~smartin/software.html for details. Only a subset of the complete DrL functionality is included in igraph, parallel runs and recursive, multi-level layouting is not supported.

The parameters of the layout are stored in an igraph_layout_drl_options_t structure, this can be initialized by calling the function igraph_layout_drl_options_init(). The fields of this structure can then be adjusted by hand if needed. The layout is calculated by an igraph_layout_drl() call.

1.4.1. igraph_layout_drl_options_t — Parameters for the DrL layout generator

typedef struct igraph_layout_drl_options_t {
  igraph_real_t    edge_cut;
  igraph_integer_t init_iterations;
  igraph_real_t    init_temperature;
  igraph_real_t    init_attraction;
  igraph_real_t    init_damping_mult;
  igraph_integer_t liquid_iterations;
  igraph_real_t    liquid_temperature;
  igraph_real_t    liquid_attraction;
  igraph_real_t    liquid_damping_mult;
  igraph_integer_t expansion_iterations;
  igraph_real_t    expansion_temperature;
  igraph_real_t    expansion_attraction;
  igraph_real_t    expansion_damping_mult;
  igraph_integer_t cooldown_iterations;
  igraph_real_t    cooldown_temperature;
  igraph_real_t    cooldown_attraction;
  igraph_real_t    cooldown_damping_mult;
  igraph_integer_t crunch_iterations;
  igraph_real_t    crunch_temperature;
  igraph_real_t    crunch_attraction;
  igraph_real_t    crunch_damping_mult;
  igraph_integer_t simmer_iterations;
  igraph_real_t    simmer_temperature;
  igraph_real_t    simmer_attraction;
  igraph_real_t    simmer_damping_mult;
} igraph_layout_drl_options_t;

Values: 

edge_cut:

The edge cutting parameter. Edge cutting is done in the late stages of the algorithm in order to achieve less dense layouts. Edges are cut if there is a lot of stress on them (a large value in the objective function sum). The edge cutting parameter is a value between 0 and 1 with 0 representing no edge cutting and 1 representing maximal edge cutting. The default value is 32/40.

init_iterations:

Number of iterations, initial phase.

init_temperature:

Start temperature, initial phase.

init_attraction:

Attraction, initial phase.

init_damping_mult:

Damping factor, initial phase.

liquid_iterations:

Number of iterations in the liquid phase.

liquid_temperature:

Start temperature in the liquid phase.

liquid_attraction:

Attraction in the liquid phase.

liquid_damping_mult:

Multiplicatie damping factor, liquid phase.

expansion_iterations:

Number of iterations in the expansion phase.

expansion_temperature:

Start temperature in the expansion phase.

expansion_attraction:

Attraction, expansion phase.

expansion_damping_mult:

Damping factor, expansion phase.

cooldown_iterations:

Number of iterations in the cooldown phase.

cooldown_temperature:

Start temperature in the cooldown phase.

cooldown_attraction:

Attraction in the cooldown phase.

cooldown_damping_mult:

Damping fact int the cooldown phase.

crunch_iterations:

Number of iterations in the crunch phase.

crunch_temperature:

Start temperature in the crunch phase.

crunch_attraction:

Attraction in the crunch phase.

crunch_damping_mult:

Damping factor in the crunch phase.

simmer_iterations:

Number of iterations in the simmer phase.

simmer_temperature:

Start temperature in te simmer phase.

simmer_attraction:

Attraction in the simmer phase.

simmer_damping_mult:

Multiplicative damping factor in the simmer phase.

1.4.2. igraph_layout_drl_default_t — Predefined parameter templates for the DrL layout generator

typedef enum { IGRAPH_LAYOUT_DRL_DEFAULT=0, 
	       IGRAPH_LAYOUT_DRL_COARSEN,
	       IGRAPH_LAYOUT_DRL_COARSEST,
	       IGRAPH_LAYOUT_DRL_REFINE,
	       IGRAPH_LAYOUT_DRL_FINAL } igraph_layout_drl_default_t;

These constants can be used to initialize a set of DrL parameters. These can then be modified according to the user's needs.

Values: 

IGRAPH_LAYOUT_DRL_DEFAULT:

The deafult parameters.

IGRAPH_LAYOUT_DRL_COARSEN:

Slightly modified parameters to get a coarser layout.

IGRAPH_LAYOUT_DRL_COARSEST:

An even coarser layout.

IGRAPH_LAYOUT_DRL_REFINE:

Refine an already calculated layout.

IGRAPH_LAYOUT_DRL_FINAL:

Finalize an already refined layout.

1.4.3. igraph_layout_drl_options_init — Initialize parameters for the DrL layout generator

int igraph_layout_drl_options_init(igraph_layout_drl_options_t *options,
				   igraph_layout_drl_default_t templ);

This function can be used to initialize the struct holding the parameters for the DrL layout generator. There are a number of predefined templates available, it is a good idea to start from one of these by modifying some parameters.

Arguments: 

options:

The struct to initialize.

templ:

The template to use. Currently the following templates are supplied: IGRAPH_LAYOUT_DRL_DEFAULT, IGRAPH_LAYOUT_DRL_COARSEN, IGRAPH_LAYOUT_DRL_COARSEST, IGRAPH_LAYOUT_DRL_REFINE and IGRAPH_LAYOUT_DRL_FINAL.

Returns: 

Error code.

Time complexity: O(1).

1.4.4. igraph_layout_drl — The DrL layout generator

int igraph_layout_drl(const igraph_t *graph, igraph_matrix_t *res, 
		      igraph_bool_t use_seed,
		      igraph_layout_drl_options_t *options,
		      const igraph_vector_t *weights,
		      const igraph_vector_bool_t *fixed);

This function implements the force-directed DrL layout generator. Please see more at http://www.cs.sandia.gov/~smartin/software.html

Arguments: 

graph:

The input graph.

use_seed:

Logical scalar, if true, then the coordinates supplied in the res argument are used as starting points.

res:

Pointer to a matrix, the result layout is stored here. It will be resized as needed.

options:

The parameters to pass to the layout generator.

weights:

Edge weights, pointer to a vector. If this is a null pointer then every edge will have the same weight.

fixed:

Pointer to a logical vector, or a null pointer. This can be used to fix the position of some vertices. Vertices for which it is true will not be moved, but stay at the coordinates given in the res matrix. This argument is ignored if it is a null pointer or if use_seed is false.

Returns: 

Error code.

Time complexity: ???.