From a793509639653295be47195b05ca1da52d2895df Mon Sep 17 00:00:00 2001 From: diaohancai <550630588@qq.com> Date: Mon, 1 Jan 2024 17:06:40 +0800 Subject: [PATCH] improve(algorithm): vertex inactive in advance --- .../hugegraph/computer/algorithm/sampling/RandomWalk.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java b/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java index a74cd4888..6401de4fe 100644 --- a/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java +++ b/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java @@ -194,6 +194,8 @@ public void compute0(ComputationContext context, Vertex vertex) { Edge selectedEdge = this.randomSelectEdge(null, null, vertex.edges()); context.sendMessage(selectedEdge.targetId(), message); } + + vertex.inactivate(); } @Override @@ -244,6 +246,8 @@ public void compute(ComputationContext context, Vertex vertex, vertex.edges()); context.sendMessage(selectedEdge.targetId(), message); } + + vertex.inactivate(); } /**