Skip to content

Commit 7560fef

Browse files
vnickolovMats-SX
andcommitted
Remove localClusteringCoefficient from TriangleCount stream
Co-authored-by: Mats Rydberg <[email protected]>
1 parent 3e6c131 commit 7560fef

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

alpha/alpha-proc/src/test/java/org/neo4j/graphalgo/triangle/TriangleDocTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,20 @@ void shouldStreamTriangleCount() {
133133
" }," +
134134
" concurrency: 4" +
135135
" })" +
136-
" YIELD nodeId, triangles, localClusteringCoefficient" +
137-
" RETURN gds.util.asNode(nodeId).name AS name, triangles, localClusteringCoefficient AS coefficient" +
138-
" ORDER BY coefficient DESC";
139-
140-
String expected = "+--------------------------------------------+" + NL +
141-
"| name | triangles | coefficient |" + NL +
142-
"+--------------------------------------------+" + NL +
143-
"| \"Karin\" | 1 | 1.0 |" + NL +
144-
"| \"Mark\" | 1 | 1.0 |" + NL +
145-
"| \"Chris\" | 2 | 0.6666666666666666 |" + NL +
146-
"| \"Will\" | 2 | 0.6666666666666666 |" + NL +
147-
"| \"Michael\" | 3 | 0.3 |" + NL +
148-
"| \"Alice\" | 0 | 0.0 |" + NL +
149-
"+--------------------------------------------+" + NL +
136+
" YIELD nodeId, triangles" +
137+
" RETURN gds.util.asNode(nodeId).name AS name, triangles" +
138+
" ORDER BY triangles ASC";
139+
140+
String expected = "+-----------------------+" + NL +
141+
"| name | triangles |" + NL +
142+
"+-----------------------+" + NL +
143+
"| \"Alice\" | 0 |" + NL +
144+
"| \"Karin\" | 1 |" + NL +
145+
"| \"Mark\" | 1 |" + NL +
146+
"| \"Chris\" | 2 |" + NL +
147+
"| \"Will\" | 2 |" + NL +
148+
"| \"Michael\" | 3 |" + NL +
149+
"+-----------------------+" + NL +
150150
"6 rows" + NL;
151151

152152
String actual = runQuery(query, Result::resultAsString);

proc/community/src/main/java/org/neo4j/graphalgo/triangle/TriangleCountStreamProc.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ protected Stream<Result> stream(ComputationResult<IntersectingTriangleCount, Tri
7575
return LongStream.range(0, graph.nodeCount())
7676
.mapToObj(i -> new Result(
7777
graph.toOriginalNodeId(i),
78-
result.localTriangles().get(i),
79-
result.localClusteringCoefficients().get(i)
78+
result.localTriangles().get(i)
8079
));
8180
}
8281

@@ -118,12 +117,10 @@ public static class Result {
118117

119118
public final long nodeId;
120119
public final long triangles;
121-
public final double localClusteringCoefficient;
122120

123-
public Result(long nodeId, long triangles, double localClusteringCoefficient) {
121+
public Result(long nodeId, long triangles) {
124122
this.nodeId = nodeId;
125123
this.triangles = triangles;
126-
this.localClusteringCoefficient = localClusteringCoefficient;
127124
}
128125
}
129126
}

proc/community/src/test/java/org/neo4j/graphalgo/triangle/TriangleCountStreamProcTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void testStreaming() {
3838
var rowCount = new AtomicInteger();
3939
runQueryWithRowConsumer(query, row -> {
4040
assertEquals(1L, row.getNumber("triangles"));
41-
assertEquals(1.0, row.getNumber("localClusteringCoefficient"));
4241
rowCount.incrementAndGet();
4342
});
4443

0 commit comments

Comments
 (0)