Skip to content

Commit

Permalink
leave first list for distance 0 to avoid wrong indexing for distances
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenray committed Nov 16, 2023
1 parent 30d44cc commit 4e0e6ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesh2vec/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4e0e6ce

Please sign in to comment.