Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

Multilevel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/NodeArray.h>
36 #include <ogdf/basic/EdgeArray.h>
37 #include <ogdf/basic/List.h>
42 
43 namespace ogdf {
44 namespace energybased {
45 namespace fmmm {
46 
48 {
49 public:
54  int rand_seed,
55  FMMMOptions::GalaxyChoice galaxy_choice,
56  int min_Graph_size,
57  int rand_tries,
58  Array<Graph*> &G_mult_ptr,
59  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
60  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
61  int & max_level);
62 
68  int level,
69  FMMMOptions::InitialPlacementMult init_placement_way,
70  Array<Graph*> &G_mult_ptr,
71  Array<NodeArray <NodeAttributes>*> &A_mult_ptr,
72  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr);
73 
76  Array<Graph*> &G_mult_ptr,
77  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
78  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
79  int max_level);
80 
81 private:
82 
89  Array<Graph*> &G_mult_ptr,
90  int act_level,
91  int&bad_edgenr_counter);
92 
94  void init_multilevel_values(const Graph &G_mult,
97 
106  Array<Graph*> &G_mult_ptr,
107  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
108  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
109  int rand_seed,
110  FMMMOptions::GalaxyChoice galaxy_choice,
111  int random_tries,
112  int act_level);
113 
117  Array<Graph*> &G_mult_ptr,
118  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
119  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
120  int rand_seed,
121  FMMMOptions::GalaxyChoice galaxy_choice,
122  int random_tries,
123  int act_level);
124 
128  void create_moon_nodes_and_pm_nodes(const Graph &G_mult,
130  EdgeArray<EdgeAttributes> &E_mult);
131 
137  Array<Graph*> &G_mult_ptr,
138  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
139  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
140  int act_level);
141 
145  Array<Graph*> &G_mult_ptr,
146  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
147  int act_level);
148 
152  Array<Graph*> &G_mult_ptr,
153  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
154  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
155  EdgeArray<double>& new_edgelength,
156  int act_level);
157 
161  Array<Graph*> &G_mult_ptr,
162  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
163  EdgeArray<double>& new_edgelength,
164  int act_level);
165 
168  int level,
169  Array<Graph*> &G_mult_ptr,
170  Array<NodeArray<NodeAttributes>*> &A_mult_ptr);
171 
175  int level,
176  FMMMOptions::InitialPlacementMult init_placement_way,
177  Array<Graph*> &G_mult_ptr,
178  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
179  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
180  List<node> &pm_nodes);
181 
186  Array<Graph*> &G_mult_ptr,
187  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
188  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
189  int level);
190 
194  int level,
195  FMMMOptions::InitialPlacementMult init_placement_way,
196  Array<NodeArray<NodeAttributes>*> &A_mult_ptr,
197  Array<EdgeArray<EdgeAttributes>*> &E_mult_ptr,
198  List<node>& pm_nodes);
199 
201  DPoint create_random_pos(DPoint center, double radius, double angle_1, double angle_2);
202 
204  DPoint get_waggled_inbetween_position(DPoint s, DPoint t, double lambda);
205 
209 
212  DPoint calculate_position(DPoint P,DPoint Q, double dist_P, double dist_Q);
213 };
214 
215 }
216 }
217 }
void delete_multilevel_representations(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, int max_level)
Free dynamically allocated memory.
DPoint calculate_position(DPoint P, DPoint Q, double dist_P, double dist_Q)
Creates a waggled position on the line PQ, depending on dist_P and dist_Q needed in case init_placeme...
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
void collaps_solar_systems(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, int act_level)
Using information generated in partition_galaxy_into_solar_systems we create the edge set of *G_mult_...
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
bool edgenumbersum_of_all_levels_is_linear(Array< Graph *> &G_mult_ptr, int act_level, int &bad_edgenr_counter)
This function returns true if act_level = 0 or if act_level >0 and the number of edges at the actual ...
DPoint get_barycenter_position(List< DPoint > &L)
Returns the barycenter position of all points in L (the mass of all point is regarded as equal)...
void calculate_mass_of_collapsed_nodes(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, int act_level)
The mass of all nodes at level act_level+1 is set to the mass of its dedicated solar_system at level ...
DPoint create_random_pos(DPoint center, double radius, double angle_1, double angle_2)
Returns a random point with radius radius between angle_1 and angle_2.
void create_edges_edgedistances_and_lambda_Lists(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, EdgeArray< double > &new_edgelength, int act_level)
The edges , new_edgelength and the lambda lists at level act_level+1 are created (the graph may conta...
void delete_parallel_edges_and_update_edgelength(Array< Graph *> &G_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, EdgeArray< double > &new_edgelength, int act_level)
Parallel edges at level act_level+1 are deleted and the edgelength of the remaining edge is set to th...
void create_all_placement_sectors(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, int level)
The values of angle_1 and angle_2 that restrict the area of the placement for all nodes that are not ...
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
GalaxyChoice
Specifies how sun nodes of galaxies are selected.
Definition: FMMMOptions.h:87
void set_initial_positions_of_pm_nodes(int level, FMMMOptions::InitialPlacementMult init_placement_way, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, List< node > &pm_nodes)
The initial positions of the pm nodes are calculated by the position of the dedicated sun and moon_no...
void create_moon_nodes_and_pm_nodes(const Graph &G_mult, NodeArray< NodeAttributes > &A_mult, EdgeArray< EdgeAttributes > &E_mult)
Partitions the nodes of G_mult that have not been assigned yet, to moon nodes of a nearest planet or ...
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
void find_initial_placement_for_level(int level, FMMMOptions::InitialPlacementMult init_placement_way, Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr)
The initial placement of the nodes at multilevel level are created by the placements of the nodes of ...
Declaration of Fast Multipole Multilevel Method (FM^3) options.
Declaration and implementation of EdgeArray class.
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
Declaration of class EdgeAttributes.
Declaration and implementation of NodeArray class.
void set_initial_positions_of_sun_nodes(int level, Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr)
The initial positions of all sun_nodes at level level are set.
Declaration of class Edge.
Declaration of class NodeAttributes.
void init_multilevel_values(const Graph &G_mult, NodeArray< NodeAttributes > &A_mult, EdgeArray< EdgeAttributes > &E_mult)
Sets the default multilevel values for all nodes and edges in G_mult.
Includes declaration of graph class.
DPoint get_waggled_inbetween_position(DPoint s, DPoint t, double lambda)
Returns roughtly the position s +lambda*(t-s) + some random waggling.
void set_initial_positions_of_planet_and_moon_nodes(int level, FMMMOptions::InitialPlacementMult init_placement_way, Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, List< node > &pm_nodes)
The initial positions of the planet/moon_nodes at level level are calculated here and a list of all p...
void create_suns_and_planets(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, int rand_seed, FMMMOptions::GalaxyChoice galaxy_choice, int random_tries, int act_level)
The sun and planet nodes are created by choosing the sun nodes randomly with uniform or weighted prob...
The namespace for all OGDF objects.
InitialPlacementMult
Specifies how the initial placement is generated.
Definition: FMMMOptions.h:101
void partition_galaxy_into_solar_systems(Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, int rand_seed, FMMMOptions::GalaxyChoice galaxy_choice, int random_tries, int act_level)
The nodeset(galaxy) of *G_mult_ptr[act_level] is partitioned in s,p,pm,m nodes. The dedicated s...
void create_multilevel_representations(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E, int rand_seed, FMMMOptions::GalaxyChoice galaxy_choice, int min_Graph_size, int rand_tries, Array< Graph *> &G_mult_ptr, Array< NodeArray< NodeAttributes > *> &A_mult_ptr, Array< EdgeArray< EdgeAttributes > *> &E_mult_ptr, int &max_level)
The multilevel representations *G_mult_ptr/*A_mult_ptr/*E_mult_ptr for G/A/E are created. The maximum multilevel is calculated, too.
Declaration of doubly linked lists and iterators.