diff --git a/geotrek/core/path_router.py b/geotrek/core/path_router.py index d334b1b4b9..60551e7db1 100644 --- a/geotrek/core/path_router.py +++ b/geotrek/core/path_router.py @@ -9,7 +9,7 @@ import numpy as np from scipy.sparse.csgraph import dijkstra -from scipy.sparse import csr_array +from scipy.sparse import lil_array from geotrek.common.utils import sqlfunction from .models import Path @@ -111,7 +111,7 @@ def set_cs_graph(self): return nb_of_nodes = len(self.nodes) - self.dijk_matrix = csr_array((nb_of_nodes, nb_of_nodes), dtype=np.float32) + self.dijk_matrix = lil_array((nb_of_nodes, nb_of_nodes), dtype=np.float32) nodes_list = list(self.nodes.items()) for i, (key1, value1) in enumerate(nodes_list[:-1]):