Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
43namespace ogdf {
44class NodeSet;
45
47
51public:
54
55 // destruction
57
64 OGDF_ASSERT(rrOption != RemoveReinsertType::IncInserted);
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
83private:
84 class Block;
85 class ExpandedSkeleton;
86
88
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
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
225
226 void buildSubpath(node v, edge eIn, edge eOut, Paths& paths, bool& bPathToEdge,
227 bool& bPathToSrc, bool& bPathToTgt, ExpandedSkeleton& Exp);
228
231
232 void writeEip(const List<Crossing>& eip);
233
236
238
241
246
249};
250
251}
Declaration and implementation of Array class and Array algorithms.
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of interface for minor-monotone edge insertion algorithms.
Declaration of class PlanRepExpansion representing a planarized representation of the expansion of a ...
Definition of RemoveReinsertType (used for postprocessing in edge insertion algorithms).
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
Class for adjacency list elements.
Definition Graph_d.h:143
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
Class representing idea of Blocks used in GlobalSifting and GridSifting algorithms.
Definition BlockOrder.h:68
Class for the representation of edges.
Definition Graph_d.h:364
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Interface for minor-monotone edge insertion algorithms.
Minor-monotone edge insertion with variable embedding.
bool dfsVertex(node v, int parent, List< Crossing > &eip, AnchorNodeInfo &vStart, AnchorNodeInfo &vEnd)
Implements vertex case of recursive path search in BC-tree.
void percentMostCrossed(double percent)
Sets the portion of most crossed edges used during postprocessing.
void findSourcesAndTargets(node src, node tgt, NodeSet &sources, NodeSet &targets) const
Finds the set of anchor nodes of src and tgt.
RemoveReinsertType removeReinsert() const
Returns the current setting of the remove-reinsert option.
static node commonDummy(NodeSet &sources, NodeSet &targets)
NodeArray< node > m_GtoBC
Maps a node in the planarized expansion to the corresponding node in block.
void findPseudos(node vDummy, adjEntry adjSrc, AnchorNodeInfo &infoSrc, SListPure< node > &pseudos)
void buildSubpath(node v, edge eIn, edge eOut, Paths &paths, bool &bPathToEdge, bool &bPathToSrc, bool &bPathToTgt, ExpandedSkeleton &Exp)
double percentMostCrossed() const
Returns the current setting of the option percentMostCrossed.
NodeSet * m_pTargets
The set of possible end nodes of an insertion path.
Array< SList< node > > m_nodeB
The list of nodes in block i.
bool dfsBlock(int i, node parent, node &repS, List< Crossing > &eip, AnchorNodeInfo &vStart, AnchorNodeInfo &vEnd)
Implements block case of recursive path search in BC-tree.
void preprocessInsertionPath(const AnchorNodeInfo &srcInfo, const AnchorNodeInfo &tgtInfo, node srcOrig, node tgtOrig, node &src, node &tgt, edge &eSrc, edge &eTgt)
PlanRepExpansion * m_pPG
Pointer to the planarized expansion.
node preparePath(node vAnchor, adjEntry adjPath, bool bOrigEdge, node vOrig)
NodeSet * m_pSources
The set of possible start nodes of an insertion path.
MMVariableEmbeddingInserter()
Creates a minor-monotone fixed embedding inserter.
double m_percentMostCrossed
The percentMostCrossed option.
void blockInsert(Block &BC, List< Crossing > &L, AnchorNodeInfo &srcInfo, AnchorNodeInfo &tgtInfo)
Computes optimal insertion path in block BC.
bool pathSearch(node v, edge parent, const Block &BC, List< edge > &path)
virtual ReturnType doCall(PlanRepExpansion &PG, const List< edge > &origEdges, const EdgeArray< bool > *forbiddenEdgeOrig) override
Implementation of algorithm call.
NodeArray< SList< int > > m_compV
The list of blocks containing a node v.
void convertDummy(node u, node vOrig, PlanRepExpansion::nodeSplit ns_0)
Array< SList< edge > > m_edgeB
The list of edges in block i.
void insert(List< Crossing > &eip, AnchorNodeInfo &vStart, AnchorNodeInfo &vEnd)
Computes insertion path eip.
void writeEip(const List< Crossing > &eip)
bool m_conFinished
Stores if a possible target node in a block has already been found.
void removeReinsert(RemoveReinsertType rrOption)
Sets the remove-reinsert option for postprocessing.
void insertWithCommonDummy(edge eOrig, node vDummy, node &src, node &tgt)
void anchorNodes(node vOrig, NodeSet &nodes) const
Returns all anchor nodes of vOrig in nnodes.
RemoveReinsertType m_rrOption
The remove-reinsert option.
node prepareAnchorNode(const AnchorNodeInfo &anchor, node vOrig, bool isSrc, edge &eExtra)
void collectAnchorNodes(node v, NodeSet &nodes, const PlanRepExpansion::NodeSplit *nsParent) const
Collects all anchor nodes (including dummies) of a node.
ReturnType
The return type of a module.
Definition Module.h:52
Class for the representation of nodes.
Definition Graph_d.h:241
Node sets.
Definition GraphSets.h:54
Representation of a node split in a planarized expansion.
Planarized representations (of a connected component) of a graph.
Singly linked lists.
Definition SList.h:191
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition basic.h:52
The namespace for all OGDF objects.