Skip to content

Commit 560de8c

Browse files
Add mem estimation and structure examples section.
1 parent 42f99c6 commit 560de8c

File tree

1 file changed

+48
-7
lines changed

1 file changed

+48
-7
lines changed

doc/modules/ROOT/pages/algorithms/harmonic-centrality.adoc

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,17 @@ include::partial$/algorithms/common-configuration/common-write-configuration-ent
213213
214214
====
215215

216-
[[algorithms-harmonic-centrality-sample]]
217-
== Harmonic Centrality algorithm example
216+
[[algorithms-harmonic-centrality-examples]]
217+
== Examples
218218

219-
.The following will create a sample graph:
219+
include::partial$/algorithms/shared/examples-named-native-note.adoc[]
220+
221+
:algorithm-name: {algorithm}
222+
:graph-description: user network
223+
:image-file: wcc-graph.svg
224+
include::partial$/algorithms/shared/examples-intro.adoc[]
225+
226+
.The following Cypher statement will create the example graph in the Neo4j database:
220227
[source, cypher, role=noplay setup-query]
221228
----
222229
CREATE (a:User {name: "Alice"}),
@@ -229,7 +236,7 @@ CREATE (a:User {name: "Alice"}),
229236
(d)-[:LINK]->(e)
230237
----
231238

232-
.The following will project and store a named graph:
239+
.The following statement will project a graph using a Cypher projection and store it in the graph catalog under the name 'graph'.
233240
[source, cypher, role=noplay graph-project-query]
234241
----
235242
MATCH (source:User)-[r:LINK]->(target:User)
@@ -242,6 +249,33 @@ RETURN gds.graph.project(
242249
)
243250
----
244251

252+
In the following examples we will demonstrate using the Harmonic Centrality algorithm on this graph.
253+
254+
[[algorithms-harmonic-examples-memory-estimation]]
255+
=== Memory Estimation
256+
257+
:mode: stream
258+
include::partial$/algorithms/shared/examples-estimate-intro.adoc[]
259+
260+
[role=query-example]
261+
--
262+
.The following will estimate the memory requirements for running the algorithm in stream mode:
263+
[source, cypher, role=noplay]
264+
----
265+
CALL gds.closeness.harmonic.stream.estimate('graph', {})
266+
YIELD nodeCount, relationshipCount, bytesMin, bytesMax, requiredMemory
267+
----
268+
269+
.Results
270+
[opts="header"]
271+
|===
272+
| nodeCount | relationshipCount | bytesMin | bytesMax | requiredMemory
273+
| 5 | 6 | 672 | 672 | "672 Bytes"
274+
|===
275+
--
276+
277+
[[algorithms-harmonic-examples-stream]]
278+
=== Stream
245279
[role=query-example]
246280
--
247281
.The following will run the algorithm and stream results:
@@ -265,6 +299,9 @@ ORDER BY score DESC
265299
|===
266300
--
267301

302+
[[algorithms-harmonic-examples-stats]]
303+
=== Stats
304+
268305
[role=query-example]
269306
--
270307
.The following will run the algorithm and return statistics:
@@ -282,9 +319,11 @@ YIELD centralityDistribution
282319
|===
283320
--
284321

322+
[[algorithms-harmonic-examples-mutate]]
323+
=== Mutate
285324
[role=query-example]
286325
--
287-
.The following will run the algorithm and update the graph:
326+
.The following will run the algorithm in mutate mode and update the in-memory graph:
288327
[source, cypher, role=noplay]
289328
----
290329
CALL gds.closeness.harmonic.mutate('graph', {mutateProperty: 'harmonicScore'})
@@ -299,9 +338,11 @@ YIELD nodePropertiesWritten, centralityDistribution
299338
|===
300339
--
301340

341+
[[algorithms-harmonic-examples-write]]
342+
=== Write
302343
[role=query-example]
303344
--
304-
.The following will run the algorithm and write back results:
345+
.The following will run the algorithm and write the results back to the Neo4j database:
305346
[source, cypher, role=noplay]
306347
----
307348
CALL gds.closeness.harmonic.write('graph', {writeProperty: 'score'})
@@ -314,4 +355,4 @@ YIELD nodePropertiesWritten
314355
| nodePropertiesWritten
315356
| 5
316357
|===
317-
--
358+
--

0 commit comments

Comments
 (0)