diff --git a/graph/dijkstra.cpp b/graph/dijkstra.cpp index 3dca9e64a..9b47e446f 100644 --- a/graph/dijkstra.cpp +++ b/graph/dijkstra.cpp @@ -28,8 +28,9 @@ #include #include #include +#include -constexpr long long INF = 1000000000; +constexpr long long INF = std::numeric_limits::max(); /** * @namespace graph @@ -66,7 +67,7 @@ int dijkstra(std::vector>> *adj, int s, int t) { int n = adj->size(); /// setting all the distances initially to INF - std::vector dist(n, INF); + std::vector dist(n, INF); /// creating a min heap using priority queue /// first element of pair contains the distance