BFS - Category - pgRouting Manual (3.4)
BFS - Category
Traversal using breadth first search.
-
It’s implementation is only on undirected graph.
-
Process is done only on edges with positive costs.
-
When the graph is connected
-
The resulting edges make up a tree
-
-
When the graph is not connected,
-
Finds a minimum spanning tree for each connected component.
-
The resulting edges make up a forest.
-
Parameters
Parameter |
Type |
Description |
---|---|---|
|
Edges SQL as described below. |
|
root vid |
|
Identifier of the root vertex of the tree.
|
root vids |
|
Array of identifiers of the root vertices.
|
Where:
- ANY-INTEGER :
-
SMALLINT, INTEGER, BIGINT
- ANY-NUMERIC :
-
SMALLINT, INTEGER, BIGINT, REAL, FLOAT, NUMERIC
BFS optional parameters
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
\(9223372036854775807\) |
Upper limit of the depth of the tree.
|
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
(seq,
depth,
start_vid,
node,
edge,
cost,
agg_cost)
Parameter |
Type |
Description |
---|---|---|
|
|
Sequential value starting from \(1\) . |
|
|
Depth of the
|
|
|
Identifier of the root vertex. |
|
|
Identifier of
|
|
|
Identifier of the
|
|
|
Cost to traverse
|
|
|
Aggregate cost from
|
Where:
- ANY-INTEGER :
-
SMALLINT, INTEGER, BIGINT
- ANY-NUMERIC :
-
SMALLINT, INTEGER, BIGINT, REAL, FLOAT, NUMERIC
See Also
Indices and tables