Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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(
306  PlanRepExpansion &PG);
307 
309  edge e,
310  const PlanRepExpansion &PG,
311  const EdgeArray<bool> *forbiddenEdgeOrig) const
312  {
313  if(forbiddenEdgeOrig == nullptr)
314  return false;
315 
316  if(e->source() == m_vS || e->target() == m_vT)
317  return false;
318 
319  if(m_primalNode[e->source()] != nullptr)
320  return false;
321  if(m_primalNode[e->target()] != nullptr)
322  return false;
323 
324  adjEntry adj = m_primalAdj[e];
325  if(adj == nullptr) return false;
326 
327  edge eOrig = PG.originalEdge(adj->theEdge());
328  if(eOrig != nullptr) {
329 #if 0
330  if((*forbiddenEdgeOrig)[eOrig] == true)
331  cout << "forbidden: " << eOrig << ", dual: " << e << endl;
332 #endif
333  return (*forbiddenEdgeOrig)[eOrig];
334  } else return false;
335  }
336 
337  void drawDual(
338  const PlanRepExpansion &PG,
339  const EdgeArray<bool> *forbiddenEdgeOrig);
340 
343 
351 
354  int m_maxCost;
355 
359 };
360 
361 } // end namespace ogdf
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:327
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:95
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:472
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).
Node sets.
Definition: NodeSet.h:136
Simple face sets.
Definition: FaceSet.h:56
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:423
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:291
int m_maxCost
The maximal cost of an edge in the search network + 1.
Class for the representation of nodes.
Definition: Graph_d.h:167
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:249
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:325
Face sets.
Definition: FaceSet.h:138
The namespace for all OGDF objects.
RemoveReinsertType m_rrOption
The remove-reinsert option.
Declaration and implementation of class NodeSetSimple, NodeSetPure and NodeSet.
Combinatorial embeddings of planar graphs with modification functionality.
Class for adjacency list elements.
Definition: Graph_d.h:78
declaration and implementation of class FaceSetSimple, FaceSetPure and 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.