From 2e8b56a3b67f951d10e57fcca4a5db6cd198be48 Mon Sep 17 00:00:00 2001 From: Eric Kim Date: Mon, 15 Nov 2021 00:24:52 -0500 Subject: [PATCH] [Randomwalk] Fix off-by-one bug in GenericRandomWalk() (#3500) --- src/graph/sampling/randomwalks/randomwalks_cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph/sampling/randomwalks/randomwalks_cpu.h b/src/graph/sampling/randomwalks/randomwalks_cpu.h index bfb633121574..24bef8c8541b 100644 --- a/src/graph/sampling/randomwalks/randomwalks_cpu.h +++ b/src/graph/sampling/randomwalks/randomwalks_cpu.h @@ -59,7 +59,7 @@ std::pair GenericRandomWalk( CHECK_LT(curr, max_nodes) << "Seed node ID exceeds the maximum number of nodes."; for (i = 0; i < max_num_steps; ++i) { - const auto &succ = step(traces_data + seed_id * max_num_steps, curr, i); + const auto &succ = step(traces_data + seed_id * trace_length, curr, i); traces_data[seed_id * trace_length + i + 1] = curr = std::get<0>(succ); eids_data[seed_id * max_num_steps + i] = std::get<1>(succ); if (std::get<2>(succ))