Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

FMMMLayout.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/geometry.h>
40 
41 namespace ogdf {
42 
233 {
237 
238 public:
240  FMMMLayout();
241 
242  // destructor
243  virtual ~FMMMLayout() { }
244 
245 
251  virtual void call(GraphAttributes &GA) override;
253 
257  void call(ClusterGraphAttributes &GA);
258 
260 
265  void call(
266  GraphAttributes &GA, //graph and layout
267  const EdgeArray<double> &edgeLength); //factor for desired edge lengths
268 
270 
274  void call(GraphAttributes &GA, char* ps_file);
275 
277 
283  void call(
284  GraphAttributes &GA, //graph and layout
285  const EdgeArray<double> &edgeLength, //factor for desired edge lengths
286  char* ps_file);
287 
293  double getCpuTime() {
295  return time_total;
296  }
297 
298 
305 
311  bool useHighLevelOptions() const { return m_useHighLevelOptions; }
312 
314  void useHighLevelOptions(bool uho) { m_useHighLevelOptions = uho; }
315 
317  void setSingleLevel(bool b) {m_singleLevel = b;}
318 
320  FMMMOptions::PageFormatType pageFormat() const { return m_pageFormat; }
321 
323  void pageFormat(FMMMOptions::PageFormatType t) { m_pageFormat = t; }
324 
326  double unitEdgeLength() const { return m_unitEdgeLength; }
327 
329  void unitEdgeLength(double x) {m_unitEdgeLength = (( x > 0.0) ? x : 1);}
330 
332 
337  bool newInitialPlacement() const { return m_newInitialPlacement; }
338 
340  void newInitialPlacement(bool nip) { m_newInitialPlacement = nip; }
341 
343  FMMMOptions::QualityVsSpeed qualityVersusSpeed() const { return m_qualityVersusSpeed; }
344 
346  void qualityVersusSpeed(FMMMOptions::QualityVsSpeed qvs) {m_qualityVersusSpeed = qvs; }
347 
348 
356  void randSeed(int p) { m_randSeed = ((0<=p) ? p : 1);}
358 
360  int randSeed() const {return m_randSeed;}
361 
364  return m_edgeLengthMeasurement;
365  }
366 
368  void edgeLengthMeasurement(FMMMOptions::EdgeLengthMeasurement elm) { m_edgeLengthMeasurement = elm; }
369 
371  FMMMOptions::AllowedPositions allowedPositions() const { return m_allowedPositions; }
372 
374  void allowedPositions(FMMMOptions::AllowedPositions ap) { m_allowedPositions = ap; }
375 
377 
380  int maxIntPosExponent() const { return m_maxIntPosExponent; }
381 
383  void maxIntPosExponent(int e) {
384  m_maxIntPosExponent = (((e >= 31)&&(e<=51))? e : 31);
385  }
386 
387 
393 
397  double pageRatio() const { return m_pageRatio; }
398 
400  void pageRatio(double r) {m_pageRatio = (( r > 0) ? r : 1);}
401 
403 
407  int stepsForRotatingComponents() const { return m_stepsForRotatingComponents; }
408 
411  m_stepsForRotatingComponents = ((0<=n) ? n : 0);
412  }
413 
415  FMMMOptions::TipOver tipOverCCs() const { return m_tipOverCCs; }
416 
418  void tipOverCCs(FMMMOptions::TipOver to) { m_tipOverCCs = to; }
419 
421  double minDistCC() const { return m_minDistCC; }
422 
424  void minDistCC(double x) { m_minDistCC = (( x > 0) ? x : 1);}
425 
427  FMMMOptions::PreSort presortCCs() const { return m_presortCCs; }
428 
430  void presortCCs(FMMMOptions::PreSort ps) { m_presortCCs = ps; }
431 
432 
438 
444  int minGraphSize() const { return m_minGraphSize; }
445 
447  void minGraphSize(int n) { m_minGraphSize = ((n >= 2)? n : 2);}
448 
450  FMMMOptions::GalaxyChoice galaxyChoice() const { return m_galaxyChoice; }
451 
453  void galaxyChoice(FMMMOptions::GalaxyChoice gc) { m_galaxyChoice = gc; }
454 
456 
461  int randomTries() const { return m_randomTries; }
462 
464  void randomTries(int n) {m_randomTries = ((n>=1)? n: 1);}
465 
467  FMMMOptions::MaxIterChange maxIterChange() const { return m_maxIterChange; }
468 
470  void maxIterChange(FMMMOptions::MaxIterChange mic) { m_maxIterChange = mic; }
471 
473 
478  int maxIterFactor() const { return m_maxIterFactor; }
479 
481  void maxIterFactor(int f) { m_maxIterFactor = ((f>=1) ? f : 1 ); }
482 
485  return m_initialPlacementMult;
486  }
487 
490  m_initialPlacementMult = ipm;
491  }
492 
493 
499  FMMMOptions::ForceModel forceModel() const { return m_forceModel; }
501 
503  void forceModel(FMMMOptions::ForceModel fm) { m_forceModel = fm; }
504 
506  double springStrength() const { return m_springStrength; }
507 
509  void springStrength(double x) { m_springStrength = ((x > 0)? x : 1);}
510 
512  double repForcesStrength() const { return m_repForcesStrength; }
513 
515  void repForcesStrength(double x) { m_repForcesStrength =((x > 0)? x : 1);}
516 
519  return m_repulsiveForcesCalculation;
520  }
521 
524  m_repulsiveForcesCalculation = rfc;
525  }
526 
528  FMMMOptions::StopCriterion stopCriterion() const { return m_stopCriterion; }
529 
531  void stopCriterion(FMMMOptions::StopCriterion rsc) { m_stopCriterion = rsc; }
532 
534 
538  double threshold() const { return m_threshold; }
539 
541  void threshold(double x) {m_threshold = ((x > 0) ? x : 0.1);}
542 
544  int fixedIterations() const { return m_fixedIterations; }
545 
547  void fixedIterations(int n) { m_fixedIterations = ((n >= 1) ? n : 1);}
548 
550  double forceScalingFactor() const { return m_forceScalingFactor; }
551 
553  void forceScalingFactor(double f) { m_forceScalingFactor = ((f > 0) ? f : 1);}
554 
556 
560  bool coolTemperature() const { return m_coolTemperature; }
561 
563  void coolTemperature(bool b) { m_coolTemperature = b; }
564 
566 
570  double coolValue() const { return m_coolValue; }
571 
573  void coolValue(double x) { m_coolValue = (((x >0 )&&(x<=1) )? x : 0.99);}
574 
575 
578  return m_initialPlacementForces;
579  }
580 
583  m_initialPlacementForces = ipf;
584  }
585 
586 
592 
597  bool resizeDrawing() const { return m_resizeDrawing; }
598 
600  void resizeDrawing(bool b) { m_resizeDrawing = b; }
601 
603 
607  double resizingScalar() const { return m_resizingScalar; }
608 
610  void resizingScalar(double s) { m_resizingScalar = ((s > 0) ? s : 1);}
611 
613  int fineTuningIterations() const { return m_fineTuningIterations; }
614 
616  void fineTuningIterations(int n) { m_fineTuningIterations =((n >= 0) ? n : 0);}
617 
619 
623  double fineTuneScalar() const { return m_fineTuneScalar; }
624 
626  void fineTuneScalar(double s) { m_fineTuneScalar = ((s >= 0) ? s : 1);}
627 
629 
635  return m_adjustPostRepStrengthDynamically;
636  }
637 
640  m_adjustPostRepStrengthDynamically = b;
641  }
642 
644  double postSpringStrength() const { return m_postSpringStrength; }
645 
647  void postSpringStrength(double x) { m_postSpringStrength = ((x > 0)? x : 1);}
648 
650  double postStrengthOfRepForces() const { return m_postStrengthOfRepForces; }
651 
653  void postStrengthOfRepForces(double x) {
654  m_postStrengthOfRepForces = ((x > 0)? x : 1);
655  }
656 
657 
663 
668  int frGridQuotient() const {return m_frGridQuotient;}
669 
671  void frGridQuotient(int p) { m_frGridQuotient = ((0<=p) ? p : 2);}
672 
674  FMMMOptions::ReducedTreeConstruction nmTreeConstruction() const { return m_NMTreeConstruction; }
675 
677  void nmTreeConstruction(FMMMOptions::ReducedTreeConstruction rtc) { m_NMTreeConstruction = rtc; }
678 
680  FMMMOptions::SmallestCellFinding nmSmallCell() const { return m_NMSmallCell; }
681 
683  void nmSmallCell(FMMMOptions::SmallestCellFinding scf) { m_NMSmallCell = scf; }
684 
686 
690  int nmParticlesInLeaves() const { return m_NMParticlesInLeaves; }
691 
693  void nmParticlesInLeaves(int n) { m_NMParticlesInLeaves = ((n>= 1)? n : 1);}
694 
696  int nmPrecision() const { return m_NMPrecision; }
697 
699  void nmPrecision(int p) { m_NMPrecision = ((p >= 1 ) ? p : 1);}
700 
702 
703 private:
704 
705  //high level options
711 
712  //low level options
713  //general options
718 
719  //options for divide et impera step
720  double m_pageRatio;
723  double m_minDistCC;
725 
726  //options for multilevel step
731 
737 
740 
741  //options for force calculation step
747  double m_threshold;
751  double m_coolValue;
753 
754  //options for postprocessing step
762 
763  //options for repulsive force approximation methods
769 
770  //other variables
772  double cool_factor;
774  double boxlength;
778  double time_total;
779 
782 
785 
787  void call_DIVIDE_ET_IMPERA_step(
788  Graph& G,
791 
793  void call_MULTILEVEL_step_for_subGraph(
794  Graph& G,
797 
799  bool running(int iter, int max_mult_iter, double actforcevectorlength);
800 
802 
807  void call_FORCE_CALCULATION_step (
808  Graph& G,
811  int act_level,
812  int max_level);
813 
815  void call_POSTPROCESSING_step(
816  Graph& G,
820  NodeArray<DPoint>& F_attr,
821  NodeArray<DPoint>& F_rep,
822  NodeArray<DPoint>& last_node_movement);
823 
827 
829  void initialize_all_options();
830 
832  void update_low_level_options_due_to_high_level_options_settings();
833 
835  void import_NodeAttributes(
836  const Graph& G,
837  GraphAttributes& GA,
839 
841  void import_EdgeAttributes (
842  const Graph& G,
843  const EdgeArray<double>& edgeLength,
845 
847  void init_ind_ideal_edgelength(
848  const Graph& G,
851 
853  void set_radii(const Graph& G,NodeArray<NodeAttributes>& A);
854 
856  void export_NodeAttributes(
857  Graph& G_reduced,
858  NodeArray<NodeAttributes>& A_reduced,
859  GraphAttributes& GA);
860 
862 
867  void make_simple_loopfree(
868  const Graph& G,
871  Graph& G_reduced,
872  NodeArray<NodeAttributes>& A_reduced,
873  EdgeArray<EdgeAttributes>& E_reduced);
874 
876 
880  void delete_parallel_edges(
881  const Graph& G,
883  Graph& G_reduced,
884  List<edge>& S,
885  EdgeArray<double>& new_edgelength);
886 
888 
891  void update_edgelength(
892  List<edge>& S,
893  EdgeArray <double>& new_edgelength,
894  EdgeArray<EdgeAttributes>& E_reduced);
895 
897 
901  return min(0.2,400.0/double(n));
902  }
903 
909  void adjust_positions(const Graph& G, NodeArray<NodeAttributes>& A);
910 
912  void create_postscript_drawing(GraphAttributes& GA, char* ps_file);
913 
917 
919 
923  void create_maximum_connected_subGraphs(
924  Graph& G,
927  Graph G_sub[],
930  NodeArray<int>& component);
931 
933 
937  void pack_subGraph_drawings(
939  Graph G_sub[],
940  NodeArray<NodeAttributes> A_sub[]);
941 
943  void calculate_bounding_rectangles_of_components(
944  List<Rectangle>& R,
945  Graph G_sub[],
946  NodeArray<NodeAttributes> A_sub[]);
947 
949  Rectangle calculate_bounding_rectangle(
950  Graph& G,
952  int componenet_index);
953 
960  void rotate_components_and_calculate_bounding_rectangles(
961  List<Rectangle>&R,
962  Graph G_sub[],
963  NodeArray<NodeAttributes> A_sub[]);
964 
969  double calculate_area(double width, double height, int comp_nr) {
970  double scaling = 1.0;
971  if (comp_nr == 1) { //calculate aspect ratio area of the rectangle
972  OGDF_ASSERT( height != 0.0 );
973  double ratio = width / height;
974  if (ratio < pageRatio()) { //scale width
975  OGDF_ASSERT( ratio != 0.0 );
976  scaling = pageRatio() / ratio;
977  } else { //scale height
978  OGDF_ASSERT( pageRatio() != 0.0 );
979  scaling = ratio / pageRatio();
980  }
981  }
982  return width * height * scaling;
983  }
984 
991  void export_node_positions(
993  List<Rectangle>& R,
994  Graph G_sub[],
995  NodeArray<NodeAttributes> A_sub[]);
996 
999  Graph G_sub[],
1000  NodeArray<NodeAttributes> A_sub[],
1001  EdgeArray<EdgeAttributes> E_sub[])
1002  {
1003  delete[] G_sub;
1004  delete[] A_sub;
1005  delete[] E_sub;
1006  }
1007 
1011 
1017  int get_max_mult_iter(int act_level, int max_level, int node_nr);
1018 
1022 
1024  void calculate_forces(
1025  Graph& G,
1028  NodeArray<DPoint>& F_attr,
1029  NodeArray<DPoint>& F_rep,
1030  NodeArray<DPoint>& last_node_movement,
1031  int iter,
1032  int fine_tuning_step);
1033 
1035  void init_boxlength_and_cornercoordinate(Graph& G,NodeArray<NodeAttributes>& A);
1036 
1038  void create_initial_placement (Graph& G,NodeArray<NodeAttributes>& A);
1039 
1041  void create_initial_placement_uniform_grid(const Graph& G, NodeArray<NodeAttributes>& A);
1042 
1044  void create_initial_placement_random(const Graph& G, NodeArray<NodeAttributes>& A);
1045 
1047  void init_F (Graph& G, NodeArray<DPoint>& F);
1048 
1049 
1051  void make_initialisations_for_rep_calc_classes(
1052  Graph& G/*,
1053  NodeArray<NodeAttributes> &A,
1054  NodeArray<DPoint>& F_rep*/);
1055 
1058  Graph &G,
1060  NodeArray<DPoint>& F_rep)
1061  {
1062  switch (repulsiveForcesCalculation()) {
1064  FR.calculate_exact_repulsive_forces(G,A,F_rep);
1065  break;
1067  FR.calculate_approx_repulsive_forces(G,A,F_rep);
1068  break;
1070  NM.calculate_repulsive_forces(G,A,F_rep);
1071  break;
1072  }
1073  }
1074 
1075 
1078  {
1079  if(repulsiveForcesCalculation() == FMMMOptions::RepulsiveForcesMethod::NMM)
1080  NM.deallocate_memory();
1081  }
1082 
1084  void calculate_attractive_forces(
1085  Graph& G,
1088  NodeArray<DPoint>& F_attr);
1089 
1091  double f_attr_scalar (double d,double ind_ideal_edge_length);
1092 
1094  void add_attr_rep_forces(
1095  Graph& G,
1096  NodeArray<DPoint>& F_attr,
1097  NodeArray<DPoint>& F_rep,
1098  NodeArray<DPoint>& F,
1099  int iter,
1100  int fine_tuning_step);
1101 
1104 
1106 
1109  void update_boxlength_and_cornercoordinate(Graph& G,NodeArray<NodeAttributes>& A);
1110 
1112  double max_radius(int iter) {
1113  return (iter == 1) ? boxlength/1000 : boxlength/5;
1114  }
1115 
1117  void set_average_ideal_edgelength(Graph& G,EdgeArray<EdgeAttributes>& E);
1118 
1123  double get_average_forcevector_length (Graph& G, NodeArray<DPoint>& F);
1124 
1129  void prevent_oscillations(
1130  Graph& G,
1131  NodeArray<DPoint>& F,
1133  last_node_movement,
1134  int iter);
1135 
1137  void init_last_node_movement(
1138  Graph& G,
1139  NodeArray<DPoint>& F,
1140  NodeArray<DPoint>& last_node_movement);
1141 
1146  void adapt_drawing_to_ideal_average_edgelength(
1147  Graph& G,
1150 
1156  double x_min = down_left_corner.m_x;
1157  double x_max = down_left_corner.m_x+boxlength;
1158  double y_min = down_left_corner.m_y;
1159  double y_max = down_left_corner.m_y+boxlength;
1160  if (force.m_x < x_min )
1161  force.m_x = x_min;
1162  else if (force.m_x > x_max )
1163  force.m_x = x_max;
1164  if (force.m_y < y_min )
1165  force.m_y = y_min;
1166  else if (force.m_y > y_max )
1167  force.m_y = y_max;
1168  }
1169 
1173 
1175  void init_time() { time_total = 0; }
1176 
1178 };
1179 
1180 }
bool m_useHighLevelOptions
The option for using high-level options.
Definition: FMMMLayout.h:706
double time_total
The runtime (=CPU-time) of the algorithm in seconds.
Definition: FMMMLayout.h:778
void init_time()
Sets time_total to zero.
Definition: FMMMLayout.h:1175
void deallocate_memory()
Dynamically allocated memory is freed here.
FMMMOptions::AllowedPositions allowedPositions() const
Returns the current setting of option allowedPositions.
Definition: FMMMLayout.h:371
double minDistCC() const
Returns the minimal distance between connected components.
Definition: FMMMLayout.h:421
bool resizeDrawing() const
Returns the current setting of option resizeDrawing.
Definition: FMMMLayout.h:597
void calculate_repulsive_forces(const Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Calculate rep. forces for each node.
int nmParticlesInLeaves() const
Returns the current setting of option nmParticlesInLeaves.
Definition: FMMMLayout.h:690
double move_nodes(float *x, float *y, const uint32_t begin, const uint32_t end, const float *fx, const float *fy, const float t)
Definition: FMEKernel.h:80
bool m_singleLevel
Option for pure single level.
Definition: FMMMLayout.h:727
int nmPrecision() const
Returns the precision p for the p-term multipole expansions.
Definition: FMMMLayout.h:696
bool newInitialPlacement() const
Returns the current setting of option newInitialPlacement.
Definition: FMMMLayout.h:337
int m_maxIntPosExponent
The option for the used exponent.
Definition: FMMMLayout.h:717
void resizingScalar(double s)
Sets the option resizingScalar to s.
Definition: FMMMLayout.h:610
ForceModel
Specifies the force model.
Definition: FMMMOptions.h:107
void useHighLevelOptions(bool uho)
Sets the option useHighLevelOptions to uho.
Definition: FMMMLayout.h:314
void setSingleLevel(bool b)
Sets single level option, no multilevel hierarchy is created if b == true.
Definition: FMMMLayout.h:317
void galaxyChoice(FMMMOptions::GalaxyChoice gc)
Sets the option galaxyChoice to gc.
Definition: FMMMLayout.h:453
FMMMOptions::QualityVsSpeed m_qualityVersusSpeed
The option for quality-vs-speed trade-off.
Definition: FMMMLayout.h:710
helping data structure that stores the graphical attributes of a node that are needed for the force-d...
FMMMOptions::SmallestCellFinding m_NMSmallCell
The option for how to calculate smallest quadtratic cells.
Definition: FMMMLayout.h:766
double max_radius(int iter)
Describes the max. radius of a move in one time step, depending on the number of iterations.
Definition: FMMMLayout.h:1112
FMMMOptions::QualityVsSpeed qualityVersusSpeed() const
Returns the current setting of option qualityVersusSpeed.
Definition: FMMMLayout.h:343
double m_springStrength
The strengths of springs.
Definition: FMMMLayout.h:743
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
RepulsiveForcesMethod
Specifies how to calculate repulsive forces.
Definition: FMMMOptions.h:114
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
FMMMOptions::InitialPlacementForces m_initialPlacementForces
The option for how the initial placement is done.
Definition: FMMMLayout.h:752
double unitEdgeLength() const
Returns the current setting of option unitEdgeLength.
Definition: FMMMLayout.h:326
FMMMOptions::StopCriterion stopCriterion() const
Returns the stop criterion.
Definition: FMMMLayout.h:528
double forceScalingFactor() const
Returns the scaling factor for the forces.
Definition: FMMMLayout.h:550
int m_NMPrecision
The precision for multipole expansions.
Definition: FMMMLayout.h:768
void fineTuningIterations(int n)
Sets the number of iterations for fine tuning to n.
Definition: FMMMLayout.h:616
double resizingScalar() const
Returns the current setting of option resizingScalar.
Definition: FMMMLayout.h:607
FMMMOptions::GalaxyChoice galaxyChoice() const
Returns the current setting of option galaxyChoice.
Definition: FMMMLayout.h:450
void springStrength(double x)
Sets the strength of the springs to x.
Definition: FMMMLayout.h:509
double max_integer_position
The maximum value for an integer position.
Definition: FMMMLayout.h:771
void frGridQuotient(int p)
Sets the option frGridQuotient to p.
Definition: FMMMLayout.h:671
int fixedIterations() const
Returns the fixed number of iterations for the stop criterion.
Definition: FMMMLayout.h:544
int m_fixedIterations
The fixed number of iterations for the stop criterion.
Definition: FMMMLayout.h:748
double threshold() const
Returns the threshold for the stop criterion.
Definition: FMMMLayout.h:538
int randomTries() const
Returns the current setting of option randomTries.
Definition: FMMMLayout.h:461
void calculate_approx_repulsive_forces(const Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Grid approximation of rep.forces for each node.
double m_minDistCC
The separation between connected components.
Definition: FMMMLayout.h:723
InitialPlacementForces
Specifies how the initial placement is done.
Definition: FMMMOptions.h:128
bool coolTemperature() const
Returns the current setting of option coolTemperature.
Definition: FMMMLayout.h:560
int m_minGraphSize
The option for minimal graph size.
Definition: FMMMLayout.h:728
StopCriterion
Specifies the stop criterion.
Definition: FMMMOptions.h:121
Declaration of class NewMultipoleMethod (NMM).
void forceModel(FMMMOptions::ForceModel fm)
Sets the used force model to fm.
Definition: FMMMLayout.h:503
double springStrength() const
Returns the strength of the springs.
Definition: FMMMLayout.h:506
FMMMOptions::ReducedTreeConstruction nmTreeConstruction() const
Returns the current setting of option nmTreeConstruction.
Definition: FMMMLayout.h:674
FMMMOptions::PreSort m_presortCCs
The option for presorting connected components.
Definition: FMMMLayout.h:724
double m_coolValue
The value by which forces are decreased.
Definition: FMMMLayout.h:751
FMMMOptions::TipOver m_tipOverCCs
Option for tip-over of connected components.
Definition: FMMMLayout.h:722
FMMMOptions::EdgeLengthMeasurement m_edgeLengthMeasurement
The option for edge length measurement.
Definition: FMMMLayout.h:715
double m_repForcesStrength
The strength of repulsive forces.
Definition: FMMMLayout.h:744
FMMMOptions::InitialPlacementMult m_initialPlacementMult
The option for creating initial placement.
Definition: FMMMLayout.h:739
double boxlength
Holds the length of the quadratic comput.
Definition: FMMMLayout.h:774
double postStrengthOfRepForces() const
Returns the strength of the repulsive forces in the postprocessing step.
Definition: FMMMLayout.h:650
void initialPlacementForces(FMMMOptions::InitialPlacementForces ipf)
Sets the option initialPlacementForces to ipf.
Definition: FMMMLayout.h:582
FMMMOptions::GalaxyChoice m_galaxyChoice
The selection of galaxy nodes.
Definition: FMMMLayout.h:729
double m_fineTuneScalar
Parameter for scaling forces during fine tuning.
Definition: FMMMLayout.h:758
int stepsForRotatingComponents() const
Returns the current setting of option stepsForRotatingComponents.
Definition: FMMMLayout.h:407
double pageRatio() const
Returns the current setting of option pageRatio.
Definition: FMMMLayout.h:397
ReducedTreeConstruction
Specifies how the reduced bucket quadtree is constructed.
Definition: FMMMOptions.h:136
QualityVsSpeed
Trade-off between run-time and quality.
Definition: FMMMOptions.h:46
double calculate_area(double width, double height, int comp_nr)
Returns the area (aspect ratio area) of a rectangle with width w and height h if comp_nr > 1 ( comp_n...
Definition: FMMMLayout.h:969
void delete_all_subGraphs(Graph G_sub[], NodeArray< NodeAttributes > A_sub[], EdgeArray< EdgeAttributes > E_sub[])
Frees dynamically allocated memory for the connected component subgraphs.
Definition: FMMMLayout.h:998
FMMMOptions::InitialPlacementMult initialPlacementMult() const
Returns the current setting of option initialPlacementMult.
Definition: FMMMLayout.h:484
int m_randomTries
The number of random tries.
Definition: FMMMLayout.h:730
bool m_newInitialPlacement
The option for new initial placement.
Definition: FMMMLayout.h:709
PreSort
Specifies how connected components are sorted before the packing algorithm is applied.
Definition: FMMMOptions.h:80
void nmSmallCell(FMMMOptions::SmallestCellFinding scf)
Sets the option nmSmallCell to scf.
Definition: FMMMLayout.h:683
void nmTreeConstruction(FMMMOptions::ReducedTreeConstruction rtc)
Sets the option nmTreeConstruction to rtc.
Definition: FMMMLayout.h:677
void threshold(double x)
Sets the threshold for the stop criterion to x.
Definition: FMMMLayout.h:541
void presortCCs(FMMMOptions::PreSort ps)
Sets the option presortCCs to ps.
Definition: FMMMLayout.h:430
FMMMOptions::StopCriterion m_stopCriterion
The stop criterion.
Definition: FMMMLayout.h:746
void coolTemperature(bool b)
Sets the option coolTemperature to b.
Definition: FMMMLayout.h:563
void pageRatio(double r)
Sets the option pageRatio to r.
Definition: FMMMLayout.h:400
int m_stepsForRotatingComponents
The number of rotations.
Definition: FMMMLayout.h:721
GalaxyChoice
Specifies how sun nodes of galaxies are selected.
Definition: FMMMOptions.h:87
int frGridQuotient() const
Returns the current setting of option frGridQuotient.
Definition: FMMMLayout.h:668
FMMMOptions::PageFormatType pageFormat() const
Returns the current setting of option pageFormat.
Definition: FMMMLayout.h:320
double m_pageRatio
The desired page ratio.
Definition: FMMMLayout.h:720
void restrict_force_to_comp_box(DPoint &force)
The force is restricted to have values within the comp.
Definition: FMMMLayout.h:1155
FMMMOptions::SmallestCellFinding nmSmallCell() const
Returns the current setting of option nmSmallCell.
Definition: FMMMLayout.h:680
The fast multipole multilevel layout algorithm.
Definition: FMMMLayout.h:232
void repulsiveForcesCalculation(FMMMOptions::RepulsiveForcesMethod rfc)
Sets the option repulsiveForcesCalculation to rfc.
Definition: FMMMLayout.h:523
FMMMOptions::PreSort presortCCs() const
Returns the current setting of option presortCCs.
Definition: FMMMLayout.h:427
TipOver
Specifies in which case it is allowed to tip over drawings of connected components.
Definition: FMMMOptions.h:73
void postSpringStrength(double x)
Sets the strength of the springs in the postprocessing step to x.
Definition: FMMMLayout.h:647
int m_fineTuningIterations
The number of iterations for fine tuning.
Definition: FMMMLayout.h:757
void calculate_exact_repulsive_forces(const Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Calculate exact rep. forces for each node.
bool adjustPostRepStrengthDynamically() const
Returns the current setting of option adjustPostRepStrengthDynamically.
Definition: FMMMLayout.h:634
bool m_resizeDrawing
The option for resizing the drawing.
Definition: FMMMLayout.h:755
double postSpringStrength() const
Returns the strength of the springs in the postprocessing step.
Definition: FMMMLayout.h:644
PageFormatType
Possible page formats.
Definition: FMMMOptions.h:39
Stores additional attributes of a graph (like layout information).
FMMMOptions::AllowedPositions m_allowedPositions
The option for allowed positions.
Definition: FMMMLayout.h:716
FMMMOptions::InitialPlacementForces initialPlacementForces() const
Returns the current setting of option initialPlacementForces.
Definition: FMMMLayout.h:577
int maxIntPosExponent() const
Returns the current setting of option maxIntPosExponent.
Definition: FMMMLayout.h:380
virtual ~FMMMLayout()
Definition: FMMMLayout.h:243
double coolValue() const
Returns the current setting of option coolValue.
Definition: FMMMLayout.h:570
EdgeLengthMeasurement
Specifies how the length of an edge is measured.
Definition: FMMMOptions.h:53
void minGraphSize(int n)
Sets the option minGraphSize to n.
Definition: FMMMLayout.h:447
void maxIterChange(FMMMOptions::MaxIterChange mic)
Sets the option maxIterChange to mic.
Definition: FMMMLayout.h:470
Declaration of class Rectangle.
void stopCriterion(FMMMOptions::StopCriterion rsc)
Sets the stop criterion to rsc.
Definition: FMMMLayout.h:531
int minGraphSize() const
Returns the current setting of option minGraphSize.
Definition: FMMMLayout.h:444
void randomTries(int n)
Sets the option randomTries to n.
Definition: FMMMLayout.h:464
FMMMOptions::MaxIterChange maxIterChange() const
Returns the current setting of option maxIterChange.
Definition: FMMMLayout.h:467
FMMMOptions::MaxIterChange m_maxIterChange
The option for how to change MaxIterations. If maxIterChange != micConstant, the iterations are decre...
Definition: FMMMLayout.h:736
NodeArray< double > radius
Holds the radius of the surrounding circle for each node.
Definition: FMMMLayout.h:777
double m_resizingScalar
Parameter for resizing the drawing.
Definition: FMMMLayout.h:756
double fineTuneScalar() const
Returns the curent setting of option fineTuneScalar.
Definition: FMMMLayout.h:623
Stores additional attributes of a clustered graph (like layout information).
void calculate_repulsive_forces(Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Calculates repulsive forces for each node.
Definition: FMMMLayout.h:1057
FMMMOptions::PageFormatType m_pageFormat
The option for the page format.
Definition: FMMMLayout.h:707
void initialPlacementMult(FMMMOptions::InitialPlacementMult ipm)
Sets the option initialPlacementMult to ipm.
Definition: FMMMLayout.h:489
double m_forceScalingFactor
The scaling factor for the forces.
Definition: FMMMLayout.h:749
Declaration of interface for layout algorithms (class LayoutModule)
void nmParticlesInLeaves(int n)
Sets the option nmParticlesInLeaves to n.
Definition: FMMMLayout.h:693
void minDistCC(double x)
Sets the minimal distance between connected components to x.
Definition: FMMMLayout.h:424
bool useHighLevelOptions() const
Returns the current setting of option useHighLevelOptions.
Definition: FMMMLayout.h:311
void pageFormat(FMMMOptions::PageFormatType t)
Sets the option pageRatio to t.
Definition: FMMMLayout.h:323
void maxIntPosExponent(int e)
Sets the option maxIntPosExponent to e.
Definition: FMMMLayout.h:383
double repForcesStrength() const
Returns the strength of the repulsive forces.
Definition: FMMMLayout.h:512
T m_y
The y-coordinate.
Definition: geometry.h:79
bool m_coolTemperature
The option for how to scale forces.
Definition: FMMMLayout.h:750
Interface of general layout algorithms.
Definition: LayoutModule.h:44
void fineTuneScalar(double s)
Sets the option fineTuneScalar to s.
Definition: FMMMLayout.h:626
double cool_factor
Needed for scaling the forces if coolTemperature is true.
Definition: FMMMLayout.h:772
int m_NMParticlesInLeaves
The maximal number of particles in a leaf.
Definition: FMMMLayout.h:767
double m_threshold
The threshold for the stop criterion.
Definition: FMMMLayout.h:747
AllowedPositions
Specifies which positions for a node are allowed.
Definition: FMMMOptions.h:59
int m_randSeed
The random seed.
Definition: FMMMLayout.h:714
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
void fixedIterations(int n)
Sets the fixed number of iterations for the stop criterion to n.
Definition: FMMMLayout.h:547
Includes declaration of graph class.
FMMMOptions::ReducedTreeConstruction m_NMTreeConstruction
The option for how to construct reduced bucket quadtree.
Definition: FMMMLayout.h:765
int randSeed() const
Returns the seed of the random number generator.
Definition: FMMMLayout.h:360
void qualityVersusSpeed(FMMMOptions::QualityVsSpeed qvs)
Sets the option qualityVersusSpeed to qvs.
Definition: FMMMLayout.h:346
void coolValue(double x)
Sets the option coolValue to x.
Definition: FMMMLayout.h:573
bool m_adjustPostRepStrengthDynamically
The option adjustPostRepStrengthDynamically.
Definition: FMMMLayout.h:759
DPoint down_left_corner
Holds down left corner of the comput.
Definition: FMMMLayout.h:776
MaxIterChange
Specifies how MaxIterations is changed in subsequent multilevels.
Definition: FMMMOptions.h:94
int m_frGridQuotient
The grid quotient.
Definition: FMMMLayout.h:764
void newInitialPlacement(bool nip)
Sets the option newInitialPlacement to nip.
Definition: FMMMLayout.h:340
double m_postSpringStrength
The strength of springs during postprocessing.
Definition: FMMMLayout.h:760
void adjustPostRepStrengthDynamically(bool b)
Sets the option adjustPostRepStrengthDynamically to b.
Definition: FMMMLayout.h:639
void stepsForRotatingComponents(int n)
Sets the option stepsForRotatingComponents to n.
Definition: FMMMLayout.h:410
FMMMOptions::EdgeLengthMeasurement edgeLengthMeasurement() const
Returns the current setting of option edgeLengthMeasurement.
Definition: FMMMLayout.h:363
void unitEdgeLength(double x)
Sets the option unitEdgeLength to x.
Definition: FMMMLayout.h:329
void postStrengthOfRepForces(double x)
Sets the strength of the repulsive forces in the postprocessing step to x.
Definition: FMMMLayout.h:653
helping data structure that stores the graphical attributes of an edge that are needed for the force-...
int number_of_components
The number of components of the graph.
Definition: FMMMLayout.h:775
FMMMOptions::TipOver tipOverCCs() const
Returns the current setting of option tipOverCCs.
Definition: FMMMLayout.h:415
void maxIterFactor(int f)
Sets the option maxIterFactor to f.
Definition: FMMMLayout.h:481
void edgeLengthMeasurement(FMMMOptions::EdgeLengthMeasurement elm)
Sets the option edgeLengthMeasurement to elm.
Definition: FMMMLayout.h:368
The namespace for all OGDF objects.
Helping data structure for packing rectangles; The width, height and the position of the down left co...
Definition: Rectangle.h:44
void nmPrecision(int p)
Sets the precision for the multipole expansions to p.
Definition: FMMMLayout.h:699
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment, DPolygon, DRect, DIntersectableRect.
FMMMOptions::RepulsiveForcesMethod m_repulsiveForcesCalculation
Option for how to calculate repulsive forces.
Definition: FMMMLayout.h:745
int m_maxIterFactor
The factor used for decreasing MaxIterations.
Definition: FMMMLayout.h:738
energybased::fmmm::FruchtermanReingold FR
Class for repulsive force calculation (Fruchterman, Reingold).
Definition: FMMMLayout.h:780
double m_postStrengthOfRepForces
The strength of repulsive forces during postprocessing.
Definition: FMMMLayout.h:761
void allowedPositions(FMMMOptions::AllowedPositions ap)
Sets the option allowedPositions to ap.
Definition: FMMMLayout.h:374
double m_unitEdgeLength
The unit edge length.
Definition: FMMMLayout.h:708
InitialPlacementMult
Specifies how the initial placement is generated.
Definition: FMMMOptions.h:101
SmallestCellFinding
Specifies how to calculate the smallest quadratic cell that surrounds the particles of a node in the ...
Definition: FMMMOptions.h:143
FMMMOptions::RepulsiveForcesMethod repulsiveForcesCalculation() const
Returns the current setting of option repulsiveForcesCalculation.
Definition: FMMMLayout.h:518
void deallocate_memory_for_rep_calc_classes()
Deallocates dynamically allocated memory of the choosen rep. calculation class.
Definition: FMMMLayout.h:1077
void forceScalingFactor(double f)
Sets the scaling factor for the forces to f.
Definition: FMMMLayout.h:553
Calculation as for new multipole method (fast and accurate).
int fineTuningIterations() const
Returns the number of iterations for fine tuning.
Definition: FMMMLayout.h:613
energybased::fmmm::NewMultipoleMethod NM
Class for repulsive force calculation.
Definition: FMMMLayout.h:781
void tipOverCCs(FMMMOptions::TipOver to)
Sets the option tipOverCCs to to.
Definition: FMMMLayout.h:418
FMMMOptions::ForceModel m_forceModel
The used force model.
Definition: FMMMLayout.h:742
double average_ideal_edgelength
Measured from center to center.
Definition: FMMMLayout.h:773
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:41
double get_post_rep_force_strength(int n)
Returns the value for the strength of the repulsive forces.
Definition: FMMMLayout.h:900
T m_x
The x-coordinate.
Definition: geometry.h:78
int maxIterFactor() const
Returns the current setting of option maxIterFactor.
Definition: FMMMLayout.h:478
void resizeDrawing(bool b)
Sets the option resizeDrawing to b.
Definition: FMMMLayout.h:600
void repForcesStrength(double x)
Sets the strength of the repulsive forces to x.
Definition: FMMMLayout.h:515