Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Triconnectivity.h
Go to the documentation of this file.
1
34#pragma once
35
36#include <ogdf/basic/Array.h>
40
41namespace ogdf {
42
47public:
52 explicit Triconnectivity(const Graph& G);
53
61 Triconnectivity(const Graph& G, bool& isTric, node& s1, node& s2);
62
64
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
92
97 bool checkComp();
98
99
100private:
102
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() { m_TSTACK_a[++m_top] = -1; }
120
122 bool TSTACK_notEOS() { return m_TSTACK_a[m_top] != -1; }
123
125 CompStruct& newComp() { return m_component[m_numComp++]; }
126
129 CompStruct& C = m_component[m_numComp++];
130 C.m_type = t;
131 return C;
132 }
133
135 enum class EdgeType { unseen, tree, frond, removed };
136
138 void DFS1(const Graph& G, node v, node u);
140 void DFS1(const Graph& G, node v, node u, node& s1);
141
145 void DFS2(const Graph& G);
146 void pathFinder(const Graph& G, node v);
147
149 void pathSearch(const Graph& G, node v);
150
151 bool pathSearch(const Graph& G, node v, node& s1, node& s2);
152
155
157 void printOs(edge e);
159
161 int high(node v) { return (m_HIGHPT[v].empty()) ? 0 : m_HIGHPT[v].front(); }
162
163 void delHigh(edge e) {
164 ListIterator<int> it = m_IN_HIGH[e];
165 if (it.valid()) {
166 node v = e->target();
167 m_HIGHPT[v].del(it);
168 }
169 }
170
187
191};
192
193}
Declaration and implementation of Array class and Array algorithms.
Declaration and implementation of EdgeArray class.
Declaration of graph copy classes.
Declaration and implementation of NodeArray class.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition ArrayBuffer.h:56
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
node target() const
Returns the target node of the edge.
Definition Graph_d.h:338
Copies of graphs with mapping between nodes and edges.
Definition GraphCopy.h:59
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
int size() const
Returns the number of elements in the list.
Definition List.h:1472
iterator pushBack(const E &x)
Adds element x at the end of the list.
Definition List.h:1531
Encapsulates a pointer to a list element.
Definition List.h:103
bool valid() const
Returns true iff the iterator points to an element.
Definition List.h:137
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
realizes Hopcroft/Tarjan algorithm for finding the triconnected components of a biconnected multi-gra...
EdgeArray< bool > m_START
edge starts a path
void splitMultiEdges()
splits bundles of multi-edges into bonds and creates a new virtual edge in GC.
void assembleTriconnectedComponents()
merges split-components into triconnected components
NodeArray< List< edge > > m_A
adjacency list of v
EdgeArray< ListIterator< int > > m_IN_HIGH
pointer to element in HIGHPT list containing e
NodeArray< int > m_LOWPT1
bool checkSepPair(edge eVirt)
ArrayBuffer< edge > m_ESTACK
stack of currently active edges
void buildAcceptableAdjStruct(const Graph &G)
constructs ordered adjaceny lists
node m_start
start node of dfs traversal
bool checkComp()
Checks if computed triconnected componets are correct.
EdgeType
type of edges with respect to palm tree
EdgeArray< ListIterator< edge > > m_IN_ADJ
pointer to element in adjacency list containing e
void pathFinder(const Graph &G, node v)
CompStruct & newComp()
create a new empty component
NodeArray< int > m_DEGREE
degree of v
CompStruct & newComp(CompType t)
create a new empty component of type t
CompType
type of split-components / triconnected components
Triconnectivity(const Graph &G)
Divides G into triconnected components.
int m_numComp
number of components
Triconnectivity(const Graph &G, bool &isTric, node &s1, node &s2)
Tests G for triconnectivity.
NodeArray< node > m_FATHER
father of v in palm tree
int m_numCount
counter for dfs-traversal
Triconnectivity(const Triconnectivity &)=delete
GraphCopySimple * m_pGC
copy of G containing also virtual edges
void pathSearch(const Graph &G, node v)
finding of split components
void DFS1(const Graph &G, node v, node u)
first dfs traversal
bool TSTACK_notEOS()
returns true iff end-of-stack marker is not on top of TSTACK
Array< node > m_NODEAT
node with number i
int high(node v)
returns high(v) value
void DFS2(const Graph &G)
the second dfs traversal
Array< CompStruct > m_component
array of components
NodeArray< int > m_NUMBER
(first) dfs-number of v
void TSTACK_push(int h, int a, int b)
push a triple on TSTACK
void printOs(edge e)
debugging stuff
bool m_newPath
true iff we start a new path
NodeArray< int > m_ND
number of descendants in palm tree
EdgeArray< EdgeType > m_TYPE
type of edge e
bool pathSearch(const Graph &G, node v, node &s1, node &s2)
void TSTACK_pushEOS()
push end-of-stack marker on TSTACK
NodeArray< edge > m_TREE_ARC
tree arc entering v
NodeArray< List< int > > m_HIGHPT
list of fronds entering v in the order they are visited
void DFS1(const Graph &G, node v, node u, node &s1)
special version for triconnectivity tes
NodeArray< int > m_LOWPT2
NodeArray< int > m_NEWNUM
(second) dfs-number of v
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
@ tree
for every hyperedge e a minimal subcubic tree connecting all hypernodes incident with e together is a...
representation of a component