Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
randomized.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Array.h>
35#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/basic.h>
37#include <ogdf/basic/graph_generators/clustering.h> // IWYU pragma: keep
39#include <ogdf/cluster/ClusterGraph.h> // IWYU pragma: keep
40
41#include <functional>
42#include <vector>
43
44namespace ogdf {
45
48
51
53
60OGDF_EXPORT void randomRegularGraph(Graph& G, int n, int d);
61
63
68OGDF_EXPORT void randomGraph(Graph& G, int n, int m);
69
71
76OGDF_EXPORT bool randomSimpleGraph(Graph& G, int n, int m);
77
79
90OGDF_EXPORT bool randomSimpleGraphByProbability(Graph& G, int n, double pEdge);
91
93
99
101
110
112
121
123
133OGDF_EXPORT void randomPlanarBiconnectedGraph(Graph& G, int n, int m, bool multiEdges = false);
134
136
148OGDF_EXPORT void randomPlanarBiconnectedDigraph(Graph& G, int n, int m, double p = 0,
149 bool multiEdges = false);
150
152
161
163
171OGDF_EXPORT void randomPlanarCNBGraph(Graph& G, int n, int m, int b);
172
174
201OGDF_EXPORT void randomTriconnectedGraph(Graph& G, int n, double p1, double p2);
202
204
224
226
243OGDF_EXPORT void randomPlanarTriconnectedGraph(Graph& G, int n, double p1, double p2);
244
246
251
253
260OGDF_EXPORT void randomTree(Graph& G, int n, int maxDeg, int maxWidth);
261
263
268OGDF_EXPORT void randomDigraph(Graph& G, int n, double p);
269
271
283OGDF_EXPORT void randomSeriesParallelDAG(Graph& G, int edges, double p = 0.5, double flt = 0.0);
284
288
294OGDF_EXPORT void randomGeometricCubeGraph(Graph& G, int nodes, double threshold, int dimension = 2);
295
298
315OGDF_EXPORT void randomWaxmanGraph(Graph& G, int nodes, double alpha, double beta,
316 double width = 1.0, double height = 1.0);
317
319
335OGDF_EXPORT void preferentialAttachmentGraph(Graph& G, int nodes, int minDegree);
336
338
354OGDF_EXPORT void randomWattsStrogatzGraph(Graph& G, int n, int k, double probability);
355
357
379OGDF_EXPORT void randomChungLuGraph(Graph& G, Array<int> expectedDegreeDistribution);
380
382
395OGDF_EXPORT void randomEdgesGraph(Graph& G, std::function<double(node, node)> probability);
396
398
407OGDF_EXPORT void randomProperMaximalLevelPlaneGraph(Graph& G, std::vector<std::vector<node>>& emb,
408 int N, int K, bool radial);
409
411
421OGDF_EXPORT void randomHierarchy(Graph& G, int n, int m, bool planar, bool singleSource,
422 bool longEdges);
423
425OGDF_EXPORT void pruneEdges(Graph& G, int max_edges, int min_deg);
426
428
430
431}
Declaration and implementation of Array class and Array algorithms.
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Includes declaration of graph class.
Basic declarations, included by all source files.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Class for the representation of nodes.
Definition Graph_d.h:241
Declaration of randomized clustering generators.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
bool randomSimpleGraphByProbability(Graph &G, int n, double pEdge)
Creates a random simple graph.
void randomGraph(Graph &G, int n, int m)
Creates a random graph.
void randomUpwardPlanarBiconnectedDigraph(Graph &G, int n, int m)
Creates a random upward planar biconnected (embedded) digraph.
void randomPlanarBiconnectedDigraph(Graph &G, int n, int m, double p=0, bool multiEdges=false)
Creates a random planar biconnected acyclic (embedded) digraph.
void randomWaxmanGraph(Graph &G, int nodes, double alpha, double beta, double width=1.0, double height=1.0)
Generates a Waxman graph where nodes are uniformly randomly placed in a grid, then edges are inserted...
void randomChungLuGraph(Graph &G, Array< int > expectedDegreeDistribution)
Creates a graph where edges are inserted based on given weights.
void randomRegularGraph(Graph &G, int n, int d)
Creates a random d-regular graph.
void randomPlanarTriconnectedGraph(Graph &G, int n, int m)
Creates a random planar triconnected (and simple) graph.
void preferentialAttachmentGraph(Graph &G, int nodes, int minDegree)
Creates a graph where new nodes are more likely to connect to nodes with high degree.
bool randomSimpleConnectedGraph(Graph &G, int n, int m)
Creates a random simple and connected graph.
void randomTree(Graph &G, int n)
Creates a random tree (simpler version.
void pruneEdges(Graph &G, int max_edges, int min_deg)
Remove random edges from /p G until it has less than /p max_edges edges, not removing edges from node...
void randomGeometricCubeGraph(Graph &G, int nodes, double threshold, int dimension=2)
Creates a random geometric graph by laying out nodes in a unit n-cube. Nodes with a distance < thresh...
void randomHierarchy(Graph &G, int n, int m, bool planar, bool singleSource, bool longEdges)
Creates a random hierarchical graph.
void randomSeriesParallelDAG(Graph &G, int edges, double p=0.5, double flt=0.0)
Creates a random (simple, biconnected) series parallel DAG.
void randomWattsStrogatzGraph(Graph &G, int n, int k, double probability)
Creates a "small world" graph as described by Watts & Strogatz.
void randomDigraph(Graph &G, int n, double p)
Creates a random (simple) directed graph.
void randomEdgesGraph(Graph &G, std::function< double(node, node)> probability)
Inserts edges into the given graph based on probabilities given by a callback function.
bool randomSimpleGraph(Graph &G, int n, int m)
Creates a random simple graph.
void randomPlanarBiconnectedGraph(Graph &G, int n, int m, bool multiEdges=false)
Creates a random planar biconnected (embedded) graph.
void randomTriconnectedGraph(Graph &G, int n, double p1, double p2)
Creates a random triconnected (and simple) graph.
void randomPlanarCNBGraph(Graph &G, int n, int m, int b)
Creates a random planar graph, that is connected, but not biconnected.
void randomBiconnectedGraph(Graph &G, int n, int m)
Creates a random biconnected graph.
void randomPlanarConnectedGraph(Graph &G, int n, int m)
Creates a random connected (simple) planar (embedded) graph.
void randomProperMaximalLevelPlaneGraph(Graph &G, std::vector< std::vector< node > > &emb, int N, int K, bool radial)
Generates a random proper, maximal (radial) level-plane graph.
The namespace for all OGDF objects.
Implements graph generator for random geographical threshold graphs.