Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

MMVariableEmbeddingInserter.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/FaceArray.h>
36 #include <ogdf/basic/NodeSet.h>
37 #include <ogdf/basic/tuples.h>
40 
41 namespace ogdf {
42 
44 
48 public:
51 
52  // destruction
54 
62  m_rrOption = rrOption;
63  }
64 
66  RemoveReinsertType removeReinsert() const { return m_rrOption; }
67 
69 
74  void percentMostCrossed(double percent) { m_percentMostCrossed = percent; }
75 
77  double percentMostCrossed() const { return m_percentMostCrossed; }
78 
79 
80 private:
81  class Block;
82  class ExpandedSkeleton;
83 
85 
86  struct AnchorNodeInfo {
87  AnchorNodeInfo() { m_adj_1 = m_adj_2 = nullptr; }
88 
90  m_adj_1 = adj;
91  m_adj_2 = nullptr;
92  }
93 
95  m_adj_1 = adj_1;
96  m_adj_2 = adj_2;
97  }
98 
101  };
102 
103  enum class PathType { pathToEdge = 0, pathToSource = 1, pathToTarget = 2 };
104 
105  struct Paths {
107  : m_addPartLeft(3)
108  , m_addPartRight(3)
109  , m_paths(3)
110  , m_src(0, 2, nullptr)
111  , m_tgt(0, 2, nullptr)
112  , m_pred(0, 2, PathType::pathToEdge) { }
113 
120  };
121 
131  virtual ReturnType doCall(PlanRepExpansion& PG, const List<edge>& origEdges,
132  const EdgeArray<bool>* forbiddenEdgeOrig) override;
133 
142  void collectAnchorNodes(node v, NodeSet<>& nodes,
143  const PlanRepExpansion::NodeSplit* nsParent) const;
144 
153  void findSourcesAndTargets(node src, node tgt, NodeSet<>& sources, NodeSet<>& targets) const;
154 
161  void anchorNodes(node vOrig, NodeSet<>& nodes) const;
162 
163  static node commonDummy(NodeSet<>& sources, NodeSet<>& targets);
164 
174  void insert(List<Crossing>& eip, AnchorNodeInfo& vStart, AnchorNodeInfo& vEnd);
175 
176  node prepareAnchorNode(const AnchorNodeInfo& anchor, node vOrig, bool isSrc, edge& eExtra);
177 
178  void preprocessInsertionPath(const AnchorNodeInfo& srcInfo, const AnchorNodeInfo& tgtInfo,
179  node srcOrig, node tgtOrig, node& src, node& tgt, edge& eSrc, edge& eTgt);
180 
181  node preparePath(node vAnchor, adjEntry adjPath, bool bOrigEdge, node vOrig);
182 
183  void findPseudos(node vDummy, adjEntry adjSrc, AnchorNodeInfo& infoSrc, SListPure<node>& pseudos);
184 
185  void insertWithCommonDummy(edge eOrig, node vDummy, node& src, node& tgt);
186 
196  bool dfsVertex(node v, int parent, List<Crossing>& eip, AnchorNodeInfo& vStart,
197  AnchorNodeInfo& vEnd);
198 
209  bool dfsBlock(int i, node parent, node& repS, List<Crossing>& eip, AnchorNodeInfo& vStart,
210  AnchorNodeInfo& vEnd);
211 
212  bool pathSearch(node v, edge parent, const Block& BC, List<edge>& path);
213 
222  void blockInsert(Block& BC, List<Crossing>& L, AnchorNodeInfo& srcInfo, AnchorNodeInfo& tgtInfo);
223 
224  void buildSubpath(node v, edge eIn, edge eOut, Paths& paths, bool& bPathToEdge,
225  bool& bPathToSrc, bool& bPathToTgt, ExpandedSkeleton& Exp);
226 
227  void contractSplitIfReq(node u);
228  void convertDummy(node u, node vOrig, PlanRepExpansion::nodeSplit ns_0);
229 
230  void writeEip(const List<Crossing>& eip);
231 
234 
236 
239 
244 
247 };
248 
249 }
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::m_adj_2
adjEntry m_adj_2
Definition: MMVariableEmbeddingInserter.h:100
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::MMVariableEmbeddingInserter::Paths::m_src
Array< AnchorNodeInfo > m_src
Definition: MMVariableEmbeddingInserter.h:117
ogdf::PlanRepExpansion::Crossing
Definition: PlanRepExpansion.h:54
ogdf::MMVariableEmbeddingInserter::Paths::m_addPartLeft
Array< SList< adjEntry > > m_addPartLeft
Definition: MMVariableEmbeddingInserter.h:114
ogdf::MMVariableEmbeddingInserter::percentMostCrossed
void percentMostCrossed(double percent)
Sets the portion of most crossed edges used during postprocessing.
Definition: MMVariableEmbeddingInserter.h:74
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::AnchorNodeInfo
AnchorNodeInfo(adjEntry adj_1, adjEntry adj_2)
Definition: MMVariableEmbeddingInserter.h:94
ogdf::MMVariableEmbeddingInserter
Minor-monotone edge insertion with variable embedding.
Definition: MMVariableEmbeddingInserter.h:47
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::m_adj_1
adjEntry m_adj_1
Definition: MMVariableEmbeddingInserter.h:99
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:54
ogdf::MMVariableEmbeddingInserter::m_pTargets
NodeSet * m_pTargets
The set of possible end nodes of an insertion path.
Definition: MMVariableEmbeddingInserter.h:238
ogdf::MMVariableEmbeddingInserter::removeReinsert
RemoveReinsertType removeReinsert() const
Returns the current setting of the remove-reinsert option.
Definition: MMVariableEmbeddingInserter.h:66
ogdf::MMVariableEmbeddingInserter::Paths::m_pred
Array< PathType > m_pred
Definition: MMVariableEmbeddingInserter.h:119
ogdf::MMVariableEmbeddingInserter::Paths
Definition: MMVariableEmbeddingInserter.h:105
ogdf::PlanRepExpansion
Planarized representations (of a connected component) of a graph.
Definition: PlanRepExpansion.h:52
ogdf::MMVariableEmbeddingInserter::Paths::m_tgt
Array< AnchorNodeInfo > m_tgt
Definition: MMVariableEmbeddingInserter.h:118
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:70
ogdf::MMVariableEmbeddingInserter::m_forbiddenEdgeOrig
const EdgeArray< bool > * m_forbiddenEdgeOrig
Definition: MMVariableEmbeddingInserter.h:246
ogdf::NodeSet
Node sets.
Definition: GraphSets.h:52
ogdf::MMVariableEmbeddingInserter::percentMostCrossed
double percentMostCrossed() const
Returns the current setting of the option percentMostCrossed.
Definition: MMVariableEmbeddingInserter.h:77
ogdf::MMVariableEmbeddingInserter::m_pPG
PlanRepExpansion * m_pPG
Pointer to the planarized expansion.
Definition: MMVariableEmbeddingInserter.h:235
FaceArray.h
declaration and implementation of FaceArray class
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
ogdf::MMVariableEmbeddingInserter::removeReinsert
void removeReinsert(RemoveReinsertType rrOption)
Sets the remove-reinsert option for postprocessing.
Definition: MMVariableEmbeddingInserter.h:60
ogdf::MMVariableEmbeddingInserter::Paths::m_addPartRight
Array< SList< adjEntry > > m_addPartRight
Definition: MMVariableEmbeddingInserter.h:115
ogdf::MMVariableEmbeddingInserter::m_edgeB
Array< SList< edge > > m_edgeB
The list of edges in block i.
Definition: MMVariableEmbeddingInserter.h:242
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::AnchorNodeInfo
AnchorNodeInfo(adjEntry adj)
Definition: MMVariableEmbeddingInserter.h:89
ogdf::MMVariableEmbeddingInserter::m_nodeB
Array< SList< node > > m_nodeB
The list of nodes in block i.
Definition: MMVariableEmbeddingInserter.h:241
ogdf::MMVariableEmbeddingInserter::~MMVariableEmbeddingInserter
virtual ~MMVariableEmbeddingInserter()
Definition: MMVariableEmbeddingInserter.h:53
ogdf::MMVariableEmbeddingInserter::PathType
PathType
Definition: MMVariableEmbeddingInserter.h:103
ogdf::MMVariableEmbeddingInserter::m_compV
NodeArray< SList< int > > m_compV
The list of blocks containing a node v.
Definition: MMVariableEmbeddingInserter.h:240
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:214
ogdf::MMEdgeInsertionModule
Interface for minor-monotone edge insertion algorithms.
Definition: MMEdgeInsertionModule.h:45
ogdf::SListPure
Singly linked lists.
Definition: SList.h:39
ogdf::MMVariableEmbeddingInserter::Paths::m_paths
Array< List< Crossing > > m_paths
Definition: MMVariableEmbeddingInserter.h:116
ogdf::List< edge >
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo::AnchorNodeInfo
AnchorNodeInfo()
Definition: MMVariableEmbeddingInserter.h:87
ogdf::MMVariableEmbeddingInserter::m_GtoBC
NodeArray< node > m_GtoBC
Maps a node in the planarized expansion to the corresponding node in block.
Definition: MMVariableEmbeddingInserter.h:243
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
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
ogdf::MMVariableEmbeddingInserter::m_conFinished
bool m_conFinished
Stores if a possible target node in a block has already been found.
Definition: MMVariableEmbeddingInserter.h:245
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::MMVariableEmbeddingInserter::m_rrOption
RemoveReinsertType m_rrOption
The remove-reinsert option.
Definition: MMVariableEmbeddingInserter.h:232
ogdf::MMVariableEmbeddingInserter::Paths::Paths
Paths()
Definition: MMVariableEmbeddingInserter.h:106
ogdf::MMVariableEmbeddingInserter::AnchorNodeInfo
Definition: MMVariableEmbeddingInserter.h:86
ogdf::MMVariableEmbeddingInserter::m_pSources
NodeSet * m_pSources
The set of possible start nodes of an insertion path.
Definition: MMVariableEmbeddingInserter.h:237
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:50
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::MMVariableEmbeddingInserter::m_percentMostCrossed
double m_percentMostCrossed
The percentMostCrossed option.
Definition: MMVariableEmbeddingInserter.h:233
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709