pgr_chinesePostman
- Experimental¶
pgr_chinesePostman
— Calculates the shortest circuit path which contains
every edge in a directed graph and starts and ends on the same vertex.
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 comunity.
Might depend on a proposed function of pgRouting
Might depend on a deprecated function of pgRouting
Availability
Version 3.0.0
New experimental signature
Description¶
The main characteristics are:
Process is done only on edges with positive costs.
Running time: \(O(E * (E + V * logV))\)
Graph must be connected.
Returns
EMPTY SET
on a disconnected graph
Signatures¶
(seq, node, edge, cost, agg_cost)
- Example:
SELECT * FROM pgr_chinesePostman(
'SELECT id, source, target, cost, reverse_cost
FROM edges WHERE id < 17');
seq | node | edge | cost | agg_cost
-----+------+------+------+----------
1 | 1 | 6 | 1 | 0
2 | 3 | 7 | 1 | 1
3 | 7 | 4 | 1 | 2
4 | 6 | 4 | 1 | 3
5 | 7 | 8 | 1 | 4
6 | 11 | 8 | 1 | 5
7 | 7 | 10 | 1 | 6
8 | 8 | 12 | 1 | 7
9 | 12 | 13 | 1 | 8
10 | 17 | 15 | 1 | 9
11 | 16 | 15 | 1 | 10
12 | 17 | 15 | 1 | 11
13 | 16 | 16 | 1 | 12
14 | 15 | 16 | 1 | 13
15 | 16 | 9 | 1 | 14
16 | 11 | 11 | 1 | 15
17 | 12 | 13 | 1 | 16
18 | 17 | 15 | 1 | 17
19 | 16 | 16 | 1 | 18
20 | 15 | 3 | 1 | 19
21 | 10 | 5 | 1 | 20
22 | 11 | 9 | 1 | 21
23 | 16 | 16 | 1 | 22
24 | 15 | 3 | 1 | 23
25 | 10 | 2 | 1 | 24
26 | 6 | 1 | 1 | 25
27 | 5 | 1 | 1 | 26
28 | 6 | 4 | 1 | 27
29 | 7 | 10 | 1 | 28
30 | 8 | 14 | 1 | 29
31 | 9 | 14 | 1 | 30
32 | 8 | 10 | 1 | 31
33 | 7 | 7 | 1 | 32
34 | 3 | 6 | 1 | 33
35 | 1 | -1 | 0 | 34
(35 rows)
Parameters¶
Parameter |
Type |
Description |
---|---|---|
|
Edges SQL as described below. |
Inner Queries¶
Edges SQL¶
An Edges SQL that represents a directed graph with the following columns
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 (seq, node, edge, cost, agg_cost)
Column |
Type |
Description |
---|---|---|
|
|
Sequential value starting from |
|
|
Identifier of the node in the path from |
|
|
Identifier of the edge used to go from |
|
|
Cost to traverse from |
|
|
Aggregate cost from |
See Also¶
Indices and tables