Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

CrossingMinimalPosition.h
Go to the documentation of this file.
1 
46 #pragma once
47 
48 #include <ogdf/basic/Graph.h>
49 #include <ogdf/basic/basic.h>
50 #include <ogdf/basic/geometry.h>
52 
53 #include <random>
54 
55 #ifdef OGDF_INCLUDE_CGAL
56 # include <CGAL/Gmpq.h>
57 #endif
58 
59 namespace ogdf {
60 class GraphAttributes;
61 
68 template<typename FT>
70 public: // ~Initialize vertex position module
72 
74 
77  DPoint call(GraphAttributes& GA, node v);
78 
80  m_number_of_edge_samples = -1;
81  m_number_of_point_samples = 1;
82  m_neighborhood_threshold = -1;
83  m_within_region = true;
84  }
85 
90  void setSampleSize(const unsigned int number_of_edge_samples,
91  const unsigned int number_of_point_samples) {
92  m_number_of_edge_samples = number_of_edge_samples;
93  m_number_of_point_samples = number_of_point_samples;
94  }
95 
99  void computePositionInOptimalRegion(const bool within_region) {
100  m_within_region = within_region;
101  }
102 
107  void setNeighboorhoodThreshold(const unsigned int threshold) {
108  m_neighborhood_threshold = threshold;
109  }
110 
111  unsigned int neighborThreshold() const { return m_neighborhood_threshold; }
112 
113 protected:
114  unsigned int m_number_of_edge_samples = -1;
115  unsigned int m_number_of_point_samples = 1;
116  unsigned int m_neighborhood_threshold = 100;
117  bool m_within_region = true;
118 
119  std::mt19937_64 rnd;
120 };
121 
123 
124 #ifdef OGDF_INCLUDE_CGAL
125 using CrossingMinimalPositionPrecise = CrossingMinimalPosition<CGAL::Gmpq>;
126 #endif
127 
128 
130 public:
132  m_number_of_edge_samples = 512;
133  m_number_of_point_samples = 1000;
134  m_neighborhood_threshold = 100;
135  m_within_region = true;
136  }
137 };
138 
140 public:
142  m_number_of_edge_samples = 512;
143  m_number_of_point_samples = 1000;
144  m_neighborhood_threshold = 100;
145  m_within_region = false;
146  }
147 };
148 
149 
150 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
VertexPositionModule.h
Optimal Vertex Position interface.
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::CrossingMinimalPosition::setSampleSize
void setSampleSize(const unsigned int number_of_edge_samples, const unsigned int number_of_point_samples)
set the number of edges that are randomly selected to compute the new vertex postion and the number o...
Definition: CrossingMinimalPosition.h:90
ogdf::CrossingMinimalPosition
Compute a crossing minimal position for a vertex.
Definition: CrossingMinimalPosition.h:69
ogdf::CrossingMinimalPositionApxWeighted::CrossingMinimalPositionApxWeighted
CrossingMinimalPositionApxWeighted()
Definition: CrossingMinimalPosition.h:141
ogdf::CrossingMinimalPosition::~CrossingMinimalPosition
~CrossingMinimalPosition()
Definition: CrossingMinimalPosition.h:73
ogdf::VertexPositionModule
Interface for computing a good / optimal vertex position.
Definition: VertexPositionModule.h:44
ogdf::CrossingMinimalPosition::CrossingMinimalPosition
CrossingMinimalPosition()
Definition: CrossingMinimalPosition.h:71
ogdf::CrossingMinimalPositionApx::CrossingMinimalPositionApx
CrossingMinimalPositionApx()
Definition: CrossingMinimalPosition.h:131
basic.h
Basic declarations, included by all source files.
ogdf::CrossingMinimalPosition::setNeighboorhoodThreshold
void setNeighboorhoodThreshold(const unsigned int threshold)
The algortihm randomly partitions the neighbor of the vertex into blocks of size threshold.
Definition: CrossingMinimalPosition.h:107
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::CrossingMinimalPosition::neighborThreshold
unsigned int neighborThreshold() const
Definition: CrossingMinimalPosition.h:111
ogdf::CrossingMinimalPosition::rnd
std::mt19937_64 rnd
Definition: CrossingMinimalPosition.h:119
ogdf::CrossingMinimalPositionApxWeighted
Definition: CrossingMinimalPosition.h:139
ogdf::CrossingMinimalPosition::computePositionInOptimalRegion
void computePositionInOptimalRegion(const bool within_region)
If the value within_region is set to false, the algorithm samples points outside the optimal region.
Definition: CrossingMinimalPosition.h:99
ogdf::CrossingMinimalPositionApx
Definition: CrossingMinimalPosition.h:129
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::CrossingMinimalPosition::setExactComputation
void setExactComputation()
Definition: CrossingMinimalPosition.h:79