pgr_bridges - Experimental

pgr_bridges - Return the bridges of an undirected graph.

_images/boost-inside.jpeg

Boost Graph Inside

Warning

Experimental functions

  • They are not officially of the current release.
  • They likely will not be officially be part of the next release:
    • The functions might not make use of ANY-INTEGER and ANY-NUMERICAL
    • Name might change.
    • Signature might change.
    • Functionality might change.
    • pgTap tests might be missing.
    • Might need c/c++ coding.
    • May lack documentation.
    • Documentation if any might need to be rewritten.
    • Documentation examples might need to be automatically generated.
    • Might need a lot of feedback from the comunity.
    • Might depend on a proposed function of pgRouting
    • Might depend on a deprecated function of pgRouting

Synopsis

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.

Characteristics

The main Characteristics are:

  • The returned values are ordered:
    • edge ascending
  • Running time: \(O(E * (V + E))\)

Signatures

pgr_bridges(edges_sql)

RETURNS SET OF (seq, node)
    OR EMPTY SET

The signature is for a undirected graph.

Example:
SELECT * FROM pgr_bridges(
    'SELECT id, source, target, cost, reverse_cost FROM edge_table'
);
 seq | edge
-----+------
   1 |    1
   2 |    6
   3 |    7
   4 |   14
   5 |   17
   6 |   18
(6 rows)

_images/bridge_sampledata.png

Description of the Signatures

Description of the edges_sql query for components functions

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)

  • When negative: edge (source, target) does not exist, therefore it’s not part of the graph.
reverse_cost ANY-NUMERICAL -1

Weight of the edge (target, source),

  • When negative: edge (target, source) does not exist, therefore it’s not part of the graph.

Where:

ANY-INTEGER:SMALLINT, INTEGER, BIGINT
ANY-NUMERICAL:SMALLINT, INTEGER, BIGINT, REAL, FLOAT

Description of the parameters of the signatures

Parameter Type Default Description
edges_sql TEXT   SQL query as described above.

Description of the return values for bridges

Returns set of (seq, node)

Column Type Description
seq INT Sequential value starting from 1.
edge BIGINT Identifier of the edge.

See Also

Indices and tables