Skip to content

Commit ff99dd4

Browse files
Add syntaxt testing
1 parent 7f618dc commit ff99dd4

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.doc.syntax;
21+
22+
import java.util.List;
23+
24+
import static org.neo4j.gds.doc.syntax.SyntaxMode.WRITE;
25+
26+
class KSpanningTreeSyntaxTest extends SyntaxTestBase {
27+
28+
protected Iterable<SyntaxModeMeta> syntaxModes() {
29+
return List.of(
30+
SyntaxModeMeta.of(WRITE)
31+
);
32+
}
33+
34+
@Override
35+
protected String adocFile() {
36+
return "pages/alpha-algorithms/k-minimum-weight-spanning-tree.adoc";
37+
}
38+
}

doc/modules/ROOT/pages/alpha-algorithms/k-minimum-weight-spanning-tree.adoc

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ The minimum weight k-Spanning Tree is NP-Hard. The algorithm in the Neo4j GDS Li
2121
[[algorithms-minimum-k-weight-spanning-tree-syntax]]
2222
== Syntax
2323

24+
include::partial$/algorithms/shared/syntax-intro-named-graph.adoc[]
25+
26+
.K Spanning Tree syntax per mode
27+
[.tabbed-example, caption = ]
28+
====
29+
30+
[.include-with-write]
31+
======
2432
.The following will run the k-spanning tree algorithms and write back results:
2533
[source, cypher, role=noplay]
2634
----
@@ -31,19 +39,19 @@ CALL gds.alpha.kSpanningTree.write(
3139
YIELD effectiveNodeCount: Integer,
3240
preProcessingMillis: Integer,
3341
computeMillis: Integer,
42+
postProcessingMillis: Integer,
3443
writeMillis: Integer,
3544
configuration: Map
3645
----
46+
include::partial$/algorithms/common-configuration/common-parameters.adoc[]
3747

3848
.Configuration
3949
[opts="header",cols="1,1,1,1,4"]
4050
|===
41-
| Name | Type | Default | Optional | Description
42-
| k | Integer | null | no | The result is a tree with `k` nodes and `k − 1` relationships.
43-
| sourceNode | Integer | null | no | The start node ID.
44-
| xref:common-usage/running-algos.adoc#common-configuration-relationship-weight-property[relationshipWeightProperty] | String | null | yes | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted.
45-
| writeProperty | String | n/a | no | The partition that a node belongs to.
46-
| objective | String | 'minimum' | yes | If specified, the parameter dictates whether to try and find the minimum or the maximum k-spanning tree. By default, the algorithm looks for the minimum one. Permitted values are 'minimum' and 'maximum'.
51+
| Name | Type | Default | Optional | Description
52+
include::partial$/algorithms/common-configuration/common-write-configuration-entries.adoc[]
53+
include::partial$/algorithms/k-spanning-tree/specific-configuration.adoc[]
54+
4755
|===
4856

4957
.Results
@@ -53,8 +61,13 @@ YIELD effectiveNodeCount: Integer,
5361
| effectiveNodeCount | Integer | The number of visited nodes.
5462
| preProcessingMillis | Integer | Milliseconds for preprocessing the data.
5563
| computeMillis | Integer | Milliseconds for running the algorithm.
64+
| postProcessingMillis | Integer | Milliseconds for postprocessing results of the algorithm.
5665
| writeMillis | Integer | Milliseconds for writing result data back.
66+
| configuration | Map | The configuration used for running the algorithm.
67+
5768
|===
69+
======
70+
====
5871

5972
[[algorithms-minimum-weight-spanning-tree-sample]]
6073
== Minimum Weight k-Spanning Tree algorithm examples
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| k | Number | n/a | no | The size of the tree to be returned
2+
| sourceNode | Integer | null | n/a | The starting source node ID.
3+
| xref:common-usage/running-algos.adoc#common-configuration-relationship-weight-property[relationshipWeightProperty] | String | null | yes | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted.
4+
| objective | String | 'minimum' | yes | If specified, the parameter dictates whether to seek a minimum or the maximum weight k-spanning tree. By default, the procedure looks for a minimum weight k-spanning tree. Permitted values are 'minimum' and 'maximum'.

0 commit comments

Comments
 (0)