Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

clustering.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
36 
37 #include <cstdint>
38 #include <iosfwd>
39 
40 namespace ogdf {
41 
42 class ClusterGraph;
43 
44 namespace sync_plan {
45 class SyncPlan;
46 }
47 
50 
53 
55 
63 
65 
70 OGDF_EXPORT void randomClustering(ClusterGraph& C, int cNum);
71 
73 
86 OGDF_EXPORT void randomClustering(ClusterGraph& C, const node root, int moreInLeaves);
87 
91  int max_nodes_in_cluster = 0;
93  double prob_no_further_node = 0.1;
95  double prob_no_further_cluster = 0.0;
97  int max_clusters = 0;
99  int min_root_nodes = 0;
101  bool cconnected = false;
103  int timeout = 0;
104 
106  double expected_nodes() const { return 1.0 / prob_no_further_node; }
107 
109  void expected_nodes(double n) { prob_no_further_node = 1.0 / n; }
110 
111  friend std::ostream& operator<<(std::ostream& os, const RandomClusterConfig& config);
112 };
113 
115 
130 OGDF_EXPORT bool randomPlanarClustering(ClusterGraph& CG, const RandomClusterConfig& config);
131 
133 
146 OGDF_EXPORT void randomClusterPlanarGraph(Graph& G, ClusterGraph& CG, int clusters,
147  int node_per_cluster, int edges_per_cluster);
148 
150 OGDF_EXPORT void randomSyncPlanInstance(sync_plan::SyncPlan& pq, int pipe_count, int min_deg = 3);
151 
153 
163 OGDF_EXPORT void randomSEFEInstanceBySharedGraph(Graph* sefe, EdgeArray<uint8_t>& edge_types,
164  int edges1, int edges2);
165 
167 
175 OGDF_EXPORT void randomSEFEInstanceByUnionGraph(const Graph* sefe, EdgeArray<uint8_t>& edge_types,
176  double frac_shared = 0.34, double frac_g1 = 0.33);
177 
180 
181 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::randomCConnectedClustering
void randomCConnectedClustering(ClusterGraph &C, int cNum)
Creates a random c-connected clustering for a given graph G.
Graph.h
Includes declaration of graph class.
ogdf::RandomClusterConfig
Parameters for the randomPlanarClustering() method.
Definition: clustering.h:89
ogdf::RandomClusterConfig::expected_nodes
double expected_nodes() const
Get the expected number of nodes per cluster, i.e., 1.0 / prob_no_further_node.
Definition: clustering.h:106
ogdf::randomClusterPlanarGraph
void randomClusterPlanarGraph(Graph &G, ClusterGraph &CG, int clusters, int node_per_cluster, int edges_per_cluster)
Create a random planar graph with a c-planar clustering.
ogdf::randomPlanarClustering
bool randomPlanarClustering(ClusterGraph &CG, const RandomClusterConfig &config)
Creates a random c-planar clustering for a given planar graph G.
ogdf::sync_plan::SyncPlan
A class for modelling and solving Synchronized Planarity instances.
Definition: SyncPlan.h:123
ogdf::operator<<
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
Definition: Array.h:978
ogdf::randomSEFEInstanceBySharedGraph
void randomSEFEInstanceBySharedGraph(Graph *sefe, EdgeArray< uint8_t > &edge_types, int edges1, int edges2)
Create a (simultaneously planar) 2-SEFE instance with a given shared graph.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
config.h
Basic configuration file.
ogdf::randomSyncPlanInstance
void randomSyncPlanInstance(sync_plan::SyncPlan &pq, int pipe_count, int min_deg=3)
Create a random SynchronizedPlanarity instance by introducing pipe_count pipes between vertices of de...
ogdf::randomSEFEInstanceByUnionGraph
void randomSEFEInstanceByUnionGraph(const Graph *sefe, EdgeArray< uint8_t > &edge_types, double frac_shared=0.34, double frac_g1=0.33)
Create a (simultaneously planar) 2-SEFE instance with a given union graph.
ogdf::RandomClusterConfig::expected_nodes
void expected_nodes(double n)
Set the expected number of nodes per cluster, i.e., prob_no_further_node = 1.0 / n.
Definition: clustering.h:109
ogdf::randomClustering
void randomClustering(ClusterGraph &C, int cNum)
Creates a random clustering for a given graph G.
ogdf::ClusterGraph
Representation of clustered graphs.
Definition: ClusterGraph.h:339
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233