Components - Family of functions¶
- pgr_connectedComponents - Connected components of an undirected graph.
- pgr_strongComponents - Strongly connected components of a directed graph.
- pgr_biconnectedComponents - Biconnected components of an undirected graph.
- pgr_articulationPoints - Articulation points of an undirected graph.
- pgr_bridges - Bridges of an undirected graph.
Previous versions of this page
Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
| Edges SQL | TEXT |
Inner query as described below. |
Inner query¶
| Edges SQL: | an SQL query 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 |
Result Columns¶
pgr_connectedComponents & pgr_strongComponents¶
Returns set of (seq, component, node)
| Column | Type | Description |
|---|---|---|
| seq | BIGINT |
Sequential value starting from 1. |
| component | BIGINT |
Component identifier. It is equal to the minimum node identifier in the component. |
| node | BIGINT |
Identifier of the vertex that belongs to component. |
pgr_biconnectedComponents¶
Returns set of (seq, component, edge)
| Column | Type | Description |
|---|---|---|
| seq | BIGINT |
Sequential value starting from 1. |
| component | BIGINT |
Component identifier. It is equal to the minimum edge identifier in the component. |
| edge | BIGINT |
Identifier of the edge. |
pgr_articulationPoints¶
Returns set of (node)
| Column | Type | Description |
|---|---|---|
| node | BIGINT |
Identifier of the vertex. |
pgr_bridges¶
Returns set of (edge)
| Column | Type | Description |
|---|---|---|
| edge | BIGINT |
Identifier of the edge that is a bridge. |
