Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

VarEdgeInserterCore.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>
40 
41 namespace ogdf {
42 
44 {
45 public:
47  PlanRepLight &pr,
48  const EdgeArray<int> *pCostOrig,
49  const EdgeArray<bool> *pForbiddenOrig,
50  const EdgeArray<uint32_t> *pEdgeSubgraphs)
51  : m_pr(pr), m_pCost(pCostOrig), m_pForbidden(pForbiddenOrig), m_pSubgraph(pEdgeSubgraphs) { }
52 
53  virtual ~VarEdgeInserterCore() { }
54 
55  Module::ReturnType call(
56  const Array<edge> &origEdges,
57  RemoveReinsertType rrPost,
58  double percentMostCrossed);
59 
60  Module::ReturnType callPostprocessing(
61  const Array<edge> &origEdges,
62  RemoveReinsertType rrPost,
63  double percentMostCrossed);
64 
65  int runsPostprocessing() const { return m_runsPostprocessing; }
66 
67 protected:
68  class BiconnectedComponent;
69  class ExpandedGraph;
70 
71  void insert(node s, node t, SList<adjEntry> &eip);
72  int costCrossed(edge eOrig) const;
73 
74  bool dfsVertex(node v, int parent);
75  node dfsComp(int i, node parent);
76 
77  void blockInsert(
78  const BiconnectedComponent &G,
79  node s,
80  node t,
81  List<adjEntry> &L);
82  bool pathSearch(node v, edge parent, List<edge> &path);
83  virtual void buildSubpath(node v,
84  edge eIn,
85  edge eOut,
86  List<adjEntry> &L,
87  ExpandedGraph &Exp,
88  node s,
89  node t);
90 
91  virtual void storeTypeOfCurrentEdge(edge eOrig) { }
92  virtual BiconnectedComponent *createBlock();
93  virtual ExpandedGraph *createExpandedGraph(const BiconnectedComponent &BC, const StaticSPQRTree &T);
94 
95  static const int c_bigM = 10000;
97 
101 
102  node m_s, m_t;
105 
106  // representation of BC tree
111 
112  node m_v1, m_v2;
113 
115 };
116 
117 
119 {
120 public:
122  PlanRepLight &pr,
123  const EdgeArray<int> *pCostOrig,
124  const EdgeArray<uint32_t> *pEdgeSubgraph) : VarEdgeInserterCore(pr, pCostOrig, nullptr, pEdgeSubgraph) { }
125 
126 protected:
127  class BiconnectedComponentUML;
128  class ExpandedGraphUML;
129 
130  void storeTypeOfCurrentEdge(edge eOrig) override { m_typeOfCurrentEdge = m_pr.typeOrig(eOrig); }
131  BiconnectedComponent *createBlock() override;
132  ExpandedGraph *createExpandedGraph(const BiconnectedComponent &BC, const StaticSPQRTree &T) override;
133  virtual void buildSubpath(node v,
134  edge eIn,
135  edge eOut,
136  List<adjEntry> &L,
137  ExpandedGraph &Exp,
138  node s,
139  node t) override;
140 
142 };
143 
144 }
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
VarEdgeInserterCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< bool > *pForbiddenOrig, const EdgeArray< uint32_t > *pEdgeSubgraphs)
Declares base class for all module types.
RemoveReinsertType
The postprocessing method for edge insertion algorithms.
void storeTypeOfCurrentEdge(edge eOrig) override
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
NodeArray< SList< int > > m_compV
Array< SList< edge > > m_edgeB
const EdgeArray< uint32_t > * m_pSubgraph
const EdgeArray< bool > * m_pForbidden
virtual void storeTypeOfCurrentEdge(edge eOrig)
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
class for timeout funtionality.
Definition: Timeouter.h:47
Declaration of class StaticSPQRTree.
Array< SList< node > > m_nodeB
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:538
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
int m_runsPostprocessing
Runs of remove-reinsert method.
Class for the representation of edges.
Definition: Graph_d.h:292
Class for the representation of nodes.
Definition: Graph_d.h:169
VarEdgeInserterUMLCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< uint32_t > *pEdgeSubgraph)
Linear-time implementation of static SPQR-trees.
const EdgeArray< int > * m_pCost
Declaration of class PlanRepLight.
Declares base class for modules with timeout functionality.
The namespace for all OGDF objects.