| igraph Reference Manual |
|---|
igraph_layout_drl_options_t — Parameters for the DrL layout generatorigraph_layout_drl_default_t — Predefined parameter templates for the DrL layout generatorigraph_layout_drl_options_init — Initialize parameters for the DrL layout generatorigraph_layout_drl — The DrL layout generatorDrL 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.
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:
|
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. |
|
Number of iterations, initial phase. |
|
Start temperature, initial phase. |
|
Attraction, initial phase. |
|
Damping factor, initial phase. |
|
Number of iterations in the liquid phase. |
|
Start temperature in the liquid phase. |
|
Attraction in the liquid phase. |
|
Multiplicatie damping factor, liquid phase. |
|
Number of iterations in the expansion phase. |
|
Start temperature in the expansion phase. |
|
Attraction, expansion phase. |
|
Damping factor, expansion phase. |
|
Number of iterations in the cooldown phase. |
|
Start temperature in the cooldown phase. |
|
Attraction in the cooldown phase. |
|
Damping fact int the cooldown phase. |
|
Number of iterations in the crunch phase. |
|
Start temperature in the crunch phase. |
|
Attraction in the crunch phase. |
|
Damping factor in the crunch phase. |
|
Number of iterations in the simmer phase. |
|
Start temperature in te simmer phase. |
|
Attraction in the simmer phase. |
|
Multiplicative damping factor in the simmer phase. |
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:
|
The deafult parameters. |
|
Slightly modified parameters to get a coarser layout. |
|
An even coarser layout. |
|
Refine an already calculated layout. |
|
Finalize an already refined layout. |
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:
|
The struct to initialize. |
|
The template to use. Currently the following templates
are supplied: |
Returns:
Error code. |
Time complexity: O(1).
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:
|
The input graph. |
|
Logical scalar, if true, then the coordinates
supplied in the |
|
Pointer to a matrix, the result layout is stored here. It will be resized as needed. |
|
The parameters to pass to the layout generator. |
|
Edge weights, pointer to a vector. If this is a null pointer then every edge will have the same weight. |
|
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 |
Returns:
Error code. |
Time complexity: ???.