Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

MMVariableEmbeddingInserter.h
Go to the documentation of this file.
1 
32 #pragma once
33 
37 #include <ogdf/basic/FaceArray.h>
38 #include <ogdf/basic/NodeSet.h>
39 #include <ogdf/basic/tuples.h>
40 
41 namespace ogdf {
42 
44 
48 {
49 public:
52 
53  // destruction
55 
56 
64  m_rrOption = rrOption;
65  }
66 
69  return m_rrOption;
70  }
71 
72 
74 
79  void percentMostCrossed(double percent) {
80  m_percentMostCrossed = percent;
81  }
82 
84  double percentMostCrossed() const {
85  return m_percentMostCrossed;
86  }
87 
88 
89 private:
90  class Block;
91  class ExpandedSkeleton;
92 
94 
95  struct AnchorNodeInfo {
96  AnchorNodeInfo() { m_adj_1 = m_adj_2 = nullptr; }
98  m_adj_1 = adj;
99  m_adj_2 = nullptr;
100  }
102  m_adj_1 = adj_1;
103  m_adj_2 = adj_2;
104  }
105 
108  };
109 
110  enum class PathType { pathToEdge = 0, pathToSource = 1, pathToTarget = 2 };
111 
112  struct Paths {
113  Paths() :
114  m_addPartLeft(3), m_addPartRight(3),
115  m_paths(3),
116  m_src(0,2,nullptr), m_tgt(0,2,nullptr),
117  m_pred(0,2,PathType::pathToEdge)
118  { }
119 
126  };
127 
137  virtual ReturnType doCall(
138  PlanRepExpansion &PG,
139  const List<edge> &origEdges,
140  const EdgeArray<bool> *forbiddenEdgeOrig) override;
141 
150  void collectAnchorNodes(
151  node v,
152  NodeSet<> &nodes,
153  const PlanRepExpansion::NodeSplit *nsParent) const;
154 
163  void findSourcesAndTargets(
164  node src, node tgt,
165  NodeSet<> &sources,
166  NodeSet<> &targets) const;
167 
174  void anchorNodes(
175  node vOrig,
176  NodeSet<> &nodes) const;
177 
178  static node commonDummy(
179  NodeSet<> &sources,
180  NodeSet<> &targets);
181 
191  void insert(List<Crossing> &eip, AnchorNodeInfo &vStart, AnchorNodeInfo &vEnd);
192 
193  node prepareAnchorNode(
194  const AnchorNodeInfo &anchor,
195  node vOrig,
196  bool isSrc,
197  edge &eExtra);
198 
199  void preprocessInsertionPath(
200  const AnchorNodeInfo &srcInfo,
201  const AnchorNodeInfo &tgtInfo,
202  node srcOrig,
203  node tgtOrig,
204  node &src,
205  node &tgt,
206  edge &eSrc,
207  edge &eTgt);
208 
209  node preparePath(
210  node vAnchor,
211  adjEntry adjPath,
212  bool bOrigEdge,
213  node vOrig);
214 
215  void findPseudos(
216  node vDummy,
217  adjEntry adjSrc,
218  AnchorNodeInfo &infoSrc,
219  SListPure<node> &pseudos);
220 
221  void insertWithCommonDummy(
222  edge eOrig,
223  node vDummy,
224  node &src,
225  node &tgt);
226 
236  bool dfsVertex(node v,
237  int parent,
238  List<Crossing> &eip,
239  AnchorNodeInfo &vStart,
240  AnchorNodeInfo &vEnd);
241 
252  bool dfsBlock(int i,
253  node parent,
254  node &repS,
255  List<Crossing> &eip,
256  AnchorNodeInfo &vStart,
257  AnchorNodeInfo &vEnd);
258 
259  bool pathSearch(node v, edge parent, const Block &BC, List<edge> &path);
260 
269  void blockInsert(
270  Block &BC,
271  List<Crossing> &L,
272  AnchorNodeInfo &srcInfo,
273  AnchorNodeInfo &tgtInfo);
274 
275  void buildSubpath(
276  node v,
277  edge eIn,
278  edge eOut,
279  Paths &paths,
280  bool &bPathToEdge,
281  bool &bPathToSrc,
282  bool &bPathToTgt,
283  ExpandedSkeleton &Exp);
284 
285  void contractSplitIfReq(node u);
286  void convertDummy(
287  node u,
288  node vOrig,
290 
291  void writeEip(const List<Crossing> &eip);
292 
295 
297 
300 
305 
308 };
309 
310 }
Representation of a node split in a planarized expansion.
PlanRepExpansion * m_pPG
Pointer to the planarized expansion.
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
Postprocessing for (so far) inserted edges after each edge insertion.
double percentMostCrossed() const
Returns the current setting of the option percentMostCrossed.
NodeArray< SList< int > > m_compV
The list of blocks containing a node v.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Singly linked lists.
Definition: SList.h:38
Planarized representations (of a connected component) of a graph.
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
declaration and implementation of FaceArray class
Array< SList< node > > m_nodeB
The list of nodes in block i.
Declaration of CombinatorialEmbedding and face.
void percentMostCrossed(double percent)
Sets the portion of most crossed edges used during postprocessing.
Definition of RemoveReinsertType (used for postprocessing in edge insertion algorithms).
Array< SList< edge > > m_edgeB
The list of edges in block i.
NodeSet * m_pTargets
The set of possible end nodes of an insertion path.
ReturnType
The return type of a module.
Definition: Module.h:51
NodeSet * m_pSources
The set of possible start nodes of an insertion path.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
Interface for minor-monotone edge insertion algorithms.
NodeArray< node > m_GtoBC
Maps a node in the planarized expansion to the corresponding node in block.
Class representing idea of Blocks used in GlobalSifting and GridSifting algorithms.
Definition: BlockOrder.h:72
Class for the representation of edges.
Definition: Graph_d.h:292
void removeReinsert(RemoveReinsertType rrOption)
Sets the remove-reinsert option for postprocessing.
Minor-monotone edge insertion with variable embedding.
Class for the representation of nodes.
Definition: Graph_d.h:169
double m_percentMostCrossed
The percentMostCrossed option.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
bool m_conFinished
Stores if a possible target node in a block has already been found.
Node sets.
Definition: NodeSet.h:54
The namespace for all OGDF objects.
Declaration and implementation of ogdf::NodeSet.
RemoveReinsertType removeReinsert() const
Returns the current setting of the remove-reinsert option.
Class for adjacency list elements.
Definition: Graph_d.h:79
RemoveReinsertType m_rrOption
The remove-reinsert option.
#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.