Skip to content

Commit 14cc7cc

Browse files
committed
Fix RNG
1 parent f1dea50 commit 14cc7cc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

city2graph/proximity.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,9 @@ def relative_neighborhood_graph(
10941094
coords = builder.coords
10951095

10961096
for i, j in cand_edges:
1097+
dots = np.einsum("ij,ij->i", coords[i] - coords, coords[j] - coords)
1098+
if np.any(dots < 0.0):
1099+
continue
10971100
dij2 = np.dot(coords[i] - coords[j], coords[i] - coords[j])
10981101
di2 = np.sum((coords - coords[i]) ** 2, axis=1) < dij2
10991102
dj2 = np.sum((coords - coords[j]) ** 2, axis=1) < dij2

0 commit comments

Comments
 (0)