You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: algorithms/mst.md
+16-17Lines changed: 16 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ parent: "Algorithms"
8
8
9
9
## Overview
10
10
11
-
The Minimum Spanning Tree (MST) identifies the minimum weight acyclic graph (tree) spanning every node in each weakly connected component in the graph, disregarding edge directions. Any nodes that shared a weakly connected component still share that component in the MST sub-graph.
11
+
The Minimum Spanning Tree (MST) finds the relationships with minimum weights such that any weakly connected component in the graph stays connected. It treats all edges as bi-directional and ensures that any pair of nodes that previously shared a path will still share a unique path in the MST subgraph.
12
12
13
13
MST serves as a common algorithm in scenarios such as:
14
14
- Designing a cost-effective road network connecting several cities.
@@ -19,7 +19,7 @@ MST serves as a common algorithm in scenarios such as:
19
19
20
20
MST first assigns each node to its own component. It iteratively scans for the minimum edges linking nodes across different components and merges them, ignoring the direction of edges throughout the process. The algorithm terminates when no further merges occur, producing a collection of trees.
21
21
22
-
The procedure finds a minimum or maximum weight spanning tree based on the specified attribute. If no attribute is given, returns any spanning tree. If any specified edges do not have the given weight attribute, or the value of the attribute is non-numeric, then they are treated as if they had infinite weight. Such an edge would only be included in the minimum spanning tree if no other edges with a valid weight attribute bridge the components it connects.
22
+
The procedure finds a minimum or maximum weight spanning tree based on the specified `objective` and optimizes for the given `weightAttribute`. If no attribute is given, MST returns any collection of spanning trees. If any specified edges do not have the given weight attribute, or the value of the attribute is non-numeric, then they are treated as if they had infinite weight. Such an edge would only be included in the minimum spanning tree if no other edges with a valid weight attribute bridge the components it connects.
23
23
24
24
## Syntax
25
25
@@ -29,7 +29,7 @@ CALL algo.mst([config])
29
29
30
30
### Parameters
31
31
32
-
The procedure accepts an optional configuration `Map` with the following parameters:
32
+
The procedure accepts an optional configuration `Map` with the following optional parameters:
Suppose you are an urban planner tasked with designing a new transportation network for a town. There are several vital buildings that must be connected by this new network. A cost estimator has already provided you with the estimated cost for some of the potential routes between these buildings.
79
+
80
+
Your goal is to connect every major building with the lowest total cost, even if travel between some buildings requires multiple stops and different modes of transport. The Minimum Spanning Tree algorithm helps you achieve this by identifying the most cost-effective network.
0 commit comments