68 std::function<
double(
double)>
h,
int dimension = 2) {
79 for (
int i = 0; i <
weights.size(); i++) {
80 nodes[i] = G.newNode();
81 nodeWeights[nodes[i]] =
weights[i];
87 for (
node v : nodes) {
89 double distance = 0.0;
93 distance =
sqrt(distance);
95 if ((nodeWeights[v] + nodeWeights[w]) *
h(distance) > threshold) {
Includes declaration of graph class.
The parameterized class Array implements dynamic arrays of type E.
Data type for general directed graphs (adjacency list representation).
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
node succ() const
Returns the successor in the list of all nodes.
void randomGeographicalThresholdGraph(Graph &G, Array< int > &weights, D &dist, double threshold, std::function< double(double)> h, int dimension=2)
Creates a random geometric graph where edges are created based on their distance and the weight of no...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
long unsigned int randomSeed()
Returns a random value suitable as initial seed for a random number engine.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.