Skip to content

Commit 190cbd1

Browse files
committed
Add stats and estimation examples to WCC docs
1 parent 4816028 commit 190cbd1

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

doc/asciidoc/algorithms/wcc.adoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This topic includes:
1616
** <<algorithms-wcc-examples-unweighted, Unweighted>>
1717
** <<algorithms-wcc-examples-weighted, Weighted>>
1818
** <<algorithms-wcc-examples-seeding, Seeded components>>
19+
** <<algorithms-wcc-examples-memory-estimation, Memory Estimation>>
20+
** <<algorithms-wcc-examples-stats, Stats>>
1921

2022

2123
[[algorithms-wcc-intro]]
@@ -546,3 +548,45 @@ YIELD nodePropertiesWritten, componentCount;
546548
If the `seedProperty` configuration parameter has the same value as `writeProperty`, the algorithm only writes properties for nodes where the component ID has changed.
547549
If they differ, the algorithm writes properties for all nodes.
548550
====
551+
552+
[[algorithms-wcc-examples-memory-estimation]]
553+
=== Memory Estimation
554+
555+
[role=query-example]
556+
--
557+
.The following will estimate the memory requirements for running the algorithm:
558+
[source, cypher]
559+
----
560+
CALL gds.wcc.write.estimate('myGraph', {
561+
writeProperty: 'communityId'
562+
})
563+
YIELD nodeCount, relationshipCount, bytesMin, bytesMax, requiredMemory
564+
----
565+
566+
.Results
567+
[opts="header",cols="1,1,1,1,1"]
568+
|===
569+
| nodeCount | relationshipCount | bytesMin | bytesMax | requiredMemory
570+
| 7 | 5 | 184 | 184 | "184 Bytes"
571+
|===
572+
--
573+
574+
[[algorithms-wcc-examples-stats]]
575+
=== Stats
576+
577+
[role=query-example]
578+
--
579+
.The following will run the algorithm and returns the result in form of statistical and measurement values
580+
[source, cypher]
581+
----
582+
CALL gds.wcc.stats('myGraph')
583+
YIELD componentCount
584+
----
585+
586+
.Results
587+
[opts="header",cols="1"]
588+
|===
589+
| componentCount
590+
| 2
591+
|===
592+
--

doc/src/test/java/org/neo4j/graphalgo/doc/WccDocTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.neo4j.graphalgo.doc;
2121

2222
import org.neo4j.graphalgo.catalog.GraphCreateProc;
23+
import org.neo4j.graphalgo.wcc.WccStatsProc;
2324
import org.neo4j.graphalgo.wcc.WccStreamProc;
2425
import org.neo4j.graphalgo.wcc.WccWriteProc;
2526

@@ -30,7 +31,12 @@ class WccDocTest extends DocTestBase {
3031

3132
@Override
3233
List<Class<?>> procedures() {
33-
return Arrays.asList(WccStreamProc.class, WccWriteProc.class, GraphCreateProc.class);
34+
return Arrays.asList(
35+
WccStreamProc.class,
36+
WccWriteProc.class,
37+
WccStatsProc.class,
38+
GraphCreateProc.class
39+
);
3440
}
3541

3642
@Override

0 commit comments

Comments
 (0)