pgr_transitiveClosure
- Experimental¶
pgr_transitiveClosure
— Transitive closure graph of a directed graph.
Warning
Possible server crash
These functions might create a server crash
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 community.
Might depend on a proposed function of pgRouting
Might depend on a deprecated function of pgRouting
Availability
Version 4.0.0
Standardized output to
(node,targets)
Version 3.0.0
New experimental function.
Description¶
Transforms the input directed graph into the transitive closure of the graph.
The main characteristics are:
Process is valid for directed graphs.
The transitive closure of an undirected graph produces a cluster graph
Reachability between vertices on an undirected graph happens when they belong to the same connected component. (see pgr_connectedComponents)
The returned values are not ordered
The returned graph is compressed
Running time:
Signatures¶
Summary
The pgr_transitiveClosure function has the following signature:
(node,targets)
- Example:
Rechability of a subgraph
SELECT * FROM pgr_transitiveclosure(
'SELECT id, source, target, cost, reverse_cost
FROM edges WHERE id IN (2, 3, 5, 11, 12, 13, 15)')
ORDER BY node;
node | targets
------+--------------------
6 | {}
8 | {12,17,16}
10 | {12,17,16,11,6}
11 | {12,17,16}
12 | {17,16}
15 | {12,17,16,10,11,6}
16 | {17,16}
17 | {17,16}
(8 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 (node,targets)
Column |
Type |
Description |
---|---|---|
|
|
Sequential value starting from |
|
|
Identifier of the source of the edges |
|
|
Identifiers of the targets of the edges
|
See Also¶
Indices and tables