Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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>
40 #include <ogdf/basic/GraphCopy.h>
41 
42 namespace ogdf {
43 
47 {
48 public:
53  explicit Triconnectivity(const Graph &G);
54 
62  Triconnectivity(const Graph &G, bool &isTric, node &s1, node &s2);
63 
64  Triconnectivity(const Triconnectivity &) = delete;
65 
66  ~Triconnectivity();
67 
69  enum class CompType { bond, polygon, triconnected };
70 
72  struct CompStruct {
75 
77  m_edges.pushBack(e);
78  return *this;
79  }
80 
82  m_edges.pushBack(e);
83  m_type = (m_edges.size() >= 4) ? CompType::triconnected : CompType::polygon;
84  }
85  };
86 
92  int m_numComp;
93 
98  bool checkComp();
99 
100 
101 private:
102  bool checkSepPair(edge eVirt);
103 
106  void splitMultiEdges();
107 
109  int *m_TSTACK_h, *m_TSTACK_a, *m_TSTACK_b;
110  int m_top;
111 
113  void TSTACK_push (int h, int a, int b) {
114  m_TSTACK_h[++m_top] = h;
115  m_TSTACK_a[m_top] = a;
116  m_TSTACK_b[m_top] = b;
117  }
118 
120  void TSTACK_pushEOS() {
121  m_TSTACK_a[++m_top] = -1;
122  }
123 
125  bool TSTACK_notEOS() {
126  return m_TSTACK_a[m_top] != -1;
127  }
128 
131  return m_component[m_numComp++];
132  }
133 
136  CompStruct &C = m_component[m_numComp++];
137  C.m_type = t;
138  return C;
139  }
140 
142  enum class EdgeType { unseen, tree, frond, removed };
143 
145  void DFS1 (const Graph& G, node v, node u);
147  void DFS1 (const Graph& G, node v, node u, node &s1);
148 
150  void buildAcceptableAdjStruct (const Graph& G);
152  void DFS2 (const Graph& G);
153  void pathFinder(const Graph& G, node v);
154 
156  void pathSearch (const Graph& G, node v);
157 
158  bool pathSearch (const Graph &G, node v, node &s1, node &s2);
159 
161  void assembleTriconnectedComponents();
162 
164  void printOs(edge e);
165  void printStacks();
166 
168  int high(node v) {
169  return (m_HIGHPT[v].empty()) ? 0 : m_HIGHPT[v].front();
170  }
171 
172  void delHigh(edge e) {
173  ListIterator<int> it = m_IN_HIGH[e];
174  if (it.valid()) {
175  node v = e->target();
176  m_HIGHPT[v].del(it);
177  }
178  }
179 
196 
199  bool m_newPath;
200 };
201 
202 
203 } // end namespace ogdf
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:327
representation of a component
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:56
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:1316
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
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
BoundedStack< edge > m_ESTACK
stack of currently active edges
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 bounded stack class.
Declaration and implementation of Array class and Array algorithms.
EdgeArray< EdgeType > m_TYPE
type of edge e
CompType
type of split-components / triconnected components
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.
NodeArray< int > m_DEGREE
degree of v
The parameterized class BoundedStack implements stacks with bounded size.
Definition: BoundedStack.h:46
Declaration of graph copy classes.
EdgeArray< bool > m_START
edge starts a path
Class for the representation of edges.
Definition: Graph_d.h:291
Copies of graphs with mapping between nodes and edges.
Definition: GraphCopy.h:60
Class for the representation of nodes.
Definition: Graph_d.h:167
Declaration and implementation of NodeArray class.
Encapsulates a pointer to a list element.
Definition: List.h:41
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:1255
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
bool valid() const
Returns true iff the iterator points to an element.
Definition: List.h:112
NodeArray< int > m_NUMBER
(first) dfs-number of v
realizes Hopcroft/Tarjan algorithm for finding the triconnected components of a biconnected multi-gra...