Skip to content

Commit 5669659

Browse files
committed
updated msf to reflect new yields
1 parent 60ec0e5 commit 5669659

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

algorithms/msf.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parent: "Algorithms"
88

99
## Overview
1010

11-
The Minimum Spanning Forest (MSF) 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 MSF subgraph.
11+
The Minimum Spanning Forest (MSF) 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 MSF graph.
1212

1313
MSF serves as a common algorithm in scenarios such as:
1414
- Designing a cost-effective road network connecting several cities.
@@ -39,15 +39,12 @@ The procedure accepts an optional configuration `Map` with the following optiona
3939
| `weightAttribute` | string | Unweighted | the attribute to use as the tree weight. |
4040

4141
### Return Values
42-
The procedure returns a stream of records with the following fields:
43-
44-
| Name | Type | Description |
45-
|----------|--------|-----------------------------------------------|
46-
| `edge` | Edge | An edge entity which is part of the MSF graph |
47-
| `weight` | Double | The weight of the Edge |
48-
49-
42+
The procedure returns a stream of records corresponding to each tree in the forest with the following fields:
5043

44+
| Name | Type | Description |
45+
|---------|------|----------------------------------|
46+
| `edges` | List | The edges that connect each tree |
47+
| `nodes` | List | The nodes in the tree |
5148

5249
### Create the Graph
5350

@@ -86,6 +83,6 @@ CALL algo.MSF({weightAttribute: 'cost'}) YIELD edge, weight
8683
```
8784

8885
#### Expected Results
89-
The algorithm would yeild the following edge objects and their weights:
86+
The algorithm would yield a single tree containing the following edge and node objects:
9087

9188
![City MSF Graph](../images/city_msf.png)

0 commit comments

Comments
 (0)