Skip to content

Commit ef65857

Browse files
jjaderbergIoannisPanagiotas
authored andcommitted
Fix fields / remove target
1 parent 42e29d5 commit ef65857

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

algo/src/main/java/org/neo4j/gds/steiner/LinkCutNode.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ class LinkCutNode {
2323
private LinkCutNode up;
2424
private LinkCutNode left;
2525
private LinkCutNode right;
26-
private long source;//from;
27-
private long target;//to;
28-
26+
private final long source;//from;
2927
private boolean reverseBit;
3028

31-
LinkCutNode(long source, long target, LinkCutNode p) {
29+
LinkCutNode(long source, LinkCutNode p) {
3230
up = p;
3331
left = null;
3432
right = null;
3533
this.source = source;
36-
this.target = target;
3734
reverseBit = false;
3835
}
3936

@@ -85,7 +82,7 @@ boolean isChildOf(LinkCutNode node) {
8582
}
8683

8784
static LinkCutNode createSingle(long id) {
88-
return new LinkCutNode(id, id, null);
85+
return new LinkCutNode(id, null);
8986
}
9087

9188
}

algo/src/main/java/org/neo4j/gds/steiner/LinkCutTree.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
class LinkCutTree {
2525
//Look here: https://dl.acm.org/doi/pdf/10.1145/3828.3835
26-
HugeObjectArray<LinkCutNode> nodes;
27-
HugeObjectArray<LinkCutNode> edgeInTree;
26+
private final HugeObjectArray<LinkCutNode> nodes;
27+
private final HugeObjectArray<LinkCutNode> edgeInTree;
2828

2929
public LinkCutTree(long nodeCount) {
3030
nodes = HugeObjectArray.newArray(LinkCutNode.class,nodeCount);
@@ -162,7 +162,7 @@ private void addChild(LinkCutNode a, LinkCutNode b,Direction direction) {
162162
public void link(long source, long target) {
163163
LinkCutNode nodeSource = nodes.get(source);
164164
LinkCutNode nodeTarget = nodes.get(target);
165-
LinkCutNode nodeEdge = new LinkCutNode(source, target, null);
165+
LinkCutNode nodeEdge = new LinkCutNode(source, null);
166166
edgeInTree.set(target,nodeEdge);
167167
nodeEdge.setParent(nodeSource);
168168
evert(target);

algo/src/main/java/org/neo4j/gds/steiner/SteinerBasedDeltaStepping.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
*/
5858
public final class SteinerBasedDeltaStepping extends Algorithm<DijkstraResult> {
5959

60-
public static final int NO_BIN = Integer.MAX_VALUE;
60+
static final int NO_BIN = Integer.MAX_VALUE;
6161
private static final long NO_TERMINAL = -1;
6262
public static final int BIN_SIZE_THRESHOLD = 1000;
6363
private final Graph graph;
@@ -72,7 +72,7 @@ public final class SteinerBasedDeltaStepping extends Algorithm<DijkstraResult> {
7272
private final BitSet unvisitedTerminal;
7373
private final BitSet mergedWithSource;
7474
private final LongAdder metTerminals;
75-
private int binSizeThreshold;
75+
private final int binSizeThreshold;
7676

7777
SteinerBasedDeltaStepping(
7878
Graph graph,

algo/src/main/java/org/neo4j/gds/steiner/SteinerBasedDeltaTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SteinerBasedDeltaTask implements Runnable {
4949
private final HugeLongPriorityQueue terminalQueue;
5050
private final ReentrantLock terminalQueueLock;
5151
private double smallestConsideredDistance;
52-
private int binSizeThreshold;
52+
private final int binSizeThreshold;
5353

5454
SteinerBasedDeltaTask(
5555
Graph graph,

0 commit comments

Comments
 (0)