@@ -52,7 +52,7 @@ const DijkstraResult Graph<T>::dijkstra(const Node<T>& source,
5252 }
5353 // n denotes the number of vertices in graph
5454 // unused
55- // auto n = cachedAdjMatrixOut ->size();
55+ // auto n = cachedAdjListOut ->size();
5656
5757 // setting all the distances initially to INF_DOUBLE
5858 std::unordered_map<shared<const Node<T>>, double , nodeHash<T>> dist;
@@ -88,8 +88,8 @@ const DijkstraResult Graph<T>::dijkstra(const Node<T>& source,
8888
8989 // for all the reachable vertex from the currently exploring vertex
9090 // we will try to minimize the distance
91- if (cachedAdjMatrixOut ->find (currentNode) != cachedAdjMatrixOut ->end ()) {
92- for (const auto & elem : cachedAdjMatrixOut ->at (currentNode)) {
91+ if (cachedAdjListOut ->find (currentNode) != cachedAdjListOut ->end ()) {
92+ for (const auto & elem : cachedAdjListOut ->at (currentNode)) {
9393 // minimizing distances
9494 if (elem.second ->isWeighted ().has_value () &&
9595 elem.second ->isWeighted ().value ()) {
@@ -177,7 +177,7 @@ const DijkstraResult Graph<T>::dijkstra_deterministic(
177177 }
178178 // n denotes the number of vertices in graph
179179 // unused
180- // auto n = cachedAdjMatrixOut ->size();
180+ // auto n = cachedAdjListOut ->size();
181181
182182 // setting all the distances initially to INF_DOUBLE
183183 std::unordered_map<shared<const Node<T>>, double , nodeHash<T>> dist;
@@ -232,8 +232,8 @@ const DijkstraResult Graph<T>::dijkstra_deterministic(
232232
233233 // for all the reachable vertex from the currently exploring vertex
234234 // we will try to minimize the distance
235- if (cachedAdjMatrixOut ->find (currentNode) != cachedAdjMatrixOut ->end ()) {
236- for (const auto & elem : cachedAdjMatrixOut ->at (currentNode)) {
235+ if (cachedAdjListOut ->find (currentNode) != cachedAdjListOut ->end ()) {
236+ for (const auto & elem : cachedAdjListOut ->at (currentNode)) {
237237 // minimizing distances
238238 if (elem.second ->isWeighted ().has_value () &&
239239 elem.second ->isWeighted ().value ()) {
@@ -325,7 +325,7 @@ const DijkstraResult Graph<T>::dijkstra_deterministic2(
325325 }
326326 // n denotes the number of vertices in graph
327327 // unused
328- // auto n = cachedAdjMatrixOut ->size();
328+ // auto n = cachedAdjListOut ->size();
329329
330330 // setting all the distances initially to INF_DOUBLE
331331 std::unordered_map<shared<const Node<T>>, double , nodeHash<T>> dist;
@@ -388,8 +388,8 @@ const DijkstraResult Graph<T>::dijkstra_deterministic2(
388388
389389 // for all the reachable vertex from the currently exploring vertex
390390 // we will try to minimize the distance
391- if (cachedAdjMatrixOut ->find (currentNode) != cachedAdjMatrixOut ->end ()) {
392- for (const auto & elem : cachedAdjMatrixOut ->at (currentNode)) {
391+ if (cachedAdjListOut ->find (currentNode) != cachedAdjListOut ->end ()) {
392+ for (const auto & elem : cachedAdjListOut ->at (currentNode)) {
393393 // minimizing distances
394394 if (elem.second ->isWeighted ().has_value () &&
395395 elem.second ->isWeighted ().value ()) {
@@ -481,7 +481,7 @@ const DijkstraResult Graph<T>::criticalpath_deterministic(
481481 }
482482 // n denotes the number of vertices in graph
483483 // unused
484- // auto n = cachedAdjMatrixOut ->size();
484+ // auto n = cachedAdjListOut ->size();
485485
486486 // setting all the distances initially to -INF_DOUBLE
487487 std::unordered_map<shared<const Node<T>>, double , nodeHash<T>> dist;
@@ -513,8 +513,7 @@ const DijkstraResult Graph<T>::criticalpath_deterministic(
513513 };
514514 };
515515
516- std::priority_queue<VertexInfo, std::vector<VertexInfo>, VertexInfoLesser>
517- pq;
516+ std::priority_queue<VertexInfo, std::vector<VertexInfo>, VertexInfoLesser> pq;
518517
519518 // pushing the source vertex 's' with 0 distance in min heap
520519 pq.push (VertexInfo{0.0 , stableIds[*source_node_it], *source_node_it});
@@ -536,8 +535,8 @@ const DijkstraResult Graph<T>::criticalpath_deterministic(
536535
537536 // for all the reachable vertex from the currently exploring vertex
538537 // we will try to minimize the distance
539- if (cachedAdjMatrixOut ->find (currentNode) != cachedAdjMatrixOut ->end ()) {
540- for (const auto & elem : cachedAdjMatrixOut ->at (currentNode)) {
538+ if (cachedAdjListOut ->find (currentNode) != cachedAdjListOut ->end ()) {
539+ for (const auto & elem : cachedAdjListOut ->at (currentNode)) {
541540 // minimizing distances
542541 if (elem.second ->isWeighted ().has_value () &&
543542 elem.second ->isWeighted ().value ()) {
0 commit comments