Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

Triconnectivity.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/NodeArray.h>
37 #include <ogdf/basic/EdgeArray.h>
38 #include <ogdf/basic/Array.h>
39 #include <ogdf/basic/GraphCopy.h>
40 
41 namespace ogdf {
42 
46 {
47 public:
52  explicit Triconnectivity(const Graph &G);
53 
61  Triconnectivity(const Graph &G, bool &isTric, node &s1, node &s2);
62 
63  Triconnectivity(const Triconnectivity &) = delete;
64 
65  ~Triconnectivity();
66 
68  enum class CompType { bond, polygon, triconnected };
69 
71  struct CompStruct {
74 
76  m_edges.pushBack(e);
77  return *this;
78  }
79 
81  m_edges.pushBack(e);
82  m_type = (m_edges.size() >= 4) ? CompType::triconnected : CompType::polygon;
83  }
84  };
85 
91  int m_numComp;
92 
97  bool checkComp();
98 
99 
100 private:
101  bool checkSepPair(edge eVirt);
102 
105  void splitMultiEdges();
106 
108  int *m_TSTACK_h, *m_TSTACK_a, *m_TSTACK_b;
109  int m_top;
110 
112  void TSTACK_push (int h, int a, int b) {
113  m_TSTACK_h[++m_top] = h;
114  m_TSTACK_a[m_top] = a;
115  m_TSTACK_b[m_top] = b;
116  }
117 
119  void TSTACK_pushEOS() {
120  m_TSTACK_a[++m_top] = -1;
121  }
122 
124  bool TSTACK_notEOS() {
125  return m_TSTACK_a[m_top] != -1;
126  }
127 
130  return m_component[m_numComp++];
131  }
132 
135  CompStruct &C = m_component[m_numComp++];
136  C.m_type = t;
137  return C;
138  }
139 
141  enum class EdgeType { unseen, tree, frond, removed };
142 
144  void DFS1 (const Graph& G, node v, node u);
146  void DFS1 (const Graph& G, node v, node u, node &s1);
147 
149  void buildAcceptableAdjStruct (const Graph& G);
151  void DFS2 (const Graph& G);
152  void pathFinder(const Graph& G, node v);
153 
155  void pathSearch (const Graph& G, node v);
156 
157  bool pathSearch (const Graph &G, node v, node &s1, node &s2);
158 
160  void assembleTriconnectedComponents();
161 
163  void printOs(edge e);
164  void printStacks();
165 
167  int high(node v) {
168  return (m_HIGHPT[v].empty()) ? 0 : m_HIGHPT[v].front();
169  }
170 
171  void delHigh(edge e) {
172  ListIterator<int> it = m_IN_HIGH[e];
173  if (it.valid()) {
174  node v = e->target();
175  m_HIGHPT[v].del(it);
176  }
177  }
178 
195 
198  bool m_newPath;
199 };
200 
201 }
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:328
representation of a component
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
void TSTACK_pushEOS()
push end-of-stack marker on TSTACK
iterator pushBack(const E &x)
Adds element x at the end of the list.
Definition: List.h:1373
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
EdgeType
type of edges with respect to palm tree
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
bool m_newPath
true iff we start a new path
Array< node > m_NODEAT
node with number i
EdgeArray< ListIterator< edge > > m_IN_ADJ
pointer to element in adjacency list containing e
CompStruct & newComp(CompType t)
create a new empty component of type t
GraphCopySimple * m_pGC
copy of G containing also virtual edges
int high(node v)
returns high(v) value
int * m_TSTACK_h
stack of triples
Declaration and implementation of Array class and Array algorithms.
EdgeArray< EdgeType > m_TYPE
type of edge e
CompType
type of split-components / triconnected components
bool valid() const
Returns true iff the iterator points to an element.
Definition: List.h:124
Array< CompStruct > m_component
array of components
NodeArray< int > m_LOWPT1
void TSTACK_push(int h, int a, int b)
push a triple on TSTACK
NodeArray< int > m_NEWNUM
(second) dfs-number of v
Declaration and implementation of EdgeArray class.
ArrayBuffer< edge > m_ESTACK
stack of currently active edges
NodeArray< int > m_DEGREE
degree of v
Declaration of graph copy classes.
EdgeArray< bool > m_START
edge starts a path
Class for the representation of edges.
Definition: Graph_d.h:292
Copies of graphs with mapping between nodes and edges.
Definition: GraphCopy.h:60
Class for the representation of nodes.
Definition: Graph_d.h:169
Declaration and implementation of NodeArray class.
Encapsulates a pointer to a list element.
Definition: List.h:42
NodeArray< int > m_ND
number of descendants in palm tree
node m_start
start node of dfs traversal
NodeArray< List< edge > > m_A
adjacency list of v
int m_numComp
number of components
NodeArray< List< int > > m_HIGHPT
list of fronds entering v in the order they are visited
CompStruct & newComp()
create a new empty component
NodeArray< edge > m_TREE_ARC
tree arc entering v
int size() const
Returns the number of elements in the list.
Definition: List.h:1312
NodeArray< int > m_LOWPT2
for every hyperedge e a minimal subcubic tree connecting all hypernodes incident with e together is a...
The namespace for all OGDF objects.
bool TSTACK_notEOS()
returns true iff end-of-stack marker is not on top of TSTACK
int m_numCount
counter for dfs-traversal
NodeArray< node > m_FATHER
father of v in palm tree
EdgeArray< ListIterator< int > > m_IN_HIGH
pointer to element in HIGHPT list containing e
NodeArray< int > m_NUMBER
(first) dfs-number of v
realizes Hopcroft/Tarjan algorithm for finding the triconnected components of a biconnected multi-gra...