pgr_biconnectedComponents
¶
pgr_biconnectedComponents
— Biconnected components of an undirected graph.
Availability
Version 3.0.0
Return columns change:
n_seq
is removedseq
changed type toBIGINT
Official function
Version 2.5.0
New experimental function
Description¶
The biconnected components of an undirected graph are the maximal subsets of vertices such that the removal of a vertex from particular component will not disconnect the component. Unlike connected components, vertices may belong to multiple biconnected components. Vertices can be present in multiple biconnected components, but each edge can only be contained in a single biconnected component.
The main characteristics are:
Works for undirected graphs.
Components are described by edges.
The returned values are ordered:
component
ascending.edge
ascending.
Running time: \(O(V + E)\)
Signatures¶
(seq, component, edge)
- Example:
The biconnected components of the graph
SELECT * FROM pgr_biconnectedComponents(
'SELECT id, source, target, cost, reverse_cost FROM edges'
);
seq | component | edge
-----+-----------+------
1 | 1 | 1
2 | 2 | 2
3 | 2 | 3
4 | 2 | 4
5 | 2 | 5
6 | 2 | 8
7 | 2 | 9
8 | 2 | 10
9 | 2 | 11
10 | 2 | 12
11 | 2 | 13
12 | 2 | 15
13 | 2 | 16
14 | 6 | 6
15 | 7 | 7
16 | 14 | 14
17 | 17 | 17
18 | 18 | 18
(18 rows)
Parameters¶
Parameter |
Type |
Description |
---|---|---|
|
Edges SQL as described below. |
Inner Queries¶
Edges SQL¶
Column |
Type |
Default |
Description |
---|---|---|---|
|
ANY-INTEGER |
Identifier of the edge. |
|
|
ANY-INTEGER |
Identifier of the first end point vertex of the edge. |
|
|
ANY-INTEGER |
Identifier of the second end point vertex of the edge. |
|
|
ANY-NUMERICAL |
Weight of the edge ( |
|
|
ANY-NUMERICAL |
-1 |
Weight of the edge (
|
Where:
- ANY-INTEGER:
SMALLINT
,INTEGER
,BIGINT
- ANY-NUMERICAL:
SMALLINT
,INTEGER
,BIGINT
,REAL
,FLOAT
Result Columns¶
Returns set of (seq, component, edge)
Column |
Type |
Description |
---|---|---|
|
|
Sequential value starting from 1. |
|
|
Component identifier.
|
|
|
Identifier of the edge that belongs to the |
See Also¶
The queries use the Sample Data network.
Boost: Biconnected components
wikipedia: Biconnected component
Indices and tables