addWeightsConcave {grapherator} | R Documentation |
@title Weight generators.
Description
Function for adding weight(s) to edges. The following functions
are implemented and may be passed as argument generator
to addWeights
:
addWeightsRandom
Add purely random weights. Calls the passed
method
, e.g.,method = runif
to generate weights.addWeightsDistance
Weights correspond to a distance metric based on the node coordinates in the Euclidean plane. Internally function
dist
is called.addWeightsCorrelated
This method generates two weight matrices with correlated weights. The correlation may be adjusted by the
rho
argument. Here, the first weight of an edge is the Euclidean distance between the nodes in the plane and the second one is generated in a way, that the correlation is close torho
.addWeightsCocave
This method is interesting for generating bi-objective graphs to benchmark algorithms for the multi-criteria spanning tree problem. Graphs generated this way expose a concave Pareto-front.
Usage
addWeightsConcave(graph, xhi = 10, nu = 20, M = 100, ...)
addWeightsCorrelated(graph, rho, ...)
addWeightsDistance(graph, method, ...)
addWeightsRandom(graph, method, ...)
Arguments
graph |
[ |
xhi |
[ |
nu |
[ |
M |
[ |
... |
[any] Further arguments. Not used at the moment. This may be useful for user-written weight generators. |
rho |
[ |
method |
[ |
Value
[list
] A list with components
- weights [
list
] List of weight matrices. Even in the case of one weight matrix it is wrapped in a list of length one.
- generator [
character(1)
] String description of the generator used.
Note
These functions are not meant to be called directly. Instead, they need
to be assigned to the generator
argument of addWeights
.