Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaldu committed Dec 12, 2023
1 parent 073bf2e commit a181533
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/dsm/headers/Graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ namespace dsm {
template <typename Id, typename Size>
requires(std::unsigned_integral<Id> && std::unsigned_integral<Size>)
std::optional<DijkstraResult<Id>> Graph<Id, Size>::shortestPath(Id source, Id destination) const {
const Id sourceId{source};
const Id sourceId{source};

std::unordered_map<Id, shared<Node<Id, Size>>> unvisitedNodes{m_nodes};
if (!unvisitedNodes.contains(source) || !unvisitedNodes.contains(destination)) {
Expand All @@ -468,10 +468,10 @@ namespace dsm {
dist[source] = std::make_pair(source, 0.);

std::vector<std::pair<Id, double>> prev(n_nodes);
std::for_each(prev.begin(), prev.end(), [](auto& pair) -> void {
pair.first = std::numeric_limits<Id>::max();
pair.second = std::numeric_limits<double>::max();
});
std::for_each(prev.begin(), prev.end(), [](auto& pair) -> void {
pair.first = std::numeric_limits<Id>::max();
pair.second = std::numeric_limits<double>::max();
});
prev[source].second = 0.;

while (unvisitedNodes.size() != 0) {
Expand Down Expand Up @@ -516,9 +516,9 @@ namespace dsm {
return std::nullopt;
}
path.push_back(previous);
if (previous == sourceId) {
break;
}
if (previous == sourceId) {
break;
}
}

std::reverse(path.begin(), path.end());
Expand Down

0 comments on commit a181533

Please sign in to comment.