From 4e0e6ce1d5d05891fdb1c3b2ccbe19d571475525 Mon Sep 17 00:00:00 2001 From: soeren Date: Thu, 16 Nov 2023 15:51:50 +0100 Subject: [PATCH] leave first list for distance 0 to avoid wrong indexing for distances --- mesh2vec/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesh2vec/helpers.py b/mesh2vec/helpers.py index 966377a..43ef5d7 100644 --- a/mesh2vec/helpers.py +++ b/mesh2vec/helpers.py @@ -242,8 +242,8 @@ def calc_adjacencies( vertices = [self.idx_conversion[v_id] for v_id in list(hyper_edges_idx.keys())] # each vertex has a list of lists where the index of the list corresponds to the depth of its contained neighbors - # e.g.: neighbor 300 at depth 2, neighbor 400 at depth 1 with max_distance 3 -> [[400], [300], []] - neighbors_at_depth = {vertex: [[] for _ in range(max_distance)] for vertex in vertices} + # e.g.: neighbor 300 at depth 2, neighbor 400 at depth 1 with max_distance 3 -> [[], [400], [300], []] + neighbors_at_depth = {vertex: [[] for _ in range(max_distance + 1)] for vertex in vertices} # for each vertex, do bfs separately for start_vertex in vertices: