pgr_bridges
- Return the bridges of an undirected graph.
Availability
seq
is removedSupport
A bridge is an edge of an undirected graph whose deletion increases its number of connected components. This implementation can only be used with an undirected graph.
The main characteristics are:
pgr_bridges(Edges SQL)
RETURNS SET OF (edge)
OR EMPTY SET
Example: | The bridges of the graph |
---|
SELECT * FROM pgr_bridges(
'SELECT id, source, target, cost, reverse_cost FROM edge_table'
);
edge
------
1
6
7
14
17
18
(6 rows)
Parameter | Type | Default | Description |
---|---|---|---|
Edges SQL | TEXT |
Inner query as described below. |
edges SQL: | an SQL query of an undirected graph, which should return a set of rows with the following columns: |
---|
Column | Type | Default | Description |
---|---|---|---|
id | ANY-INTEGER |
Identifier of the edge. | |
source | ANY-INTEGER |
Identifier of the first end point vertex of the edge. | |
target | ANY-INTEGER |
Identifier of the second end point vertex of the edge. | |
cost | ANY-NUMERICAL |
Weight of the edge (source, target)
|
|
reverse_cost | ANY-NUMERICAL |
-1 | Weight of the edge (target, source),
|
Where:
ANY-INTEGER: | SMALLINT, INTEGER, BIGINT |
---|---|
ANY-NUMERICAL: | SMALLINT, INTEGER, BIGINT, REAL, FLOAT |
Returns set of (edge)
Column | Type | Description |
---|---|---|
edge | BIGINT |
Identifier of the edge that is a bridge. |
Indices and tables