Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Multilevel.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/geometry.h>
38 
39 namespace ogdf::energybased::fmmm {
40 class EdgeAttributes;
41 class NodeAttributes;
42 } // namespace ogdf::energybased::fmmm
43 
44 namespace ogdf {
45 template<class E>
46 class List;
47 
48 namespace energybased {
49 namespace fmmm {
50 
51 class Multilevel {
52 public:
56  EdgeArray<EdgeAttributes>& E, int rand_seed, FMMMOptions::GalaxyChoice galaxy_choice,
57  int min_Graph_size, int rand_tries, Array<Graph*>& G_mult_ptr,
58  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
59  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, int& max_level);
60 
65  void find_initial_placement_for_level(int level,
66  FMMMOptions::InitialPlacementMult init_placement_way, Array<Graph*>& G_mult_ptr,
67  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
68  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr);
69 
72  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
73  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, int max_level);
74 
75 private:
81  bool edgenumbersum_of_all_levels_is_linear(Array<Graph*>& G_mult_ptr, int act_level,
82  int& bad_edgenr_counter);
83 
85  void init_multilevel_values(const Graph& G_mult, NodeArray<NodeAttributes>& A_mult,
87 
96  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
97  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, int rand_seed,
98  FMMMOptions::GalaxyChoice galaxy_choice, int random_tries, int act_level);
99 
102  void create_suns_and_planets(Array<Graph*>& G_mult_ptr,
103  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
104  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, int rand_seed,
105  FMMMOptions::GalaxyChoice galaxy_choice, int random_tries, int act_level);
106 
111  EdgeArray<EdgeAttributes>& E_mult);
112 
117  void collaps_solar_systems(Array<Graph*>& G_mult_ptr,
118  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
119  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, int act_level);
120 
124  Array<NodeArray<NodeAttributes>*>& A_mult_ptr, int act_level);
125 
129  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
130  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, EdgeArray<double>& new_edgelength,
131  int act_level);
132 
136  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, EdgeArray<double>& new_edgelength,
137  int act_level);
138 
140  void set_initial_positions_of_sun_nodes(int level, Array<Graph*>& G_mult_ptr,
141  Array<NodeArray<NodeAttributes>*>& A_mult_ptr);
142 
146  FMMMOptions::InitialPlacementMult init_placement_way, Array<Graph*>& G_mult_ptr,
147  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
148  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, List<node>& pm_nodes);
149 
154  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
155  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, int level);
156 
159  void set_initial_positions_of_pm_nodes(int level,
160  FMMMOptions::InitialPlacementMult init_placement_way,
161  Array<NodeArray<NodeAttributes>*>& A_mult_ptr,
162  Array<EdgeArray<EdgeAttributes>*>& E_mult_ptr, List<node>& pm_nodes);
163 
165  DPoint create_random_pos(DPoint center, double radius, double angle_1, double angle_2);
166 
168  DPoint get_waggled_inbetween_position(DPoint s, DPoint t, double lambda);
169 
173 
176  DPoint calculate_position(DPoint P, DPoint Q, double dist_P, double dist_Q);
177 };
178 
179 }
180 }
181 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::energybased::fmmm
Definition: common.h:43
ogdf::FMMMOptions::GalaxyChoice
GalaxyChoice
Specifies how sun nodes of galaxies are selected.
Definition: FMMMOptions.h:87
ogdf::whaType::A
@ A
ogdf::energybased::fmmm::Multilevel::find_initial_placement_for_level
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 ...
ogdf::energybased::fmmm::Multilevel::delete_multilevel_representations
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.
ogdf::energybased::fmmm::Multilevel
Definition: Multilevel.h:51
ogdf::FMMMOptions::InitialPlacementMult
InitialPlacementMult
Specifies how the initial placement is generated.
Definition: FMMMOptions.h:102
ogdf::energybased::fmmm::Multilevel::delete_parallel_edges_and_update_edgelength
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...
ogdf::energybased::fmmm::Multilevel::create_edges_edgedistances_and_lambda_Lists
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...
ogdf::energybased::fmmm::Multilevel::edgenumbersum_of_all_levels_is_linear
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 ...
ogdf::energybased::fmmm::Multilevel::get_barycenter_position
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).
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
ogdf::energybased::fmmm::Multilevel::set_initial_positions_of_planet_and_moon_nodes
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...
ogdf::energybased::fmmm::Multilevel::collaps_solar_systems
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_...
ogdf::energybased::fmmm::Multilevel::set_initial_positions_of_pm_nodes
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...
ogdf::energybased::fmmm::Multilevel::create_multilevel_representations
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....
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::energybased::fmmm::Multilevel::init_multilevel_values
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.
ogdf::energybased::fmmm::Multilevel::create_all_placement_sectors
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 ...
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::energybased::fmmm::Multilevel::create_random_pos
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.
ogdf::energybased::fmmm::Multilevel::calculate_mass_of_collapsed_nodes
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 ...
ogdf::energybased::fmmm::Multilevel::get_waggled_inbetween_position
DPoint get_waggled_inbetween_position(DPoint s, DPoint t, double lambda)
Returns roughtly the position s +lambda*(t-s) + some random waggling.
ogdf::energybased::fmmm::Multilevel::set_initial_positions_of_sun_nodes
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.
ogdf::energybased::fmmm::Multilevel::create_moon_nodes_and_pm_nodes
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 ...
ogdf::energybased::fmmm::Multilevel::partition_galaxy_into_solar_systems
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,...
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::energybased::fmmm::Multilevel::calculate_position
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...
ogdf::energybased::fmmm::Multilevel::create_suns_and_planets
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...
FMMMOptions.h
Declaration of Fast Multipole Multilevel Method (FM^3) options.