Skip to content

Commit 4d4c02c

Browse files
committed
fix: shortest path benchmark now correctly uses a non-periodic lattice
1 parent 38e6313 commit 4d4c02c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

benchmarks/bench_shortest_path.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
from random import randint
1+
from random import randint, seed
22

33
from igraph import Graph as LegacyGraph
44

55
from igraph_ctypes.constructors import create_square_lattice
66
from igraph_ctypes.paths import get_shortest_path
77

8+
seed(42)
9+
810
n, k = 1000, 100
911

1012
sources = [randint(0, n - 1) for _ in range(k)]
1113
targets = [randint(0, n - 1) for _ in range(k)]
1214
pairs = list(zip(sources, targets))
1315

14-
old_g = LegacyGraph.Lattice([n, n])
15-
new_g = create_square_lattice([n, n])
16+
old_g = LegacyGraph.Lattice([n, n], directed=False, circular=False)
17+
new_g = create_square_lattice([n, n], directed=False, periodic=False)
1618

1719

1820
def with_old_igraph():

0 commit comments

Comments
 (0)