Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

FixEdgeInserterCore.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Array.h>
37 #include <ogdf/basic/FaceSet.h>
38 #include <ogdf/basic/Graph.h>
39 #include <ogdf/basic/Module.h>
40 #include <ogdf/basic/SList.h>
41 #include <ogdf/basic/Timeouter.h>
42 #include <ogdf/basic/basic.h>
44 
45 #include <cstdint>
46 
47 namespace ogdf {
48 enum class RemoveReinsertType;
49 template<class E>
50 class QueuePure;
51 
53 public:
55  const EdgeArray<bool>* pForbiddenOrig, const EdgeArray<uint32_t>* pEdgeSubgraphs)
56  : m_pr(pr), m_pCost(pCostOrig), m_pForbidden(pForbiddenOrig), m_pSubgraph(pEdgeSubgraphs) { }
57 
58  virtual ~FixEdgeInserterCore() { }
59 
60  Module::ReturnType call(const Array<edge>& origEdges, bool keepEmbedding,
61  RemoveReinsertType rrPost, double percentMostCrossed);
62 
63  int runsPostprocessing() const { return m_runsPostprocessing; }
64 
65 protected:
66  int getCost(edge e, int stSubGraph) const;
67  void findShortestPath(const CombinatorialEmbedding& E, edge eOrig, SList<adjEntry>& crossed);
68  void findWeightedShortestPath(const CombinatorialEmbedding& E, edge eOrig,
69  SList<adjEntry>& crossed);
70 
71  int costCrossed(edge eOrig) const;
72  void insertEdge(CombinatorialEmbedding& E, edge eOrig, const SList<adjEntry>& crossed);
73  void removeEdge(CombinatorialEmbedding& E, edge eOrig);
74 
75  virtual void storeTypeOfCurrentEdge(edge eOrig) { }
76 
77  virtual void init(CombinatorialEmbedding& E);
78  virtual void cleanup();
79  virtual void constructDual(const CombinatorialEmbedding& E);
80 
81  virtual void appendCandidates(QueuePure<edge>& queue, node v);
82  virtual void appendCandidates(Array<SListPure<edge>>& nodesAtDist, EdgeArray<int>& costDual,
83  int maxCost, node v, int currentDist);
84 
85  virtual void insertEdgesIntoDual(const CombinatorialEmbedding& E, adjEntry adjSrc);
86  virtual void insertEdgesIntoDualAfterRemove(const CombinatorialEmbedding& E, face f);
87 
89 
93 
95 
98 
101 
104 
106 };
107 
109 public:
111  const EdgeArray<uint32_t>* pEdgeSubgraph)
112  : FixEdgeInserterCore(pr, pCostOrig, nullptr, pEdgeSubgraph) { }
113 
114 protected:
115  void storeTypeOfCurrentEdge(edge eOrig) override { m_typeOfCurrentEdge = m_pr.typeOrig(eOrig); }
116 
117  void init(CombinatorialEmbedding& E) override;
118  void cleanup() override;
119  void constructDual(const CombinatorialEmbedding& E) override;
120 
121  void appendCandidates(QueuePure<edge>& queue, node v) override;
122  void appendCandidates(Array<SListPure<edge>>& nodesAtDist, EdgeArray<int>& costDual,
123  int maxCost, node v, int currentDist) override;
124 
125  void insertEdgesIntoDual(const CombinatorialEmbedding& E, adjEntry adjSrc) override;
127 
130 };
131 
132 }
ogdf::FixEdgeInserterCore::m_pForbidden
const EdgeArray< bool > * m_pForbidden
Definition: FixEdgeInserterCore.h:91
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::FixEdgeInserterCore::m_nodeOf
FaceArray< node > m_nodeOf
The node in dual corresponding to face in primal.
Definition: FixEdgeInserterCore.h:97
ogdf::FixEdgeInserterCore::m_runsPostprocessing
int m_runsPostprocessing
Runs of remove-reinsert method.
Definition: FixEdgeInserterCore.h:105
FaceSet.h
Declaration and implementation of ogdf::FaceSet.
ogdf::FixEdgeInserterCore::m_delFaces
FaceSet< false > * m_delFaces
Definition: FixEdgeInserterCore.h:99
ogdf::FixEdgeInserterCore::m_vT
node m_vT
The node in extended dual representing t.
Definition: FixEdgeInserterCore.h:103
ogdf::Graph::EdgeType
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:909
ogdf::FixEdgeInserterUMLCore::m_primalIsGen
EdgeArray< bool > m_primalIsGen
true iff corresponding primal edge is a generalization.
Definition: FixEdgeInserterCore.h:128
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:845
ogdf::FixEdgeInserterUMLCore::storeTypeOfCurrentEdge
void storeTypeOfCurrentEdge(edge eOrig) override
Definition: FixEdgeInserterCore.h:115
ogdf::FixEdgeInserterCore::m_newFaces
FaceSet< false > * m_newFaces
Definition: FixEdgeInserterCore.h:100
ogdf::FixEdgeInserterCore::~FixEdgeInserterCore
virtual ~FixEdgeInserterCore()
Definition: FixEdgeInserterCore.h:58
ogdf::PlanRepLight
Light-weight version of a planarized representation, associated with a PlanRep.
Definition: PlanRepLight.h:45
ogdf::FixEdgeInserterUMLCore::appendCandidates
void appendCandidates(QueuePure< edge > &queue, node v) override
ogdf::FixEdgeInserterUMLCore::FixEdgeInserterUMLCore
FixEdgeInserterUMLCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< uint32_t > *pEdgeSubgraph)
Definition: FixEdgeInserterCore.h:110
Timeouter.h
Declares base class for modules with timeout functionality.
ogdf::FixEdgeInserterCore::runsPostprocessing
int runsPostprocessing() const
Definition: FixEdgeInserterCore.h:63
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
ogdf::FixEdgeInserterCore
Definition: FixEdgeInserterCore.h:52
ogdf::FixEdgeInserterCore::m_dual
Graph m_dual
(Extended) dual graph, constructed/destructed during call.
Definition: FixEdgeInserterCore.h:94
ogdf::FixEdgeInserterCore::m_pSubgraph
const EdgeArray< uint32_t > * m_pSubgraph
Definition: FixEdgeInserterCore.h:92
ogdf::FixEdgeInserterCore::FixEdgeInserterCore
FixEdgeInserterCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< bool > *pForbiddenOrig, const EdgeArray< uint32_t > *pEdgeSubgraphs)
Definition: FixEdgeInserterCore.h:54
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::FixEdgeInserterUMLCore::init
void init(CombinatorialEmbedding &E) override
ogdf::FixEdgeInserterCore::m_pr
PlanRepLight & m_pr
Definition: FixEdgeInserterCore.h:88
ogdf::FixEdgeInserterUMLCore::cleanup
void cleanup() override
ogdf::FaceSet< false >
ogdf::FixEdgeInserterUMLCore::m_typeOfCurrentEdge
Graph::EdgeType m_typeOfCurrentEdge
Definition: FixEdgeInserterCore.h:129
ogdf::SListPure
Singly linked lists.
Definition: SList.h:52
ogdf::FixEdgeInserterUMLCore::constructDual
void constructDual(const CombinatorialEmbedding &E) override
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::FaceArrayBase
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Definition: CombinatorialEmbedding.h:181
ogdf::PlanRepLight::typeOrig
EdgeType typeOrig(edge eOrig) const
Definition: PlanRepLight.h:82
PlanRepLight.h
Declaration of class PlanRepLight.
ogdf::FixEdgeInserterUMLCore::insertEdgesIntoDualAfterRemove
void insertEdgesIntoDualAfterRemove(const CombinatorialEmbedding &E, face f) override
ogdf::FixEdgeInserterCore::m_primalAdj
EdgeArray< adjEntry > m_primalAdj
Adjacency entry in primal graph corresponding to edge in dual.
Definition: FixEdgeInserterCore.h:96
ogdf::graphics::init
void init()
Definition: graphics.h:450
ogdf::QueuePure
Implementation of list-based queues.
Definition: Queue.h:55
basic.h
Basic declarations, included by all source files.
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
ogdf::FixEdgeInserterCore::storeTypeOfCurrentEdge
virtual void storeTypeOfCurrentEdge(edge eOrig)
Definition: FixEdgeInserterCore.h:75
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::CombinatorialEmbedding
Combinatorial embeddings of planar graphs with modification functionality.
Definition: CombinatorialEmbedding.h:406
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::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::Timeouter
class for timeout funtionality.
Definition: Timeouter.h:46
Module.h
Declares base class for all module types.
ogdf::Module::ReturnType
ReturnType
The return type of a module.
Definition: Module.h:52
ogdf::FixEdgeInserterCore::m_vS
node m_vS
The node in extended dual representing s.
Definition: FixEdgeInserterCore.h:102
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::FixEdgeInserterCore::m_pCost
const EdgeArray< int > * m_pCost
Definition: FixEdgeInserterCore.h:90
ogdf::FixEdgeInserterUMLCore::insertEdgesIntoDual
void insertEdgesIntoDual(const CombinatorialEmbedding &E, adjEntry adjSrc) override
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::FaceElement
Faces in a combinatorial embedding.
Definition: CombinatorialEmbedding.h:118
ogdf::FixEdgeInserterUMLCore
Definition: FixEdgeInserterCore.h:108