Skip to content

Commit 0920c76

Browse files
FlorentinDadamnsch
andcommitted
Ignore the result in the sampled WCC example
The component ids are not deterministic, so for now we just ignore them Co-authored-by: Adam Schill Collberg <adam.schill.collberg@protonmail.com>
1 parent d1e9d3a commit 0920c76

File tree

1 file changed

+10
-7
lines changed
  • doc/modules/ROOT/pages/algorithms

1 file changed

+10
-7
lines changed

doc/modules/ROOT/pages/algorithms/wcc.adoc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,12 @@ CALL gds.graph.project(
626626
The following query is identical to the stream example in the xref:algorithms/wcc.adoc#algorithms-wcc-examples-seeding[previous section].
627627
This time, we execute WCC on `myIndexedGraph` which will allow the algorithm to use the sampled strategy.
628628

629-
[role=query-example]
629+
[role=query-example, no-result=true]
630630
--
631631
.The following will run the algorithm with sampled strategy and stream results:
632632
[source, cypher, role=noplay]
633633
----
634-
CALL gds.wcc.stream('myIndexedGraph', { consecutiveIds: true })
634+
CALL gds.wcc.stream('myIndexedGraph')
635635
YIELD nodeId, componentId
636636
RETURN gds.util.asNode(nodeId).name AS name, componentId
637637
ORDER BY componentId, name
@@ -644,11 +644,14 @@ ORDER BY componentId, name
644644
| "Alice" | 0
645645
| "Bridget" | 0
646646
| "Charles" | 0
647-
| "Doug" | 1
648-
| "Mark" | 1
649-
| "Michael" | 1
647+
| "Doug" | 3
648+
| "Mark" | 3
649+
| "Michael" | 3
650650
|===
651651
--
652652

653-
Here we also demonstrate the use of `conscutiveIds: true`, the results are semantically the same as before.
654-
However, on larger graphs, there will be a notable improvement in compute time.
653+
[NOTE]
654+
====
655+
Because of the randomness in the Graph sampling optimization, running it another time might yield a different componentIds.
656+
For our case here it would be equally plausible to get the inverse solution, f.i. when our community `0` nodes are mapped to community `3` instead, and vice versa.
657+
====

0 commit comments

Comments
 (0)