Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/CXXGraph/Graph/Algorithm/Dijkstra_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const DijkstraResult Graph<T>::dijkstra(const Node<T>& source,
result.errorMessage = "";
result.result = dist[*target_node_it];
std::string id = target.getUserId();
while (parent[id] != "") {
while (!parent[id].empty()) {
result.path.push_back(id);
id = parent[id];
}
Expand Down Expand Up @@ -288,7 +288,7 @@ const DijkstraResult Graph<T>::dijkstra_deterministic(
result.errorMessage = "";
result.result = dist[*target_node_it];
std::string id = target.getUserId();
while (parent[id] != "") {
while (!parent[id].empty()) {
result.path.push_back(id);
id = parent[id];
}
Expand Down Expand Up @@ -444,7 +444,7 @@ const DijkstraResult Graph<T>::dijkstra_deterministic2(
result.errorMessage = "";
result.result = dist[*target_node_it];
std::string id = target.getUserId();
while (parent[id] != "") {
while (!parent[id].empty()) {
result.path.push_back(id);
id = parent[id];
}
Expand Down Expand Up @@ -591,7 +591,7 @@ const DijkstraResult Graph<T>::criticalpath_deterministic(
result.errorMessage = "";
result.result = dist[*target_node_it];
std::string id = target.getUserId();
while (parent[id] != "") {
while (!parent[id].empty()) {
result.path.push_back(id);
id = parent[id];
}
Expand Down
2 changes: 1 addition & 1 deletion include/CXXGraph/Graph/Algorithm/EulerianPath_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ std::shared_ptr<std::vector<Node<T>>> Graph<T>::eulerianPath() const {
auto currentNode = *(firstNodeIt);
currentPath.push_back(currentNode);

while (currentPath.size() > 0) {
while (!currentPath.empty()) {
auto &edges = cachedAdjListOut->at(currentNode);
// we keep removing the edges that
// have been traversed from the adjacency list
Expand Down
2 changes: 1 addition & 1 deletion include/CXXGraph/Graph/Algorithm/Kosaraju_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ SCCResult<T> Graph<T>::kosaraju() const {
};

int sccLabel = 0;
while (st.size() != 0) {
while (!st.empty()) {
auto rem = st.top();
st.pop();
if (visited[rem->getId()] == false) {
Expand Down
Loading