Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

FixEdgeInserterCore.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Timeouter.h>
36 #include <ogdf/basic/Module.h>
37 #include <ogdf/basic/FaceArray.h>
38 #include <ogdf/basic/FaceSet.h>
39 #include <ogdf/basic/Queue.h>
42 
43 namespace ogdf {
44 
46 {
47 public:
49  PlanRepLight &pr,
50  const EdgeArray<int> *pCostOrig,
51  const EdgeArray<bool> *pForbiddenOrig,
52  const EdgeArray<uint32_t> *pEdgeSubgraphs)
53  : m_pr(pr), m_pCost(pCostOrig), m_pForbidden(pForbiddenOrig), m_pSubgraph(pEdgeSubgraphs) { }
54 
55  virtual ~FixEdgeInserterCore() { }
56 
57  Module::ReturnType call(
58  const Array<edge> &origEdges,
59  bool keepEmbedding,
60  RemoveReinsertType rrPost,
61  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, SList<adjEntry> &crossed);
69 
70  int costCrossed(edge eOrig) const;
71  void insertEdge(CombinatorialEmbedding &E, edge eOrig, const SList<adjEntry> &crossed);
72  void removeEdge(CombinatorialEmbedding &E, edge eOrig);
73 
74  virtual void storeTypeOfCurrentEdge(edge eOrig) { }
75  virtual void init(CombinatorialEmbedding &E);
76  virtual void cleanup();
77  virtual void constructDual(const CombinatorialEmbedding &E);
78 
79  virtual void appendCandidates(QueuePure<edge> &queue, node v);
80  virtual void appendCandidates(Array<SListPure<edge> > &nodesAtDist, EdgeArray<int> &costDual, int maxCost, node v, int currentDist);
81 
82  virtual void insertEdgesIntoDual(const CombinatorialEmbedding &E, adjEntry adjSrc);
83  virtual void insertEdgesIntoDualAfterRemove(const CombinatorialEmbedding &E, face f);
84 
86 
90 
92 
95 
98 
101 
103 };
104 
105 
107 {
108 public:
110  PlanRepLight &pr,
111  const EdgeArray<int> *pCostOrig,
112  const EdgeArray<uint32_t> *pEdgeSubgraph) : FixEdgeInserterCore(pr, pCostOrig, nullptr, pEdgeSubgraph) { }
113 
114 protected:
115  void storeTypeOfCurrentEdge(edge eOrig) override { m_typeOfCurrentEdge = m_pr.typeOrig(eOrig); }
116  void init(CombinatorialEmbedding &E) override;
117  void cleanup() override;
118  void constructDual(const CombinatorialEmbedding &E) override;
119 
120  void appendCandidates(QueuePure<edge> &queue, node v) override;
121  void appendCandidates(Array<SListPure<edge> > &nodesAtDist, EdgeArray<int> &costDual, int maxCost, node v, int currentDist) override;
122 
123  void insertEdgesIntoDual(const CombinatorialEmbedding &E, adjEntry adjSrc) override;
124  void insertEdgesIntoDualAfterRemove(const CombinatorialEmbedding &E, face f) override;
125 
128 };
129 
130 }
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
FaceArray< node > m_nodeOf
The node in dual corresponding to face in primal.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
void storeTypeOfCurrentEdge(edge eOrig) override
FixEdgeInserterUMLCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< uint32_t > *pEdgeSubgraph)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
int m_runsPostprocessing
Runs of remove-reinsert method.
Graph m_dual
(Extended) dual graph, constructed/destructed during call.
Singly linked lists.
Definition: SList.h:38
Declares base class for all module types.
node m_vS
The node in extended dual representing s.
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
Implementation of list-based queues.
Definition: Queue.h:50
declaration and implementation of FaceArray class
void init()
Definition: graphics.h:472
Definition of RemoveReinsertType (used for postprocessing in edge insertion algorithms).
ReturnType
The return type of a module.
Definition: Module.h:51
Singly linked lists (maintaining the length of the list).
Definition: SList.h:773
Light-weight version of a planarized representation, associated with a PlanRep.
Definition: PlanRepLight.h:44
EdgeArray< adjEntry > m_primalAdj
Adjacency entry in primal graph corresponding to edge in dual.
Dynamic arrays indexed with faces of a combinatorial embedding.
const EdgeArray< bool > * m_pForbidden
EdgeArray< bool > m_primalIsGen
true iff corresponding primal edge is a generalization.
class for timeout funtionality.
Definition: Timeouter.h:47
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:538
Declaration and implementation of list-based queues (classes QueuePure<E> and Queue<E>).
const EdgeArray< uint32_t > * m_pSubgraph
Faces in a combinatorial embedding.
const EdgeArray< int > * m_pCost
Class for the representation of edges.
Definition: Graph_d.h:292
node m_vT
The node in extended dual representing t.
Class for the representation of nodes.
Definition: Graph_d.h:169
FixEdgeInserterCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< bool > *pForbiddenOrig, const EdgeArray< uint32_t > *pEdgeSubgraphs)
FaceSet< false > * m_newFaces
Declaration of class PlanRepLight.
Declares base class for modules with timeout functionality.
The namespace for all OGDF objects.
Combinatorial embeddings of planar graphs with modification functionality.
FaceSet< false > * m_delFaces
Class for adjacency list elements.
Definition: Graph_d.h:79
virtual void storeTypeOfCurrentEdge(edge eOrig)
Declaration and implementation of ogdf::FaceSet.