Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

MMFixedEmbeddingInserter.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/FaceArray.h>
36 #include <ogdf/basic/FaceSet.h>
37 #include <ogdf/basic/NodeSet.h>
38 #include <ogdf/basic/tuples.h>
41 
42 namespace ogdf {
43 
45 
49 public:
52 
53  // destruction
55 
63  m_rrOption = rrOption;
64  }
65 
67  RemoveReinsertType removeReinsert() const { return m_rrOption; }
68 
70 
75  void percentMostCrossed(double percent) { m_percentMostCrossed = percent; }
76 
78  double percentMostCrossed() const { return m_percentMostCrossed; }
79 
80 
81 private:
91  virtual ReturnType doCall(PlanRepExpansion& PG, const List<edge>& origEdges,
92  const EdgeArray<bool>* forbiddenEdgeOrig) override;
93 
95 
99  void constructDual(const PlanRepExpansion& PG, const CombinatorialEmbedding& E);
100 
102 
117  void findShortestPath(const PlanRepExpansion& PG, const CombinatorialEmbedding& E,
118  const List<node>& sources, const List<node>& targets,
119  List<Tuple2<adjEntry, adjEntry>>& crossed, const EdgeArray<bool>* forbiddenEdgeOrig);
120 
121  void prepareAnchorNode(PlanRepExpansion& PG, CombinatorialEmbedding& E, adjEntry& adjStart,
122  node srcOrig);
123 
124  void preprocessInsertionPath(PlanRepExpansion& PG, CombinatorialEmbedding& E, node srcOrig,
125  node tgtOrig,
126  //PlanRepExpansion::nodeSplit ns,
127  List<Tuple2<adjEntry, adjEntry>>& crossed);
128 
144  void insertEdge(PlanRepExpansion& PG, CombinatorialEmbedding& E, edge eOrig, node srcOrig,
145  node tgtOrig, PlanRepExpansion::NodeSplit* nodeSplit,
146  List<Tuple2<adjEntry, adjEntry>>& crossed);
147 
160  void removeEdge(PlanRepExpansion& PG, CombinatorialEmbedding& E, edge eOrig,
161  PlanRepExpansion::NodeSplit* nodeSplit, node& oldSrc, node& oldTgt);
162 
170  void insertDualEdge(node vDual, adjEntry adj, const CombinatorialEmbedding& E);
171 
178  void insertDualEdges(node v, const CombinatorialEmbedding& E);
179 
187  void contractSplit(PlanRepExpansion& PG, CombinatorialEmbedding& E,
188  PlanRepExpansion::NodeSplit* nodeSplit);
189 
199  void contractSplitIfReq(PlanRepExpansion& PG, CombinatorialEmbedding& E, node u,
200  const PlanRepExpansion::nodeSplit nsCurrent = nullptr);
201 
205  void convertDummy(PlanRepExpansion& PG, CombinatorialEmbedding& E, node u, node vOrig,
207 
217  void collectAnchorNodes(node v, NodeSet<>& nodes, const PlanRepExpansion::NodeSplit* nsParent,
218  const PlanRepExpansion& PG) const;
219 
227  void anchorNodes(node vOrig, NodeSet<>& nodes, const PlanRepExpansion& PG) const;
228 
238  void findSourcesAndTargets(node src, node tgt, NodeSet<>& sources, NodeSet<>& targets,
239  const PlanRepExpansion& PG) const;
240 
247  node commonDummy(NodeSet<>& sources, NodeSet<>& targets);
248 
250  bool checkDualGraph(PlanRepExpansion& PG, const CombinatorialEmbedding& E) const;
251 
252  bool checkSplitDeg(PlanRepExpansion& PG) const;
253 
255  const EdgeArray<bool>* forbiddenEdgeOrig) const {
256  if (forbiddenEdgeOrig == nullptr) {
257  return false;
258  }
259 
260  if (e->source() == m_vS || e->target() == m_vT) {
261  return false;
262  }
263 
264  if (m_primalNode[e->source()] != nullptr) {
265  return false;
266  }
267  if (m_primalNode[e->target()] != nullptr) {
268  return false;
269  }
270 
271  adjEntry adj = m_primalAdj[e];
272  if (adj == nullptr) {
273  return false;
274  }
275 
276  edge eOrig = PG.originalEdge(adj->theEdge());
277  if (eOrig != nullptr) {
278 #if 0
279  if((*forbiddenEdgeOrig)[eOrig]) {
280  std::cout << "forbidden: " << eOrig << ", dual: " << e << std::endl;
281  }
282 #endif
283  return (*forbiddenEdgeOrig)[eOrig];
284  } else {
285  return false;
286  }
287  }
288 
289  void drawDual(const PlanRepExpansion& PG, const EdgeArray<bool>* forbiddenEdgeOrig);
290 
293 
301 
304  int m_maxCost;
305 
309 };
310 
311 }
MMEdgeInsertionModule.h
Declaration of interface for minor-monotone edge insertion algorithms.
NodeSet.h
Declaration and implementation of ogdf::NodeSet.
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::MMFixedEmbeddingInserter::m_dualEdge
AdjEntryArray< edge > m_dualEdge
The dual edge corresponding to crossing the adjacency entry.
Definition: MMFixedEmbeddingInserter.h:299
ogdf::MMFixedEmbeddingInserter::percentMostCrossed
double percentMostCrossed() const
Returns the current setting of the option percentMostCrossed.
Definition: MMFixedEmbeddingInserter.h:78
FaceSet.h
Declaration and implementation of ogdf::FaceSet.
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:54
ogdf::MMFixedEmbeddingInserter::m_dualOfFace
FaceArray< node > m_dualOfFace
The node in dual corresponding to face in primal.
Definition: MMFixedEmbeddingInserter.h:295
ogdf::MMFixedEmbeddingInserter::m_newFaces
FaceSet< false > * m_newFaces
Definition: MMFixedEmbeddingInserter.h:307
ogdf::Tuple2
Tuples of two elements (2-tuples).
Definition: tuples.h:46
ogdf::PlanRepExpansion
Planarized representations (of a connected component) of a graph.
Definition: PlanRepExpansion.h:52
RemoveReinsertType.h
Definition of RemoveReinsertType (used for postprocessing in edge insertion algorithms).
ogdf::NodeSet
Node sets.
Definition: GraphSets.h:52
ogdf::MMFixedEmbeddingInserter::percentMostCrossed
void percentMostCrossed(double percent)
Sets the portion of most crossed edges used during postprocessing.
Definition: MMFixedEmbeddingInserter.h:75
ogdf::MMFixedEmbeddingInserter::m_dualOfNode
NodeArray< node > m_dualOfNode
The node in dual corresponding to node in primal.
Definition: MMFixedEmbeddingInserter.h:296
FaceArray.h
declaration and implementation of FaceArray class
ogdf::MMFixedEmbeddingInserter::m_vT
node m_vT
Represents the end node for the path search.
Definition: MMFixedEmbeddingInserter.h:303
ogdf::MMFixedEmbeddingInserter::m_maxCost
int m_maxCost
The maximal cost of an edge in the search network + 1.
Definition: MMFixedEmbeddingInserter.h:304
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
ogdf::MMFixedEmbeddingInserter::m_delFaces
FaceSet< false > * m_delFaces
Definition: MMFixedEmbeddingInserter.h:306
ogdf::AdjElement::theEdge
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition: Graph_d.h:153
ogdf::MMFixedEmbeddingInserter::m_percentMostCrossed
double m_percentMostCrossed
The percentMostCrossed option.
Definition: MMFixedEmbeddingInserter.h:292
ogdf::MMFixedEmbeddingInserter::m_mergedNodes
NodeSet< false > * m_mergedNodes
Definition: MMFixedEmbeddingInserter.h:308
ogdf::MMFixedEmbeddingInserter::m_dual
Graph m_dual
The search network (extended dual graph).
Definition: MMFixedEmbeddingInserter.h:294
ogdf::FaceSet< false >
ogdf::MMEdgeInsertionModule
Interface for minor-monotone edge insertion algorithms.
Definition: MMEdgeInsertionModule.h:45
ogdf::EdgeElement::source
node source() const
Returns the source node of the edge.
Definition: Graph_d.h:391
ogdf::PlanRepExpansion::originalEdge
edge originalEdge(edge e) const
Returns the original edge of e, or 0 if e has none (e.g., e belongs to a node split).
Definition: PlanRepExpansion.h:141
ogdf::List< edge >
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::FaceArrayBase
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Definition: CombinatorialEmbedding.h:172
ogdf::MMFixedEmbeddingInserter::m_vS
node m_vS
Represents the start node for the path search.
Definition: MMFixedEmbeddingInserter.h:302
ogdf::MMFixedEmbeddingInserter::origOfDualForbidden
bool origOfDualForbidden(edge e, const PlanRepExpansion &PG, const EdgeArray< bool > *forbiddenEdgeOrig) const
Definition: MMFixedEmbeddingInserter.h:254
ogdf::MMFixedEmbeddingInserter::m_primalAdj
EdgeArray< adjEntry > m_primalAdj
The adjacency entry in primal graph corresponding to edge in dual.
Definition: MMFixedEmbeddingInserter.h:298
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
ogdf::MMFixedEmbeddingInserter::~MMFixedEmbeddingInserter
virtual ~MMFixedEmbeddingInserter()
Definition: MMFixedEmbeddingInserter.h:54
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::MMFixedEmbeddingInserter::removeReinsert
void removeReinsert(RemoveReinsertType rrOption)
Sets the remove-reinsert option for postprocessing.
Definition: MMFixedEmbeddingInserter.h:61
ogdf::CombinatorialEmbedding
Combinatorial embeddings of planar graphs with modification functionality.
Definition: CombinatorialEmbedding.h:397
ogdf::RemoveReinsertType
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
Definition: RemoveReinsertType.h:41
ogdf::PlanRepExpansion::NodeSplit
Representation of a node split in a planarized expansion.
Definition: PlanRepExpansion.h:75
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:356
ogdf::MMFixedEmbeddingInserter
Minor-monotone edge insertion with fixed embedding.
Definition: MMFixedEmbeddingInserter.h:48
ogdf::MMFixedEmbeddingInserter::m_primalNode
NodeArray< node > m_primalNode
The node in PG corresponding to dual node (0 if face).
Definition: MMFixedEmbeddingInserter.h:297
ogdf::MMFixedEmbeddingInserter::removeReinsert
RemoveReinsertType removeReinsert() const
Returns the current setting of the remove-reinsert option.
Definition: MMFixedEmbeddingInserter.h:67
ogdf::RemoveReinsertType::IncInserted
@ IncInserted
Postprocessing for (so far) inserted edges after each edge insertion.
ogdf::EdgeElement::target
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:394
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
tuples.h
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
ogdf::MMFixedEmbeddingInserter::m_dualCost
EdgeArray< int > m_dualCost
The cost of an edge in the seach network.
Definition: MMFixedEmbeddingInserter.h:300
ogdf::MMFixedEmbeddingInserter::m_rrOption
RemoveReinsertType m_rrOption
The remove-reinsert option.
Definition: MMFixedEmbeddingInserter.h:291
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709