diff --git a/src/ShortestPath/Transit/TransitShortestPathPrecompute.cpp b/src/ShortestPath/Transit/TransitShortestPathPrecompute.cpp
index 6213dc22ff560fe3ea20927875b1889d67c55345..20dbf836d3e8296f9cbe7491e534cee4ae3c4d7c 100644
--- a/src/ShortestPath/Transit/TransitShortestPathPrecompute.cpp
+++ b/src/ShortestPath/Transit/TransitShortestPathPrecompute.cpp
@@ -19,7 +19,7 @@
 //      - Reference value still valid after popping (otherwise, pop at the end, before adding new state)
 TransitStateContainer TransitShortestPathPrecompute::executeAlgorithm(const Graph& graph, int nodeIndex, int instant) {
     //Init container, priority queue and state variables
-    TransitStateContainer solutionsContainer{graph.getNodesVector().size()};
+    TransitStateContainer solutionsContainer{graph.getNbNodes()};
     std::priority_queue<TransitAlgorithmState> statePriorityQueue;
     statePriorityQueue.emplace(nodeIndex, instant,0, nodeIndex);