Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
FMMMLayout.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/basic.h>
37#include <ogdf/basic/geometry.h>
44
45#include <algorithm>
46
47namespace ogdf {
48class ClusterGraphAttributes;
49class GraphAttributes;
50template<class E>
51class List;
52
246
247public:
250
251 // destructor
252 virtual ~FMMMLayout() { }
253
260 virtual void call(GraphAttributes& GA) override;
261
266
268
273 void call(GraphAttributes& GA, //graph and layout
274 const EdgeArray<double>& edgeLength); //factor for desired edge lengths
275
277
281 void call(GraphAttributes& GA, char* ps_file);
282
284
290 void call(GraphAttributes& GA, //graph and layout
291 const EdgeArray<double>& edgeLength, //factor for desired edge lengths
292 char* ps_file);
293
300 double getCpuTime() { return time_total; }
301
309
313
315
329 bool useHighLevelOptions() const { return m_useHighLevelOptions; }
330
332 void useHighLevelOptions(bool uho) { m_useHighLevelOptions = uho; }
333
335 void setSingleLevel(bool b) { m_singleLevel = b; }
336
338
341 FMMMOptions::PageFormatType pageFormat() const { return m_pageFormat; }
342
344 void pageFormat(FMMMOptions::PageFormatType t) { m_pageFormat = t; }
345
347 double unitEdgeLength() const { return m_unitEdgeLength; }
348
350 void unitEdgeLength(double x) { m_unitEdgeLength = ((x > 0.0) ? x : 1); }
351
353
361 bool newInitialPlacement() const { return m_newInitialPlacement; }
362
364 void newInitialPlacement(bool nip) { m_newInitialPlacement = nip; }
365
367
371 FMMMOptions::QualityVsSpeed qualityVersusSpeed() const { return m_qualityVersusSpeed; }
372
374 void qualityVersusSpeed(FMMMOptions::QualityVsSpeed qvs) { m_qualityVersusSpeed = qvs; }
375
384 void randSeed(int p) { m_randSeed = ((0 <= p) ? p : 1); }
385
387 int randSeed() const { return m_randSeed; }
388
391 return m_edgeLengthMeasurement;
392 }
393
396 m_edgeLengthMeasurement = elm;
397 }
398
400 FMMMOptions::AllowedPositions allowedPositions() const { return m_allowedPositions; }
401
403 void allowedPositions(FMMMOptions::AllowedPositions ap) { m_allowedPositions = ap; }
404
406
409 int maxIntPosExponent() const { return m_maxIntPosExponent; }
410
412 void maxIntPosExponent(int e) { m_maxIntPosExponent = (((e >= 31) && (e <= 51)) ? e : 31); }
413
420
423 double pageRatio() const { return m_pageRatio; }
424
426 void pageRatio(double r) { m_pageRatio = ((r > 0) ? r : 1); }
427
429
433 int stepsForRotatingComponents() const { return m_stepsForRotatingComponents; }
434
436 void stepsForRotatingComponents(int n) { m_stepsForRotatingComponents = ((0 <= n) ? n : 0); }
437
439 FMMMOptions::TipOver tipOverCCs() const { return m_tipOverCCs; }
440
442 void tipOverCCs(FMMMOptions::TipOver to) { m_tipOverCCs = to; }
443
445 double minDistCC() const { return m_minDistCC; }
446
448 void minDistCC(double x) { m_minDistCC = ((x > 0) ? x : 1); }
449
451 FMMMOptions::PreSort presortCCs() const { return m_presortCCs; }
452
454 void presortCCs(FMMMOptions::PreSort ps) { m_presortCCs = ps; }
455
462
467 int minGraphSize() const { return m_minGraphSize; }
468
470 void minGraphSize(int n) { m_minGraphSize = ((n >= 2) ? n : 2); }
471
473 FMMMOptions::GalaxyChoice galaxyChoice() const { return m_galaxyChoice; }
474
476 void galaxyChoice(FMMMOptions::GalaxyChoice gc) { m_galaxyChoice = gc; }
477
479
484 int randomTries() const { return m_randomTries; }
485
487 void randomTries(int n) { m_randomTries = ((n >= 1) ? n : 1); }
488
490 FMMMOptions::MaxIterChange maxIterChange() const { return m_maxIterChange; }
491
493 void maxIterChange(FMMMOptions::MaxIterChange mic) { m_maxIterChange = mic; }
494
496
501 int maxIterFactor() const { return m_maxIterFactor; }
502
504 void maxIterFactor(int f) { m_maxIterFactor = ((f >= 1) ? f : 1); }
505
508 return m_initialPlacementMult;
509 }
510
513 m_initialPlacementMult = ipm;
514 }
515
522 FMMMOptions::ForceModel forceModel() const { return m_forceModel; }
523
525 void forceModel(FMMMOptions::ForceModel fm) { m_forceModel = fm; }
526
528 double springStrength() const { return m_springStrength; }
529
531 void springStrength(double x) { m_springStrength = ((x > 0) ? x : 1); }
532
534 double repForcesStrength() const { return m_repForcesStrength; }
535
537 void repForcesStrength(double x) { m_repForcesStrength = ((x > 0) ? x : 1); }
538
541 return m_repulsiveForcesCalculation;
542 }
543
546 m_repulsiveForcesCalculation = rfc;
547 }
548
550 FMMMOptions::StopCriterion stopCriterion() const { return m_stopCriterion; }
551
553 void stopCriterion(FMMMOptions::StopCriterion rsc) { m_stopCriterion = rsc; }
554
556
560 double threshold() const { return m_threshold; }
561
563 void threshold(double x) { m_threshold = ((x > 0) ? x : 0.1); }
564
566 int fixedIterations() const { return m_fixedIterations; }
567
569 void fixedIterations(int n) { m_fixedIterations = ((n >= 1) ? n : 1); }
570
572 double forceScalingFactor() const { return m_forceScalingFactor; }
573
575 void forceScalingFactor(double f) { m_forceScalingFactor = ((f > 0) ? f : 1); }
576
578
582 bool coolTemperature() const { return m_coolTemperature; }
583
585 void coolTemperature(bool b) { m_coolTemperature = b; }
586
588
592 double coolValue() const { return m_coolValue; }
593
595 void coolValue(double x) { m_coolValue = (((x > 0) && (x <= 1)) ? x : 0.99); }
596
599 return m_initialPlacementForces;
600 }
601
604 m_initialPlacementForces = ipf;
605 }
606
613
617 bool resizeDrawing() const { return m_resizeDrawing; }
618
620 void resizeDrawing(bool b) { m_resizeDrawing = b; }
621
623
627 double resizingScalar() const { return m_resizingScalar; }
628
630 void resizingScalar(double s) { m_resizingScalar = ((s > 0) ? s : 1); }
631
633 int fineTuningIterations() const { return m_fineTuningIterations; }
634
636 void fineTuningIterations(int n) { m_fineTuningIterations = ((n >= 0) ? n : 0); }
637
639
643 double fineTuneScalar() const { return m_fineTuneScalar; }
644
646 void fineTuneScalar(double s) { m_fineTuneScalar = ((s >= 0) ? s : 1); }
647
649
654 bool adjustPostRepStrengthDynamically() const { return m_adjustPostRepStrengthDynamically; }
655
657 void adjustPostRepStrengthDynamically(bool b) { m_adjustPostRepStrengthDynamically = b; }
658
660 double postSpringStrength() const { return m_postSpringStrength; }
661
663 void postSpringStrength(double x) { m_postSpringStrength = ((x > 0) ? x : 1); }
664
666 double postStrengthOfRepForces() const { return m_postStrengthOfRepForces; }
667
669 void postStrengthOfRepForces(double x) { m_postStrengthOfRepForces = ((x > 0) ? x : 1); }
670
677
681 int frGridQuotient() const { return m_frGridQuotient; }
682
684 void frGridQuotient(int p) { m_frGridQuotient = ((0 <= p) ? p : 2); }
685
687 FMMMOptions::ReducedTreeConstruction nmTreeConstruction() const { return m_NMTreeConstruction; }
688
691 m_NMTreeConstruction = rtc;
692 }
693
695 FMMMOptions::SmallestCellFinding nmSmallCell() const { return m_NMSmallCell; }
696
698 void nmSmallCell(FMMMOptions::SmallestCellFinding scf) { m_NMSmallCell = scf; }
699
701
705 int nmParticlesInLeaves() const { return m_NMParticlesInLeaves; }
706
708 void nmParticlesInLeaves(int n) { m_NMParticlesInLeaves = ((n >= 1) ? n : 1); }
709
711 int nmPrecision() const { return m_NMPrecision; }
712
714 void nmPrecision(int p) { m_NMPrecision = ((p >= 1) ? p : 1); }
715
717
718private:
719 //high level options
725
726 //low level options
727 //general options
732
733 //options for divide et impera step
734 double m_pageRatio;
737 double m_minDistCC;
739
740 //options for multilevel step
745
751
754
755 //options for force calculation step
761 double m_threshold;
765 double m_coolValue;
767
768 //options for postprocessing step
776
777 //options for repulsive force approximation methods
784
785 //other variables
787 double cool_factor;
789 double boxlength;
793 double time_total;
794
797
800
804
808
810 bool running(int iter, int max_mult_iter, double actforcevectorlength);
811
813
819 EdgeArray<EdgeAttributes>& E, int act_level, int max_level);
820
824 NodeArray<DPoint>& F_rep, NodeArray<DPoint>& last_node_movement);
825
829
832
835
837 void import_EdgeAttributes(const Graph& G, const EdgeArray<double>& edgeLength,
839
843
846
849 GraphAttributes& GA);
850
852
859 EdgeArray<EdgeAttributes>& E_reduced);
860
862
867 List<edge>& S, EdgeArray<double>& new_edgelength);
868
870
874 EdgeArray<EdgeAttributes>& E_reduced);
875
877
880 double get_post_rep_force_strength(int n) { return min(0.2, 400.0 / double(n)); }
881
888
891
895
897
903 EdgeArray<EdgeAttributes> E_sub[], NodeArray<int>& component);
904
906
912
916
919 int componenet_index);
920
929
934 double calculate_area(double width, double height, int comp_nr) {
935 double scaling = 1.0;
936 if (comp_nr == 1) { //calculate aspect ratio area of the rectangle
937 OGDF_ASSERT(height != 0.0);
938 double ratio = width / height;
939 if (ratio < pageRatio()) { //scale width
940 OGDF_ASSERT(ratio != 0.0);
941 scaling = pageRatio() / ratio;
942 } else { //scale height
943 OGDF_ASSERT(pageRatio() != 0.0);
944 scaling = ratio / pageRatio();
945 }
946 }
947 return width * height * scaling;
948 }
949
958
962 delete[] G_sub;
963 delete[] A_sub;
964 delete[] E_sub;
965 }
966
970
976 int get_max_mult_iter(int act_level, int max_level, int node_nr);
977
981
985 NodeArray<DPoint>& last_node_movement, int iter, int fine_tuning_step);
986
989
992
995
998
1001
1002
1005 Graph& G/*,
1006 NodeArray<NodeAttributes> &A,
1007 NodeArray<DPoint>& F_rep*/);
1008
1011 switch (repulsiveForcesCalculation()) {
1012 case FMMMOptions::RepulsiveForcesMethod::Exact:
1013 FR.calculate_exact_repulsive_forces(G, A, F_rep);
1014 break;
1015 case FMMMOptions::RepulsiveForcesMethod::GridApproximation:
1017 break;
1018 case FMMMOptions::RepulsiveForcesMethod::NMM:
1019 NM.calculate_repulsive_forces(G, A, F_rep);
1020 break;
1021 }
1022 }
1023
1026 if (repulsiveForcesCalculation() == FMMMOptions::RepulsiveForcesMethod::NMM) {
1027 NM.deallocate_memory();
1028 }
1029 }
1030
1034
1036 double f_attr_scalar(double d, double ind_ideal_edge_length);
1037
1040 NodeArray<DPoint>& F, int iter, int fine_tuning_step);
1041
1044
1046
1050
1052 double max_radius(int iter) { return (iter == 1) ? boxlength / 1000 : boxlength / 5; }
1053
1056
1062
1068 int iter);
1069
1072 NodeArray<DPoint>& last_node_movement);
1073
1080
1086 double x_min = down_left_corner.m_x;
1087 double x_max = down_left_corner.m_x + boxlength;
1088 double y_min = down_left_corner.m_y;
1089 double y_max = down_left_corner.m_y + boxlength;
1090 if (force.m_x < x_min) {
1091 force.m_x = x_min;
1092 } else if (force.m_x > x_max) {
1093 force.m_x = x_max;
1094 }
1095 if (force.m_y < y_min) {
1096 force.m_y = y_min;
1097 } else if (force.m_y > y_max) {
1098 force.m_y = y_max;
1099 }
1100 }
1101
1105
1107 void init_time() { time_total = 0; }
1108
1110};
1111
1112}
Declaration of class EdgeAttributes.
Declaration of Fast Multipole Multilevel Method (FM^3) options.
Declaration of class FruchtermanReingold (computation of forces).
Includes declaration of graph class.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of class NewMultipoleMethod (NMM).
Declaration of class NodeAttributes.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
Stores additional attributes of a clustered graph (like layout information).
The fast multipole multilevel layout algorithm.
Definition FMMMLayout.h:242
void set_average_ideal_edgelength(Graph &G, EdgeArray< EdgeAttributes > &E)
The average_ideal_edgelength for all edges is computed.
DPoint down_left_corner
Holds down left corner of the comput.
Definition FMMMLayout.h:791
int m_NMPrecision
The precision for multipole expansions.
Definition FMMMLayout.h:783
void rotate_components_and_calculate_bounding_rectangles(List< Rectangle > &R, Graph G_sub[], NodeArray< NodeAttributes > A_sub[])
If number_of_components > 1, the subgraphs G_sub are rotated and skipped to find bounding rectangles ...
double cool_factor
Needed for scaling the forces if coolTemperature is true.
Definition FMMMLayout.h:787
double getCpuTime()
Returns the runtime (=CPU-time) of the layout algorithm in seconds.
Definition FMMMLayout.h:300
void init_F(Graph &G, NodeArray< DPoint > &F)
Sets all entries of F to (0,0).
void fineTuningIterations(int n)
Sets the number of iterations for fine tuning to n.
Definition FMMMLayout.h:636
void fineTuneScalar(double s)
Sets the option fineTuneScalar to s.
Definition FMMMLayout.h:646
void create_initial_placement_random(const Graph &G, NodeArray< NodeAttributes > &A)
Places nodes randomly.
FMMMOptions::SmallestCellFinding nmSmallCell() const
Returns the current setting of option nmSmallCell.
Definition FMMMLayout.h:695
int number_of_components
The number of components of the graph.
Definition FMMMLayout.h:790
double m_postStrengthOfRepForces
The strength of repulsive forces during postprocessing.
Definition FMMMLayout.h:775
void call_POSTPROCESSING_step(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E, NodeArray< DPoint > &F, NodeArray< DPoint > &F_attr, NodeArray< DPoint > &F_rep, NodeArray< DPoint > &last_node_movement)
Calls the postprocessing step.
void call(GraphAttributes &GA, char *ps_file)
Extended algorithm call: Calls the algorithm for graph GA.
double f_attr_scalar(double d, double ind_ideal_edge_length)
Returns the attractive force scalar.
FMMMOptions::ForceModel forceModel() const
Returns the used force model.
Definition FMMMLayout.h:522
FMMMOptions::EdgeLengthMeasurement m_edgeLengthMeasurement
The option for edge length measurement.
Definition FMMMLayout.h:729
double m_pageRatio
The desired page ratio.
Definition FMMMLayout.h:734
bool m_newInitialPlacement
The option for new initial placement.
Definition FMMMLayout.h:723
void repulsiveForcesCalculation(FMMMOptions::RepulsiveForcesMethod rfc)
Sets the option repulsiveForcesCalculation to rfc.
Definition FMMMLayout.h:545
bool m_adjustPostRepStrengthDynamically
The option adjustPostRepStrengthDynamically.
Definition FMMMLayout.h:773
double m_minDistCC
The separation between connected components.
Definition FMMMLayout.h:737
bool m_coolTemperature
The option for how to scale forces.
Definition FMMMLayout.h:764
void initialPlacementMult(FMMMOptions::InitialPlacementMult ipm)
Sets the option initialPlacementMult to ipm.
Definition FMMMLayout.h:512
int m_stepsForRotatingComponents
The number of rotations.
Definition FMMMLayout.h:735
void stepsForRotatingComponents(int n)
Sets the option stepsForRotatingComponents to n.
Definition FMMMLayout.h:436
NodeArray< double > radius
Holds the radius of the surrounding circle for each node.
Definition FMMMLayout.h:792
energybased::fmmm::FruchtermanReingold FR
Class for repulsive force calculation (Fruchterman, Reingold).
Definition FMMMLayout.h:795
double m_coolValue
The value by which forces are decreased.
Definition FMMMLayout.h:765
void call(GraphAttributes &GA, const EdgeArray< double > &edgeLength)
Extended algorithm call: Allows to pass desired lengths of the edges.
FMMMOptions::ReducedTreeConstruction m_NMTreeConstruction
The option for how to construct reduced bucket quadtree.
Definition FMMMLayout.h:780
bool m_singleLevel
Option for pure single level.
Definition FMMMLayout.h:741
void qualityVersusSpeed(FMMMOptions::QualityVsSpeed qvs)
Sets the option qualityVersusSpeed to qvs.
Definition FMMMLayout.h:374
int fixedIterations() const
Returns the fixed number of iterations for the stop criterion.
Definition FMMMLayout.h:566
FMMMOptions::EdgeLengthMeasurement edgeLengthMeasurement() const
Returns the current setting of option edgeLengthMeasurement.
Definition FMMMLayout.h:390
void create_postscript_drawing(GraphAttributes &GA, char *ps_file)
Creates a simple drawing of GA in postscript format and saves it in file ps_file.
bool m_resizeDrawing
The option for resizing the drawing.
Definition FMMMLayout.h:769
void delete_parallel_edges(const Graph &G, EdgeArray< EdgeAttributes > &E, Graph &G_reduced, List< edge > &S, EdgeArray< double > &new_edgelength)
Deletes parallel edges of G_reduced.
void adapt_drawing_to_ideal_average_edgelength(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E)
If resizeDrawing is true, the drawing is adapted to the ideal average edge length by shrinking respec...
FMMMOptions::QualityVsSpeed m_qualityVersusSpeed
The option for quality-vs-speed trade-off.
Definition FMMMLayout.h:724
bool running(int iter, int max_mult_iter, double actforcevectorlength)
Returns true iff stopCriterion() is not met.
double get_post_rep_force_strength(int n)
Returns the value for the strength of the repulsive forces.
Definition FMMMLayout.h:880
void create_maximum_connected_subGraphs(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E, Graph G_sub[], NodeArray< NodeAttributes > A_sub[], EdgeArray< EdgeAttributes > E_sub[], NodeArray< int > &component)
Constructs the list of connected components of G.
FMMMOptions::PreSort presortCCs() const
Returns the current setting of option presortCCs.
Definition FMMMLayout.h:451
int minGraphSize() const
Returns the current setting of option minGraphSize.
Definition FMMMLayout.h:467
void move_nodes(Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F)
Move the nodes.
double forceScalingFactor() const
Returns the scaling factor for the forces.
Definition FMMMLayout.h:572
int m_fixedIterations
The fixed number of iterations for the stop criterion.
Definition FMMMLayout.h:762
void restrict_force_to_comp_box(DPoint &force)
The force is restricted to have values within the comp.
void randomTries(int n)
Sets the option randomTries to n.
Definition FMMMLayout.h:487
double m_fineTuneScalar
Parameter for scaling forces during fine tuning.
Definition FMMMLayout.h:772
double average_ideal_edgelength
Measured from center to center.
Definition FMMMLayout.h:788
FMMMOptions::InitialPlacementForces m_initialPlacementForces
The option for how the initial placement is done.
Definition FMMMLayout.h:766
void make_initialisations_for_rep_calc_classes(Graph &G)
Make initializations for the data structures that are used in the choosen class for rep....
void coolTemperature(bool b)
Sets the option coolTemperature to b.
Definition FMMMLayout.h:585
void import_NodeAttributes(const Graph &G, GraphAttributes &GA, NodeArray< NodeAttributes > &A)
Imports for each node v of G its width, height and position (given from GA) in A.
void forceModel(FMMMOptions::ForceModel fm)
Sets the used force model to fm.
Definition FMMMLayout.h:525
FMMMOptions::MaxIterChange m_maxIterChange
The option for how to change MaxIterations. If maxIterChange != micConstant, the iterations are decre...
Definition FMMMLayout.h:750
double resizingScalar() const
Returns the current setting of option resizingScalar.
Definition FMMMLayout.h:627
FMMMOptions::GalaxyChoice m_galaxyChoice
The selection of galaxy nodes.
Definition FMMMLayout.h:743
void repForcesStrength(double x)
Sets the strength of the repulsive forces to x.
Definition FMMMLayout.h:537
FMMMOptions::AllowedPositions allowedPositions() const
Returns the current setting of option allowedPositions.
Definition FMMMLayout.h:400
int maxIterFactor() const
Returns the current setting of option maxIterFactor.
Definition FMMMLayout.h:501
virtual ~FMMMLayout()
Definition FMMMLayout.h:252
double m_forceScalingFactor
The scaling factor for the forces.
Definition FMMMLayout.h:763
void deallocate_memory_for_rep_calc_classes()
Deallocates dynamically allocated memory of the choosen rep. calculation class.
void init_time()
Sets time_total to zero.
void presortCCs(FMMMOptions::PreSort ps)
Sets the option presortCCs to ps.
Definition FMMMLayout.h:454
void postSpringStrength(double x)
Sets the strength of the springs in the postprocessing step to x.
Definition FMMMLayout.h:663
int get_max_mult_iter(int act_level, int max_level, int node_nr)
Returns the maximum number of iterations for the force calc.
int maxIntPosExponent() const
Returns the current setting of option maxIntPosExponent.
Definition FMMMLayout.h:409
double pageRatio() const
Returns the current setting of option pageRatio.
Definition FMMMLayout.h:423
void pack_subGraph_drawings(NodeArray< NodeAttributes > &A, Graph G_sub[], NodeArray< NodeAttributes > A_sub[])
The drawings of the subgraphs are packed.
int m_maxIntPosExponent
The option for the used exponent.
Definition FMMMLayout.h:731
int m_NMParticlesInLeaves
The maximal number of particles in a leaf.
Definition FMMMLayout.h:782
int nmParticlesInLeaves() const
Returns the current setting of option nmParticlesInLeaves.
Definition FMMMLayout.h:705
FMMMOptions::InitialPlacementMult m_initialPlacementMult
The option for creating initial placement.
Definition FMMMLayout.h:753
FMMMOptions::SmallestCellFinding m_NMSmallCell
The option for how to calculate smallest quadtratic cells.
Definition FMMMLayout.h:781
void frGridQuotient(int p)
Sets the option frGridQuotient to p.
Definition FMMMLayout.h:684
void init_ind_ideal_edgelength(const Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E)
Sets the individual ideal edge length for each edge e.
void pageFormat(FMMMOptions::PageFormatType t)
Sets the option pageRatio to t.
Definition FMMMLayout.h:344
bool adjustPostRepStrengthDynamically() const
Returns the current setting of option adjustPostRepStrengthDynamically.
Definition FMMMLayout.h:654
int m_randomTries
The number of random tries.
Definition FMMMLayout.h:744
void import_EdgeAttributes(const Graph &G, const EdgeArray< double > &edgeLength, EdgeArray< EdgeAttributes > &E)
Imports for each edge e of G its desired length given via edgeLength.
FMMMOptions::QualityVsSpeed qualityVersusSpeed() const
Returns the current setting of option qualityVersusSpeed.
Definition FMMMLayout.h:371
void nmParticlesInLeaves(int n)
Sets the option nmParticlesInLeaves to n.
Definition FMMMLayout.h:708
double threshold() const
Returns the threshold for the stop criterion.
Definition FMMMLayout.h:560
int m_fineTuningIterations
The number of iterations for fine tuning.
Definition FMMMLayout.h:771
FMMMOptions::RepulsiveForcesMethod m_repulsiveForcesCalculation
Option for how to calculate repulsive forces.
Definition FMMMLayout.h:759
void resetOptions()
All parameter options (both low- and high-level) are set to the default values.
bool coolTemperature() const
Returns the current setting of option coolTemperature.
Definition FMMMLayout.h:582
void setSingleLevel(bool b)
Sets single level option, no multilevel hierarchy is created if b == true.
Definition FMMMLayout.h:335
double springStrength() const
Returns the strength of the springs.
Definition FMMMLayout.h:528
double max_radius(int iter)
Describes the max. radius of a move in one time step, depending on the number of iterations.
bool m_useHighLevelOptions
The option for using high-level options.
Definition FMMMLayout.h:720
FMMMOptions::ReducedTreeConstruction nmTreeConstruction() const
Returns the current setting of option nmTreeConstruction.
Definition FMMMLayout.h:687
FMMMOptions::InitialPlacementMult initialPlacementMult() const
Returns the current setting of option initialPlacementMult.
Definition FMMMLayout.h:507
void tipOverCCs(FMMMOptions::TipOver to)
Sets the option tipOverCCs to to.
Definition FMMMLayout.h:442
FMMMOptions::AllowedPositions m_allowedPositions
The option for allowed positions.
Definition FMMMLayout.h:730
void calculate_attractive_forces(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E, NodeArray< DPoint > &F_attr)
Calculates attractive forces for each node.
void resizeDrawing(bool b)
Sets the option resizeDrawing to b.
Definition FMMMLayout.h:620
int nmPrecision() const
Returns the precision p for the p-term multipole expansions.
Definition FMMMLayout.h:711
void nmPrecision(int p)
Sets the precision for the multipole expansions to p.
Definition FMMMLayout.h:714
double get_average_forcevector_length(Graph &G, NodeArray< DPoint > &F)
Calculates the average force on each node in the actual iteration, which is needed if StopCriterion i...
double unitEdgeLength() const
Returns the current setting of option unitEdgeLength.
Definition FMMMLayout.h:347
energybased::fmmm::NewMultipoleMethod NM
Class for repulsive force calculation.
Definition FMMMLayout.h:796
double postStrengthOfRepForces() const
Returns the strength of the repulsive forces in the postprocessing step.
Definition FMMMLayout.h:666
void threshold(double x)
Sets the threshold for the stop criterion to x.
Definition FMMMLayout.h:563
int stepsForRotatingComponents() const
Returns the current setting of option stepsForRotatingComponents.
Definition FMMMLayout.h:433
void maxIterFactor(int f)
Sets the option maxIterFactor to f.
Definition FMMMLayout.h:504
void make_simple_loopfree(const Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > E, Graph &G_reduced, NodeArray< NodeAttributes > &A_reduced, EdgeArray< EdgeAttributes > &E_reduced)
Creates a simple and loopfree copy of G and stores the corresponding node / edge attributes.
void resizingScalar(double s)
Sets the option resizingScalar to s.
Definition FMMMLayout.h:630
FMMMOptions::PageFormatType m_pageFormat
The option for the page format.
Definition FMMMLayout.h:721
void update_low_level_options_due_to_high_level_options_settings()
Updates several low level parameter options due to the settings of the high level parameter options.
void init_boxlength_and_cornercoordinate(Graph &G, NodeArray< NodeAttributes > &A)
The length of the computational box in the first iteration is set (down left corner is at (0,...
Rectangle calculate_bounding_rectangle(Graph &G, NodeArray< NodeAttributes > &A, int componenet_index)
The bounding rectangle of the componenet_index-th. component of G is returned.
void maxIterChange(FMMMOptions::MaxIterChange mic)
Sets the option maxIterChange to mic.
Definition FMMMLayout.h:493
void randSeed(int p)
Sets the seed of the random number generator.
Definition FMMMLayout.h:384
void edgeLengthMeasurement(FMMMOptions::EdgeLengthMeasurement elm)
Sets the option edgeLengthMeasurement to elm.
Definition FMMMLayout.h:395
void pageRatio(double r)
Sets the option pageRatio to r.
Definition FMMMLayout.h:426
FMMMOptions::StopCriterion stopCriterion() const
Returns the stop criterion.
Definition FMMMLayout.h:550
void unitEdgeLength(double x)
Sets the option unitEdgeLength to x.
Definition FMMMLayout.h:350
void forceScalingFactor(double f)
Sets the scaling factor for the forces to f.
Definition FMMMLayout.h:575
int m_frGridQuotient
The grid quotient.
Definition FMMMLayout.h:778
FMMMOptions::MaxIterChange maxIterChange() const
Returns the current setting of option maxIterChange.
Definition FMMMLayout.h:490
double m_springStrength
The strengths of springs.
Definition FMMMLayout.h:757
void initialPlacementForces(FMMMOptions::InitialPlacementForces ipf)
Sets the option initialPlacementForces to ipf.
Definition FMMMLayout.h:603
void maxIntPosExponent(int e)
Sets the option maxIntPosExponent to e.
Definition FMMMLayout.h:412
double m_repForcesStrength
The strength of repulsive forces.
Definition FMMMLayout.h:758
int randSeed() const
Returns the seed of the random number generator.
Definition FMMMLayout.h:387
FMMMOptions::GalaxyChoice galaxyChoice() const
Returns the current setting of option galaxyChoice.
Definition FMMMLayout.h:473
void call_MULTILEVEL_step_for_subGraph(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E)
Calls the multilevel step for subGraph G.
void create_initial_placement(Graph &G, NodeArray< NodeAttributes > &A)
The initial placements of the nodes are created by using initialPlacementForces().
FMMMOptions::StopCriterion m_stopCriterion
The stop criterion.
Definition FMMMLayout.h:760
double repForcesStrength() const
Returns the strength of the repulsive forces.
Definition FMMMLayout.h:534
void calculate_bounding_rectangles_of_components(List< Rectangle > &R, Graph G_sub[], NodeArray< NodeAttributes > A_sub[])
The bounding rectangles of all connected componenents of G are calculated and stored in R.
void export_node_positions(NodeArray< NodeAttributes > &A, List< Rectangle > &R, Graph G_sub[], NodeArray< NodeAttributes > A_sub[])
The positions of the nodes in the subgraphs are calculated by using the information stored in R and a...
int frGridQuotient() const
Returns the current setting of option frGridQuotient.
Definition FMMMLayout.h:681
FMMMLayout()
Creates an instance of the layout algorithm.
int m_minGraphSize
The option for minimal graph size.
Definition FMMMLayout.h:742
void useHighLevelOptions(bool uho)
Sets the option useHighLevelOptions to uho.
Definition FMMMLayout.h:332
void galaxyChoice(FMMMOptions::GalaxyChoice gc)
Sets the option galaxyChoice to gc.
Definition FMMMLayout.h:476
void adjustPostRepStrengthDynamically(bool b)
Sets the option adjustPostRepStrengthDynamically to b.
Definition FMMMLayout.h:657
bool resizeDrawing() const
Returns the current setting of option resizeDrawing.
Definition FMMMLayout.h:617
double max_integer_position
The maximum value for an integer position.
Definition FMMMLayout.h:786
void nmSmallCell(FMMMOptions::SmallestCellFinding scf)
Sets the option nmSmallCell to scf.
Definition FMMMLayout.h:698
bool useHighLevelOptions() const
Returns the current setting of option useHighLevelOptions.
Definition FMMMLayout.h:329
double m_resizingScalar
Parameter for resizing the drawing.
Definition FMMMLayout.h:770
void stopCriterion(FMMMOptions::StopCriterion rsc)
Sets the stop criterion to rsc.
Definition FMMMLayout.h:553
double fineTuneScalar() const
Returns the curent setting of option fineTuneScalar.
Definition FMMMLayout.h:643
FMMMOptions::InitialPlacementForces initialPlacementForces() const
Returns the current setting of option initialPlacementForces.
Definition FMMMLayout.h:598
void minDistCC(double x)
Sets the minimal distance between connected components to x.
Definition FMMMLayout.h:448
void export_NodeAttributes(Graph &G_reduced, NodeArray< NodeAttributes > &A_reduced, GraphAttributes &GA)
Exports for each node v in G_reduced the position of the original_node in GA.
double boxlength
Holds the length of the quadratic comput.
Definition FMMMLayout.h:789
double postSpringStrength() const
Returns the strength of the springs in the postprocessing step.
Definition FMMMLayout.h:660
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:960
void coolValue(double x)
Sets the option coolValue to x.
Definition FMMMLayout.h:595
void prevent_oscillations(Graph &G, NodeArray< DPoint > &F, NodeArray< DPoint > &last_node_movement, int iter)
Depending on the direction of last_node_movement[v], the length of the next displacement of node v is...
FMMMOptions::RepulsiveForcesMethod repulsiveForcesCalculation() const
Returns the current setting of option repulsiveForcesCalculation.
Definition FMMMLayout.h:540
FMMMOptions::TipOver m_tipOverCCs
Option for tip-over of connected components.
Definition FMMMLayout.h:736
FMMMOptions::PreSort m_presortCCs
The option for presorting connected components.
Definition FMMMLayout.h:738
void adjust_positions(const Graph &G, NodeArray< NodeAttributes > &A)
Adjust positions according to allowedPositions()
double coolValue() const
Returns the current setting of option coolValue.
Definition FMMMLayout.h:592
void fixedIterations(int n)
Sets the fixed number of iterations for the stop criterion to n.
Definition FMMMLayout.h:569
void add_attr_rep_forces(Graph &G, NodeArray< DPoint > &F_attr, NodeArray< DPoint > &F_rep, NodeArray< DPoint > &F, int iter, int fine_tuning_step)
Add attractive and repulsive forces for each node.
int m_randSeed
The random seed.
Definition FMMMLayout.h:728
virtual void call(GraphAttributes &GA) override
Calls the algorithm for graph GA and returns the layout information in GA.
void minGraphSize(int n)
Sets the option minGraphSize to n.
Definition FMMMLayout.h:470
int fineTuningIterations() const
Returns the number of iterations for fine tuning.
Definition FMMMLayout.h:633
void update_boxlength_and_cornercoordinate(Graph &G, NodeArray< NodeAttributes > &A)
Computes a new tight computational square-box.
int m_maxIterFactor
The factor used for decreasing MaxIterations.
Definition FMMMLayout.h:752
void calculate_forces(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E, NodeArray< DPoint > &F, NodeArray< DPoint > &F_attr, NodeArray< DPoint > &F_rep, NodeArray< DPoint > &last_node_movement, int iter, int fine_tuning_step)
The forces are calculated here.
void postStrengthOfRepForces(double x)
Sets the strength of the repulsive forces in the postprocessing step to x.
Definition FMMMLayout.h:669
bool newInitialPlacement() const
Returns the current setting of option newInitialPlacement.
Definition FMMMLayout.h:361
FMMMOptions::ForceModel m_forceModel
The used force model.
Definition FMMMLayout.h:756
void create_initial_placement_uniform_grid(const Graph &G, NodeArray< NodeAttributes > &A)
Places nodes uniformly in a grid.
void call_DIVIDE_ET_IMPERA_step(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E)
Calls the divide (decomposition into connected components) and impera (drawing and packing of the com...
void nmTreeConstruction(FMMMOptions::ReducedTreeConstruction rtc)
Sets the option nmTreeConstruction to rtc.
Definition FMMMLayout.h:690
FMMMOptions::TipOver tipOverCCs() const
Returns the current setting of option tipOverCCs.
Definition FMMMLayout.h:439
void update_edgelength(List< edge > &S, EdgeArray< double > &new_edgelength, EdgeArray< EdgeAttributes > &E_reduced)
Sets for each edge e of G_reduced in S its edgelength to new_edgelength[e].
double minDistCC() const
Returns the minimal distance between connected components.
Definition FMMMLayout.h:445
double time_total
The runtime (=CPU-time) of the algorithm in seconds.
Definition FMMMLayout.h:793
void springStrength(double x)
Sets the strength of the springs to x.
Definition FMMMLayout.h:531
void call(ClusterGraphAttributes &GA)
Calls the algorithm for clustered graph GA and returns the layout information in GA....
void allowedPositions(FMMMOptions::AllowedPositions ap)
Sets the option allowedPositions to ap.
Definition FMMMLayout.h:403
void set_radii(const Graph &G, NodeArray< NodeAttributes > &A)
The radii of the surrounding circles of the bounding boxes are computed.
void newInitialPlacement(bool nip)
Sets the option newInitialPlacement to nip.
Definition FMMMLayout.h:364
double m_unitEdgeLength
The unit edge length.
Definition FMMMLayout.h:722
double m_threshold
The threshold for the stop criterion.
Definition FMMMLayout.h:761
double m_postSpringStrength
The strength of springs during postprocessing.
Definition FMMMLayout.h:774
FMMMOptions::PageFormatType pageFormat() const
Returns the current setting of option pageFormat.
Definition FMMMLayout.h:341
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:934
void call_FORCE_CALCULATION_step(Graph &G, NodeArray< NodeAttributes > &A, EdgeArray< EdgeAttributes > &E, int act_level, int max_level)
Calls the force calculation step for G, A, E.
void calculate_repulsive_forces(Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Calculates repulsive forces for each node.
void init_last_node_movement(Graph &G, NodeArray< DPoint > &F, NodeArray< DPoint > &last_node_movement)
last_node_movement is initialized to F (used after first iteration).
void call(GraphAttributes &GA, const EdgeArray< double > &edgeLength, char *ps_file)
Extend algorithm call: Allows to pass desired lengths of the edges.
int randomTries() const
Returns the current setting of option randomTries.
Definition FMMMLayout.h:484
StopCriterion
Specifies the stop criterion.
InitialPlacementForces
Specifies how the initial placement is done.
QualityVsSpeed
Trade-off between run-time and quality.
Definition FMMMOptions.h:46
InitialPlacementMult
Specifies how the initial placement is generated.
AllowedPositions
Specifies which positions for a node are allowed.
Definition FMMMOptions.h:59
RepulsiveForcesMethod
Specifies how to calculate repulsive forces.
EdgeLengthMeasurement
Specifies how the length of an edge is measured.
Definition FMMMOptions.h:53
SmallestCellFinding
Specifies how to calculate the smallest quadratic cell that surrounds the particles of a node in the ...
ReducedTreeConstruction
Specifies how the reduced bucket quadtree is constructed.
MaxIterChange
Specifies how MaxIterations is changed in subsequent multilevels.
Definition FMMMOptions.h:95
ForceModel
Specifies the force model.
PreSort
Specifies how connected components are sorted before the packing algorithm is applied.
Definition FMMMOptions.h:80
TipOver
Specifies in which case it is allowed to tip over drawings of connected components.
Definition FMMMOptions.h:73
GalaxyChoice
Specifies how sun nodes of galaxies are selected.
Definition FMMMOptions.h:87
PageFormatType
Possible page formats.
Definition FMMMOptions.h:39
T m_y
The y-coordinate.
Definition geometry.h:87
T m_x
The x-coordinate.
Definition geometry.h:86
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Interface of general layout algorithms.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
helping data structure that stores the graphical attributes of an edge that are needed for the force-...
void calculate_approx_repulsive_forces(const Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Grid approximation of rep.forces for each node.
void calculate_exact_repulsive_forces(const Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Calculate exact rep. forces for each node.
void calculate_repulsive_forces(const Graph &G, NodeArray< NodeAttributes > &A, NodeArray< DPoint > &F_rep)
Calculate rep. forces for each node.
void deallocate_memory()
Dynamically allocated memory is freed here.
helping data structure that stores the graphical attributes of a node that are needed for the force-d...
Helping data structure for packing rectangles; The width, height and the position of the down left co...
Definition Rectangle.h:45
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
Declaration of class Rectangle.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition basic.h:52
The namespace for all OGDF objects.