Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

MMFixedEmbeddingInserter.h
Go to the documentation of this file.
1 
32 #pragma once
33 
37 #include <ogdf/basic/FaceArray.h>
38 #include <ogdf/basic/FaceSet.h>
39 #include <ogdf/basic/NodeSet.h>
40 #include <ogdf/basic/tuples.h>
41 
42 namespace ogdf {
43 
45 
49 {
50 public:
53 
54  // destruction
56 
57 
65  m_rrOption = rrOption;
66  }
67 
70  return m_rrOption;
71  }
72 
73 
75 
80  void percentMostCrossed(double percent) {
81  m_percentMostCrossed = percent;
82  }
83 
85  double percentMostCrossed() const {
86  return m_percentMostCrossed;
87  }
88 
89 
90 private:
100  virtual ReturnType doCall(
101  PlanRepExpansion &PG,
102  const List<edge> &origEdges,
103  const EdgeArray<bool> *forbiddenEdgeOrig) override;
104 
106 
110  void constructDual(
111  const PlanRepExpansion &PG,
112  const CombinatorialEmbedding &E);
113 
115 
130  void findShortestPath(
131  const PlanRepExpansion &PG,
132  const CombinatorialEmbedding &E,
133  const List<node> &sources,
134  const List<node> &targets,
135  List<Tuple2<adjEntry,adjEntry> > &crossed,
136  const EdgeArray<bool> *forbiddenEdgeOrig);
137 
138  void prepareAnchorNode(
139  PlanRepExpansion &PG,
141  adjEntry &adjStart,
142  node srcOrig);
143 
144  void preprocessInsertionPath(
145  PlanRepExpansion &PG,
147  node srcOrig,
148  node tgtOrig,
149  //PlanRepExpansion::nodeSplit ns,
150  List<Tuple2<adjEntry,adjEntry> > &crossed);
151 
167  void insertEdge(
168  PlanRepExpansion &PG,
170  edge eOrig,
171  node srcOrig,
172  node tgtOrig,
173  PlanRepExpansion::NodeSplit *nodeSplit,
174  List<Tuple2<adjEntry,adjEntry> > &crossed);
175 
188  void removeEdge(
189  PlanRepExpansion &PG,
191  edge eOrig,
192  PlanRepExpansion::NodeSplit *nodeSplit,
193  node &oldSrc,
194  node &oldTgt);
195 
203  void insertDualEdge(node vDual, adjEntry adj, const CombinatorialEmbedding &E);
204 
211  void insertDualEdges(node v, const CombinatorialEmbedding &E);
212 
220  void contractSplit(
221  PlanRepExpansion &PG,
223  PlanRepExpansion::NodeSplit *nodeSplit);
224 
234  void contractSplitIfReq(
235  PlanRepExpansion &PG,
237  node u,
238  const PlanRepExpansion::nodeSplit nsCurrent = nullptr);
239 
243  void convertDummy(
244  PlanRepExpansion &PG,
246  node u,
247  node vOrig,
249 
259  void collectAnchorNodes(
260  node v,
261  NodeSet<> &nodes,
262  const PlanRepExpansion::NodeSplit *nsParent,
263  const PlanRepExpansion &PG) const;
264 
272  void anchorNodes(
273  node vOrig,
274  NodeSet<> &nodes,
275  const PlanRepExpansion &PG) const;
276 
286  void findSourcesAndTargets(
287  node src, node tgt,
288  NodeSet<> &sources,
289  NodeSet<> &targets,
290  const PlanRepExpansion &PG) const;
291 
298  node commonDummy(
299  NodeSet<> &sources,
300  NodeSet<> &targets);
301 
303  bool checkDualGraph(PlanRepExpansion &PG, const CombinatorialEmbedding &E) const;
304 
305  bool checkSplitDeg(PlanRepExpansion &PG) const;
306 
308  edge e,
309  const PlanRepExpansion &PG,
310  const EdgeArray<bool> *forbiddenEdgeOrig) const
311  {
312  if(forbiddenEdgeOrig == nullptr)
313  return false;
314 
315  if(e->source() == m_vS || e->target() == m_vT)
316  return false;
317 
318  if(m_primalNode[e->source()] != nullptr)
319  return false;
320  if(m_primalNode[e->target()] != nullptr)
321  return false;
322 
323  adjEntry adj = m_primalAdj[e];
324  if(adj == nullptr) return false;
325 
326  edge eOrig = PG.originalEdge(adj->theEdge());
327  if(eOrig != nullptr) {
328 #if 0
329  if((*forbiddenEdgeOrig)[eOrig])
330  std::cout << "forbidden: " << eOrig << ", dual: " << e << std::endl;
331 #endif
332  return (*forbiddenEdgeOrig)[eOrig];
333  } else return false;
334  }
335 
336  void drawDual(
337  const PlanRepExpansion &PG,
338  const EdgeArray<bool> *forbiddenEdgeOrig);
339 
342 
350 
353  int m_maxCost;
354 
358 };
359 
360 }
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:328
Representation of a node split in a planarized expansion.
FaceArray< node > m_dualOfFace
The node in dual corresponding to face in primal.
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition: Graph_d.h:96
Postprocessing for (so far) inserted edges after each edge insertion.
void removeReinsert(RemoveReinsertType rrOption)
Sets the remove-reinsert option for postprocessing.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
NodeArray< node > m_primalNode
The node in PG corresponding to dual node (0 if face).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
AdjEntryArray< edge > m_dualEdge
The dual edge corresponding to crossing the adjacency entry.
Planarized representations (of a connected component) of a graph.
EdgeArray< adjEntry > m_primalAdj
The adjacency entry in primal graph corresponding to edge in dual.
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
Dynamic arrays indexed with adjacency entries.
declaration and implementation of FaceArray class
Declaration of CombinatorialEmbedding and face.
Definition of RemoveReinsertType (used for postprocessing in edge insertion algorithms).
void percentMostCrossed(double percent)
Sets the portion of most crossed edges used during postprocessing.
double percentMostCrossed() const
Returns the current setting of the option percentMostCrossed.
ReturnType
The return type of a module.
Definition: Module.h:51
node m_vT
Represents the end node for the path search.
Dynamic arrays indexed with faces of a combinatorial embedding.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
Interface for minor-monotone edge insertion algorithms.
Tuples of two elements (2-tuples).
Definition: tuples.h:46
node m_vS
Represents the start node for the path search.
EdgeArray< int > m_dualCost
The cost of an edge in the seach network.
NodeArray< node > m_dualOfNode
The node in dual corresponding to node in primal.
Class for the representation of edges.
Definition: Graph_d.h:292
int m_maxCost
The maximal cost of an edge in the search network + 1.
Class for the representation of nodes.
Definition: Graph_d.h:169
bool origOfDualForbidden(edge e, const PlanRepExpansion &PG, const EdgeArray< bool > *forbiddenEdgeOrig) const
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
Minor-monotone edge insertion with fixed embedding.
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).
Graph m_dual
The search network (extended dual graph).
Node sets.
Definition: NodeSet.h:54
double m_percentMostCrossed
The percentMostCrossed option.
RemoveReinsertType removeReinsert() const
Returns the current setting of the remove-reinsert option.
node source() const
Returns the source node of the edge.
Definition: Graph_d.h:326
The namespace for all OGDF objects.
RemoveReinsertType m_rrOption
The remove-reinsert option.
Declaration and implementation of ogdf::NodeSet.
Combinatorial embeddings of planar graphs with modification functionality.
Class for adjacency list elements.
Definition: Graph_d.h:79
Declaration and implementation of ogdf::FaceSet.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:41
Declaration of interface for minor-monotone edge insertion algorithms.