Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

MMVariableEmbeddingInserter.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/Graph.h>
36 #include <ogdf/basic/List.h>
37 #include <ogdf/basic/SList.h>
38 #include <ogdf/basic/basic.h>
42 
43 namespace ogdf {
44 class NodeSet;
45 
47 
51 public:
54 
55  // destruction
57 
65  m_rrOption = rrOption;
66  }
67 
69  RemoveReinsertType removeReinsert() const { return m_rrOption; }
70 
72 
77  void percentMostCrossed(double percent) { m_percentMostCrossed = percent; }
78 
80  double percentMostCrossed() const { return m_percentMostCrossed; }
81 
82 
83 private:
84  class Block;
85  class ExpandedSkeleton;
86 
88 
89  struct AnchorNodeInfo {
90  AnchorNodeInfo() { m_adj_1 = m_adj_2 = nullptr; }
91 
93  m_adj_1 = adj;
94  m_adj_2 = nullptr;
95  }
96 
98  m_adj_1 = adj_1;
99  m_adj_2 = adj_2;
100  }
101 
104  };
105 
106  enum class PathType { pathToEdge = 0, pathToSource = 1, pathToTarget = 2 };
107 
108  struct Paths {
110  : m_addPartLeft(3)
111  , m_addPartRight(3)
112  , m_paths(3)
113  , m_src(0, 2, nullptr)
114  , m_tgt(0, 2, nullptr)
115  , m_pred(0, 2, PathType::pathToEdge) { }
116 
123  };
124 
134  virtual ReturnType doCall(PlanRepExpansion& PG, const List<edge>& origEdges,
135  const EdgeArray<bool>* forbiddenEdgeOrig) override;
136 
145  void collectAnchorNodes(node v, NodeSet& nodes, const PlanRepExpansion::NodeSplit* nsParent) const;
146 
155  void findSourcesAndTargets(node src, node tgt, NodeSet& sources, NodeSet& targets) const;
156 
163  void anchorNodes(node vOrig, NodeSet& nodes) const;
164 
165  static node commonDummy(NodeSet& sources, NodeSet& targets);
166 
176  void insert(List<Crossing>& eip, AnchorNodeInfo& vStart, AnchorNodeInfo& vEnd);
177 
178  node prepareAnchorNode(const AnchorNodeInfo& anchor, node vOrig, bool isSrc, edge& eExtra);
179 
180  void preprocessInsertionPath(const AnchorNodeInfo& srcInfo, const AnchorNodeInfo& tgtInfo,
181  node srcOrig, node tgtOrig, node& src, node& tgt, edge& eSrc, edge& eTgt);
182 
183  node preparePath(node vAnchor, adjEntry adjPath, bool bOrigEdge, node vOrig);
184 
185  void findPseudos(node vDummy, adjEntry adjSrc, AnchorNodeInfo& infoSrc, SListPure<node>& pseudos);
186 
187  void insertWithCommonDummy(edge eOrig, node vDummy, node& src, node& tgt);
188 
198  bool dfsVertex(node v, int parent, List<Crossing>& eip, AnchorNodeInfo& vStart,
199  AnchorNodeInfo& vEnd);
200 
211  bool dfsBlock(int i, node parent, node& repS, List<Crossing>& eip, AnchorNodeInfo& vStart,
212  AnchorNodeInfo& vEnd);
213 
214  bool pathSearch(node v, edge parent, const Block& BC, List<edge>& path);
215 
224  void blockInsert(Block& BC, List<Crossing>& L, AnchorNodeInfo& srcInfo, AnchorNodeInfo& tgtInfo);
225 
226  void buildSubpath(node v, edge eIn, edge eOut, Paths& paths, bool& bPathToEdge,
227  bool& bPathToSrc, bool& bPathToTgt, ExpandedSkeleton& Exp);
228 
229  void contractSplitIfReq(node u);
230  void convertDummy(node u, node vOrig, PlanRepExpansion::nodeSplit ns_0);
231 
232  void writeEip(const List<Crossing>& eip);
233 
236 
238 
241 
246 
249 };
250 
251 }
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::m_adj_2
adjEntry m_adj_2
Definition: MMVariableEmbeddingInserter.h:103
MMEdgeInsertionModule.h
Declaration of interface for minor-monotone edge insertion algorithms.
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::MMVariableEmbeddingInserter::Paths::m_src
Array< AnchorNodeInfo > m_src
Definition: MMVariableEmbeddingInserter.h:120
ogdf::PlanRepExpansion::Crossing
Definition: PlanRepExpansion.h:60
ogdf::MMVariableEmbeddingInserter::Paths::m_addPartLeft
Array< SList< adjEntry > > m_addPartLeft
Definition: MMVariableEmbeddingInserter.h:117
Graph.h
Includes declaration of graph class.
ogdf::MMVariableEmbeddingInserter::percentMostCrossed
void percentMostCrossed(double percent)
Sets the portion of most crossed edges used during postprocessing.
Definition: MMVariableEmbeddingInserter.h:77
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::AnchorNodeInfo
AnchorNodeInfo(adjEntry adj_1, adjEntry adj_2)
Definition: MMVariableEmbeddingInserter.h:97
ogdf::MMVariableEmbeddingInserter
Minor-monotone edge insertion with variable embedding.
Definition: MMVariableEmbeddingInserter.h:50
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::m_adj_1
adjEntry m_adj_1
Definition: MMVariableEmbeddingInserter.h:102
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:66
ogdf::MMVariableEmbeddingInserter::m_pTargets
NodeSet * m_pTargets
The set of possible end nodes of an insertion path.
Definition: MMVariableEmbeddingInserter.h:240
ogdf::MMVariableEmbeddingInserter::removeReinsert
RemoveReinsertType removeReinsert() const
Returns the current setting of the remove-reinsert option.
Definition: MMVariableEmbeddingInserter.h:69
ogdf::MMVariableEmbeddingInserter::Paths::m_pred
Array< PathType > m_pred
Definition: MMVariableEmbeddingInserter.h:122
ogdf::MMVariableEmbeddingInserter::Paths
Definition: MMVariableEmbeddingInserter.h:108
ogdf::PlanRepExpansion
Planarized representations (of a connected component) of a graph.
Definition: PlanRepExpansion.h:58
ogdf::MMVariableEmbeddingInserter::Paths::m_tgt
Array< AnchorNodeInfo > m_tgt
Definition: MMVariableEmbeddingInserter.h:121
RemoveReinsertType.h
Definition of RemoveReinsertType (used for postprocessing in edge insertion algorithms).
ogdf::Block
Class representing idea of Blocks used in GlobalSifting and GridSifting algorithms.
Definition: BlockOrder.h:68
ogdf::MMVariableEmbeddingInserter::m_forbiddenEdgeOrig
const EdgeArray< bool > * m_forbiddenEdgeOrig
Definition: MMVariableEmbeddingInserter.h:248
ogdf::NodeSet
Node sets.
Definition: GraphSets.h:54
ogdf::MMVariableEmbeddingInserter::percentMostCrossed
double percentMostCrossed() const
Returns the current setting of the option percentMostCrossed.
Definition: MMVariableEmbeddingInserter.h:80
ogdf::MMVariableEmbeddingInserter::m_pPG
PlanRepExpansion * m_pPG
Pointer to the planarized expansion.
Definition: MMVariableEmbeddingInserter.h:237
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:143
ogdf::MMVariableEmbeddingInserter::removeReinsert
void removeReinsert(RemoveReinsertType rrOption)
Sets the remove-reinsert option for postprocessing.
Definition: MMVariableEmbeddingInserter.h:63
ogdf::MMVariableEmbeddingInserter::Paths::m_addPartRight
Array< SList< adjEntry > > m_addPartRight
Definition: MMVariableEmbeddingInserter.h:118
ogdf::MMVariableEmbeddingInserter::m_edgeB
Array< SList< edge > > m_edgeB
The list of edges in block i.
Definition: MMVariableEmbeddingInserter.h:244
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::AnchorNodeInfo
AnchorNodeInfo(adjEntry adj)
Definition: MMVariableEmbeddingInserter.h:92
ogdf::MMVariableEmbeddingInserter::m_nodeB
Array< SList< node > > m_nodeB
The list of nodes in block i.
Definition: MMVariableEmbeddingInserter.h:243
ogdf::MMVariableEmbeddingInserter::~MMVariableEmbeddingInserter
virtual ~MMVariableEmbeddingInserter()
Definition: MMVariableEmbeddingInserter.h:56
ogdf::MMVariableEmbeddingInserter::PathType
PathType
Definition: MMVariableEmbeddingInserter.h:106
ogdf::MMVariableEmbeddingInserter::m_compV
NodeArray< SList< int > > m_compV
The list of blocks containing a node v.
Definition: MMVariableEmbeddingInserter.h:242
SList.h
Declaration of singly linked lists and iterators.
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
ogdf::MMEdgeInsertionModule
Interface for minor-monotone edge insertion algorithms.
Definition: MMEdgeInsertionModule.h:50
ogdf::SListPure
Singly linked lists.
Definition: SList.h:52
PlanRepExpansion.h
Declaration of class PlanRepExpansion representing a planarized representation of the expansion of a ...
ogdf::MMVariableEmbeddingInserter::Paths::m_paths
Array< List< Crossing > > m_paths
Definition: MMVariableEmbeddingInserter.h:119
ogdf::List< edge >
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:659
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::AnchorNodeInfo
AnchorNodeInfo()
Definition: MMVariableEmbeddingInserter.h:90
ogdf::MMVariableEmbeddingInserter::m_GtoBC
NodeArray< node > m_GtoBC
Maps a node in the planarized expansion to the corresponding node in block.
Definition: MMVariableEmbeddingInserter.h:245
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::RemoveReinsertType
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
Definition: RemoveReinsertType.h:41
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::MMVariableEmbeddingInserter::m_conFinished
bool m_conFinished
Stores if a possible target node in a block has already been found.
Definition: MMVariableEmbeddingInserter.h:247
ogdf::PlanRepExpansion::NodeSplit
Representation of a node split in a planarized expansion.
Definition: PlanRepExpansion.h:81
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:364
List.h
Declaration of doubly linked lists and iterators.
ogdf::MMVariableEmbeddingInserter::m_rrOption
RemoveReinsertType m_rrOption
The remove-reinsert option.
Definition: MMVariableEmbeddingInserter.h:234
ogdf::MMVariableEmbeddingInserter::Paths::Paths
Paths()
Definition: MMVariableEmbeddingInserter.h:109
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo
Definition: MMVariableEmbeddingInserter.h:89
ogdf::MMVariableEmbeddingInserter::m_pSources
NodeSet * m_pSources
The set of possible start nodes of an insertion path.
Definition: MMVariableEmbeddingInserter.h:239
ogdf::RemoveReinsertType::IncInserted
@ IncInserted
Postprocessing for (so far) inserted edges after each edge insertion.
ogdf::Module::ReturnType
ReturnType
The return type of a module.
Definition: Module.h:52
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:241
ogdf::MMVariableEmbeddingInserter::m_percentMostCrossed
double m_percentMostCrossed
The percentMostCrossed option.
Definition: MMVariableEmbeddingInserter.h:235
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:717