DrL is a force-directed graph layout toolbox focused on real-world large-scale graphs, developed by Shawn Martin and colleagues at Sandia National Laboratories.
layout_with_drl(
graph,
use.seed = FALSE,
seed = matrix(runif(vcount(graph) * 2), ncol = 2),
options = drl_defaults$default,
weights = NULL,
fixed = NULL,
dim = 2
)with_drl(...)
The input graph, in can be directed or undirected.
Logical scalar, whether to use the coordinates given in the
seed
argument as a starting point.
A matrix with two columns, the starting coordinates for the
vertices is use.seed
is TRUE
. It is ignored otherwise.
Options for the layout generator, a named list. See details below.
The weights of the edges. It must be a positive numeric vector,
NULL
or NA
. If it is NULL
and the input graph has a
‘weight’ edge attribute, then that attribute will be used. If
NULL
and no such attribute is present, then the edges will have equal
weights. Set this to NA
if the graph was a ‘weight’ edge
attribute, but you don't want to use it for the layout. Larger edge weights
correspond to stronger connections.
Logical vector, it can be used to fix some vertices. Unfortunately this has never been implemented in the C core of the igraph library and thus it never worked. The argument is now deprecated and will be removed in igraph 1.4.0.
Either ‘2’ or ‘3’, it specifies whether we want a two dimensional or a three dimensional layout. Note that because of the nature of the DrL algorithm, the three dimensional layout takes significantly longer to compute.
Passed to layout_with_drl
.
A numeric matrix with two columns.
This function implements the force-directed DrL layout generator.
The generator has the following parameters:
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.
Number of iterations in the first phase.
Start temperature, first phase.
Attraction, first phase.
Damping, first phase.
Number of iterations, liquid phase.
Start temperature, liquid phase.
Attraction, liquid phase.
Damping, liquid phase.
Number of iterations, expansion phase.
Start temperature, expansion phase.
Attraction, expansion phase.
Damping, expansion phase.
Number of iterations, cooldown phase.
Start temperature, cooldown phase.
Attraction, cooldown phase.
Damping, cooldown phase.
Number of iterations, crunch phase.
Start temperature, crunch phase.
Attraction, crunch phase.
Damping, crunch phase.
Number of iterations, simmer phase.
Start temperature, simmer phase.
Attraction, simmer phase.
Damping, simmer phase.
There are five pre-defined parameter settings as well, these are called drl_defaults$default, drl_defaults$coarsen, drl_defaults$coarsest, drl_defaults$refine and drl_defaults$final.
See the following technical report: Martin, S., Brown, W.M., Klavans, R., Boyack, K.W., DrL: Distributed Recursive (Graph) Layout. SAND Reports, 2008. 2936: p. 1-10.
layout
for other layout generators.
# NOT RUN {
g <- as.undirected(sample_pa(100, m=1))
l <- layout_with_drl(g, options=list(simmer.attraction=0))
# }
# NOT RUN {
plot(g, layout=l, vertex.size=3, vertex.label=NA)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab