Skip to content

Commit 01436f1

Browse files
Add stats and estimation examples to Louvain docs
Co-Authored-By: Jonatan Jäderberg <[email protected]>
1 parent 190cbd1 commit 01436f1

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

doc/asciidoc/algorithms/louvain.adoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ This topic includes:
1818
** <<algorithms-louvain-examples-stream-weighted, Weights>>
1919
** <<algorithms-louvain-examples-stream-seeded, Seeding>>
2020
** <<algorithms-louvain-examples-stream-intermediate, Multi-Level>>
21+
** <<algorithms-louvain-examples-memory-estimation, Memory Estimation>>
22+
** <<algorithms-louvain-examples-stats, Stats>>
23+
2124

2225
[[algorithms-louvain-intro]]
2326
== Introduction
@@ -559,3 +562,44 @@ ORDER BY name ASC
559562
--
560563

561564
In this example graph, after the first iteration we see 4 clusters, which in the second iteration are reduced to three.
565+
566+
567+
[[algorithms-louvain-examples-memory-estimation]]
568+
=== Memory Estimation
569+
570+
[role=query-example]
571+
--
572+
.The following will estimate the memory requirements for running the algorithm:
573+
[source, cypher]
574+
----
575+
CALL gds.louvain.write.estimate('myGraph', { writeProperty: 'community' })
576+
YIELD nodeCount, relationshipCount, bytesMin, bytesMax, requiredMemory
577+
----
578+
579+
.Results
580+
[opts="header", cols="1,1,1,1,1"]
581+
|===
582+
| nodeCount | relationshipCount | bytesMin | bytesMax | requiredMemory
583+
| 6 | 7 | 5361 | 580408 | "[5361 Bytes \... 566 KiB]"
584+
|===
585+
--
586+
587+
[[algorithms-louvain-examples-stats]]
588+
=== Stats
589+
590+
[role=query-example]
591+
--
592+
.The following will run the algorithm and returns the result in form of statistical and measurement values
593+
[source, cypher]
594+
----
595+
CALL gds.louvain.stats('myGraph')
596+
YIELD communityCount
597+
----
598+
599+
.Results
600+
[opts="header",cols="1"]
601+
|===
602+
| communityCount
603+
| 2
604+
|===
605+
--

doc/src/test/java/org/neo4j/graphalgo/doc/LouvainDocTest.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.louvain.LouvainStatsProc;
2324
import org.neo4j.graphalgo.louvain.LouvainStreamProc;
2425
import org.neo4j.graphalgo.louvain.LouvainWriteProc;
2526

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

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

3642
@Override

0 commit comments

Comments
 (0)