Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

VarEdgeInserterCore.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Array.h>
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/Module.h>
38 #include <ogdf/basic/SList.h>
39 #include <ogdf/basic/Timeouter.h>
40 #include <ogdf/basic/basic.h>
42 
43 #include <cstdint>
44 
45 namespace ogdf {
46 class StaticSPQRTree;
47 enum class RemoveReinsertType;
48 template<class E>
49 class List;
50 
52 public:
54  const EdgeArray<bool>* pForbiddenOrig, const EdgeArray<uint32_t>* pEdgeSubgraphs)
55  : m_pr(pr), m_pCost(pCostOrig), m_pForbidden(pForbiddenOrig), m_pSubgraph(pEdgeSubgraphs) { }
56 
57  virtual ~VarEdgeInserterCore() { }
58 
59  Module::ReturnType call(const Array<edge>& origEdges, RemoveReinsertType rrPost,
60  double percentMostCrossed);
61 
62  Module::ReturnType callPostprocessing(const Array<edge>& origEdges, 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(const BiconnectedComponent& G, node s, node t, List<adjEntry>& L);
78  bool pathSearch(node v, edge parent, List<edge>& path);
79  virtual void buildSubpath(node v, edge eIn, edge eOut, List<adjEntry>& L, ExpandedGraph& Exp,
80  node s, node t);
81 
82  virtual void storeTypeOfCurrentEdge(edge eOrig) { }
83 
84  virtual BiconnectedComponent* createBlock();
85  virtual ExpandedGraph* createExpandedGraph(const BiconnectedComponent& BC,
86  const StaticSPQRTree& T);
87 
88  static const int c_bigM = 10000;
90 
94 
95  node m_s, m_t;
98 
99  // representation of BC tree
104 
105  node m_v1, m_v2;
106 
108 };
109 
111 public:
113  const EdgeArray<uint32_t>* pEdgeSubgraph)
114  : VarEdgeInserterCore(pr, pCostOrig, nullptr, pEdgeSubgraph) { }
115 
116 protected:
117  class BiconnectedComponentUML;
118  class ExpandedGraphUML;
119 
120  void storeTypeOfCurrentEdge(edge eOrig) override { m_typeOfCurrentEdge = m_pr.typeOrig(eOrig); }
121 
122  BiconnectedComponent* createBlock() override;
123  ExpandedGraph* createExpandedGraph(const BiconnectedComponent& BC,
124  const StaticSPQRTree& T) override;
125  virtual void buildSubpath(node v, edge eIn, edge eOut, List<adjEntry>& L, ExpandedGraph& Exp,
126  node s, node t) override;
127 
129 };
130 
131 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::VarEdgeInserterCore::m_pCost
const EdgeArray< int > * m_pCost
Definition: VarEdgeInserterCore.h:91
Graph.h
Includes declaration of graph class.
ogdf::StaticSPQRTree
Linear-time implementation of static SPQR-trees.
Definition: StaticSPQRTree.h:79
ogdf::VarEdgeInserterUMLCore::VarEdgeInserterUMLCore
VarEdgeInserterUMLCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< uint32_t > *pEdgeSubgraph)
Definition: VarEdgeInserterCore.h:112
ogdf::VarEdgeInserterUMLCore::createExpandedGraph
ExpandedGraph * createExpandedGraph(const BiconnectedComponent &BC, const StaticSPQRTree &T) override
ogdf::VarEdgeInserterCore::m_edgeB
Array< SList< edge > > m_edgeB
Definition: VarEdgeInserterCore.h:102
ogdf::VarEdgeInserterUMLCore::createBlock
BiconnectedComponent * createBlock() override
ogdf::Graph::EdgeType
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:909
ogdf::VarEdgeInserterCore::VarEdgeInserterCore
VarEdgeInserterCore(PlanRepLight &pr, const EdgeArray< int > *pCostOrig, const EdgeArray< bool > *pForbiddenOrig, const EdgeArray< uint32_t > *pEdgeSubgraphs)
Definition: VarEdgeInserterCore.h:53
ogdf::VarEdgeInserterUMLCore
Definition: VarEdgeInserterCore.h:110
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:845
ogdf::PlanRepLight
Light-weight version of a planarized representation, associated with a PlanRep.
Definition: PlanRepLight.h:45
ogdf::VarEdgeInserterCore::m_runsPostprocessing
int m_runsPostprocessing
Runs of remove-reinsert method.
Definition: VarEdgeInserterCore.h:107
ogdf::VarEdgeInserterCore::m_v2
node m_v2
Definition: VarEdgeInserterCore.h:105
ogdf::VarEdgeInserterCore::m_pForbidden
const EdgeArray< bool > * m_pForbidden
Definition: VarEdgeInserterCore.h:92
Timeouter.h
Declares base class for modules with timeout functionality.
ogdf::VarEdgeInserterCore::~VarEdgeInserterCore
virtual ~VarEdgeInserterCore()
Definition: VarEdgeInserterCore.h:57
ogdf::VarEdgeInserterCore
Definition: VarEdgeInserterCore.h:51
ogdf::VarEdgeInserterCore::m_pEip
SList< adjEntry > * m_pEip
Definition: VarEdgeInserterCore.h:97
ogdf::VarEdgeInserterCore::storeTypeOfCurrentEdge
virtual void storeTypeOfCurrentEdge(edge eOrig)
Definition: VarEdgeInserterCore.h:82
ogdf::VarEdgeInserterUMLCore::storeTypeOfCurrentEdge
void storeTypeOfCurrentEdge(edge eOrig) override
Definition: VarEdgeInserterCore.h:120
ogdf::VarEdgeInserterCore::runsPostprocessing
int runsPostprocessing() const
Definition: VarEdgeInserterCore.h:65
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::VarEdgeInserterCore::m_pr
PlanRepLight & m_pr
Definition: VarEdgeInserterCore.h:89
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::PlanRepLight::typeOrig
EdgeType typeOrig(edge eOrig) const
Definition: PlanRepLight.h:82
PlanRepLight.h
Declaration of class PlanRepLight.
basic.h
Basic declarations, included by all source files.
ogdf::VarEdgeInserterCore::m_GtoBC
NodeArray< node > m_GtoBC
Definition: VarEdgeInserterCore.h:103
ogdf::VarEdgeInserterCore::m_compV
NodeArray< SList< int > > m_compV
Definition: VarEdgeInserterCore.h:100
ogdf::VarEdgeInserterCore::m_t
node m_t
Definition: VarEdgeInserterCore.h:95
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::VarEdgeInserterCore::m_pSubgraph
const EdgeArray< uint32_t > * m_pSubgraph
Definition: VarEdgeInserterCore.h:93
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::VarEdgeInserterUMLCore::m_typeOfCurrentEdge
Graph::EdgeType m_typeOfCurrentEdge
Definition: VarEdgeInserterCore.h:128
ogdf::Timeouter
class for timeout funtionality.
Definition: Timeouter.h:46
ogdf::VarEdgeInserterUMLCore::buildSubpath
virtual void buildSubpath(node v, edge eIn, edge eOut, List< adjEntry > &L, ExpandedGraph &Exp, node s, node t) override
Module.h
Declares base class for all module types.
ogdf::VarEdgeInserterCore::m_nodeB
Array< SList< node > > m_nodeB
Definition: VarEdgeInserterCore.h:101
ogdf::VarEdgeInserterCore::m_st
edge m_st
Definition: VarEdgeInserterCore.h:96
ogdf::Module::ReturnType
ReturnType
The return type of a module.
Definition: Module.h:52
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716