Kruskal - Family of functions - pgRouting Manual (3.4)
Kruskal - Family of functions
Description
Kruskal’s algorithm is a greedy minimum spanning tree algorithm that in each cycle finds and adds the edge of the least possible weight that connects any two trees in the forest.
The main Characteristics are:
-
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.
-
-
The total weight of all the edges in the tree or forest is minimized.
-
Kruskal’s running time: \(O(E * log E)\)
Inner Queries
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
See Also
Indices and tables