[pgrouting-users] Can pgr_connectedComponents be used to find isolated vertices?

Regina Obe lr at pcorp.us
Wed Aug 2 10:56:25 PDT 2023


I would say yes.  If you have multiple components, then those components are
not reachable from each other.

 

Note this is only considering an undirected graph.

 

If you have a directed graph, use pgr_strongComponents instead
https://docs.pgrouting.org/latest/en/pgr_strongComponents.html

 

 

 

 

From: Pgrouting-users [mailto:pgrouting-users-bounces at lists.osgeo.org] On
Behalf Of glad.pen2421 at fastmail.com
Sent: Wednesday, August 2, 2023 12:40 PM
To: pgrouting-users at lists.osgeo.org
Subject: [pgrouting-users] Can pgr_connectedComponents be used to find
isolated vertices?

 

Dear fellow pgRouting users,

 

As per the description of `pgr_connectedComponents`, it runs a breadth-first
search to find sets of vertices "that are all reachable from each other".

 

Does that mean that if `pgr_connectedComponents` results in more than one
connected component, some vertices are definitely not reachable from each
other?

 

Can this be a way to guarantee that with more than 1 connected component it
is guaranteed that algorithms like `pgr_dijkstra` will definitely fail on
some pairs of vertices?

 

Thank you.

 

GP

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20230802/f05c85d7/attachment.htm>


More information about the Pgrouting-users mailing list