Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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_d.h>
38 
39 #include <functional>
40 #include <vector>
41 
42 namespace ogdf {
43 
46 
49 
51 
58 OGDF_EXPORT void randomRegularGraph(Graph& G, int n, int d);
59 
61 
66 OGDF_EXPORT void randomGraph(Graph& G, int n, int m);
67 
69 
74 OGDF_EXPORT bool randomSimpleGraph(Graph& G, int n, int m);
75 
77 
88 OGDF_EXPORT bool randomSimpleGraphByProbability(Graph& G, int n, double pEdge);
89 
91 
96 OGDF_EXPORT bool randomSimpleConnectedGraph(Graph& G, int n, int m);
97 
99 
107 OGDF_EXPORT void randomBiconnectedGraph(Graph& G, int n, int m);
108 
110 
118 OGDF_EXPORT void randomPlanarConnectedGraph(Graph& G, int n, int m);
119 
121 
131 OGDF_EXPORT void randomPlanarBiconnectedGraph(Graph& G, int n, int m, bool multiEdges = false);
132 
134 
146 OGDF_EXPORT void randomPlanarBiconnectedDigraph(Graph& G, int n, int m, double p = 0,
147  bool multiEdges = false);
148 
150 
158 OGDF_EXPORT void randomUpwardPlanarBiconnectedDigraph(Graph& G, int n, int m);
159 
161 
169 OGDF_EXPORT void randomPlanarCNBGraph(Graph& G, int n, int m, int b);
170 
172 
199 OGDF_EXPORT void randomTriconnectedGraph(Graph& G, int n, double p1, double p2);
200 
202 
221 OGDF_EXPORT void randomPlanarTriconnectedGraph(Graph& G, int n, int m);
222 
224 
241 OGDF_EXPORT void randomPlanarTriconnectedGraph(Graph& G, int n, double p1, double p2);
242 
244 
248 OGDF_EXPORT void randomTree(Graph& G, int n);
249 
251 
258 OGDF_EXPORT void randomTree(Graph& G, int n, int maxDeg, int maxWidth);
259 
261 
266 OGDF_EXPORT void randomDigraph(Graph& G, int n, double p);
267 
269 
281 OGDF_EXPORT void randomSeriesParallelDAG(Graph& G, int edges, double p = 0.5, double flt = 0.0);
282 
286 
292 OGDF_EXPORT void randomGeometricCubeGraph(Graph& G, int nodes, double threshold, int dimension = 2);
293 
296 
313 OGDF_EXPORT void randomWaxmanGraph(Graph& G, int nodes, double alpha, double beta,
314  double width = 1.0, double height = 1.0);
315 
317 
333 OGDF_EXPORT void preferentialAttachmentGraph(Graph& G, int nodes, int minDegree);
334 
336 
352 OGDF_EXPORT void randomWattsStrogatzGraph(Graph& G, int n, int k, double probability);
353 
355 
377 OGDF_EXPORT void randomChungLuGraph(Graph& G, Array<int> expectedDegreeDistribution);
378 
380 
393 OGDF_EXPORT void randomEdgesGraph(Graph& G, std::function<double(node, node)> probability);
394 
396 
405 OGDF_EXPORT void randomProperMaximalLevelPlaneGraph(Graph& G, std::vector<std::vector<node>>& emb,
406  int N, int K, bool radial);
407 
409 
419 OGDF_EXPORT void randomHierarchy(Graph& G, int n, int m, bool planar, bool singleSource,
420  bool longEdges);
421 
423 OGDF_EXPORT void pruneEdges(Graph& G, int max_edges, int min_deg);
424 
426 
428 
429 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::randomPlanarBiconnectedGraph
void randomPlanarBiconnectedGraph(Graph &G, int n, int m, bool multiEdges=false)
Creates a random planar biconnected (embedded) graph.
ogdf::randomGraph
void randomGraph(Graph &G, int n, int m)
Creates a random graph.
ogdf::randomPlanarTriconnectedGraph
void randomPlanarTriconnectedGraph(Graph &G, int n, int m)
Creates a random planar triconnected (and simple) graph.
ogdf::randomPlanarBiconnectedDigraph
void randomPlanarBiconnectedDigraph(Graph &G, int n, int m, double p=0, bool multiEdges=false)
Creates a random planar biconnected acyclic (embedded) digraph.
ogdf::randomProperMaximalLevelPlaneGraph
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.
randomGeographicalThresholdGraph.h
Implements graph generator for random geographical threshold graphs.
ogdf::randomSimpleGraphByProbability
bool randomSimpleGraphByProbability(Graph &G, int n, double pEdge)
Creates a random simple graph.
ogdf::randomUpwardPlanarBiconnectedDigraph
void randomUpwardPlanarBiconnectedDigraph(Graph &G, int n, int m)
Creates a random upward planar biconnected (embedded) digraph.
ogdf::randomHierarchy
void randomHierarchy(Graph &G, int n, int m, bool planar, bool singleSource, bool longEdges)
Creates a random hierarchical graph.
ogdf::randomSimpleConnectedGraph
bool randomSimpleConnectedGraph(Graph &G, int n, int m)
Creates a random simple and connected graph.
ogdf::randomBiconnectedGraph
void randomBiconnectedGraph(Graph &G, int n, int m)
Creates a random biconnected graph.
ogdf::randomWattsStrogatzGraph
void randomWattsStrogatzGraph(Graph &G, int n, int k, double probability)
Creates a "small world" graph as described by Watts & Strogatz.
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:63
ogdf::randomEdgesGraph
void randomEdgesGraph(Graph &G, std::function< double(node, node)> probability)
Inserts edges into the given graph based on probabilities given by a callback function.
ogdf::preferentialAttachmentGraph
void preferentialAttachmentGraph(Graph &G, int nodes, int minDegree)
Creates a graph where new nodes are more likely to connect to nodes with high degree.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::randomGeometricCubeGraph
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...
config.h
Basic configuration file.
ogdf::randomWaxmanGraph
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...
ogdf::randomChungLuGraph
void randomChungLuGraph(Graph &G, Array< int > expectedDegreeDistribution)
Creates a graph where edges are inserted based on given weights.
ogdf::pruneEdges
void pruneEdges(Graph &G, int max_edges, int min_deg)
Removed random edges from /p G until it has less than /p max_edges edges, not removing edges from nod...
Graph_d.h
Pure declaration header, find template implementation in Graph.h.
ogdf::randomTriconnectedGraph
void randomTriconnectedGraph(Graph &G, int n, double p1, double p2)
Creates a random triconnected (and simple) graph.
ogdf::randomRegularGraph
void randomRegularGraph(Graph &G, int n, int d)
Creates a random d-regular graph.
ogdf::randomDigraph
void randomDigraph(Graph &G, int n, double p)
Creates a random (simple) directed graph.
ogdf::randomPlanarCNBGraph
void randomPlanarCNBGraph(Graph &G, int n, int m, int b)
Creates a random planar graph, that is connected, but not biconnected.
ogdf::randomSimpleGraph
bool randomSimpleGraph(Graph &G, int n, int m)
Creates a random simple graph.
ogdf::randomPlanarConnectedGraph
void randomPlanarConnectedGraph(Graph &G, int n, int m)
Creates a random connected (simple) planar (embedded) graph.
ogdf::randomTree
void randomTree(Graph &G, int n)
Creates a random tree (simpler version.
ogdf::randomSeriesParallelDAG
void randomSeriesParallelDAG(Graph &G, int edges, double p=0.5, double flt=0.0)
Creates a random (simple, biconnected) series parallel DAG.