From 264e83a1f37a8fc3e52911754d0ccbab46c62d83 Mon Sep 17 00:00:00 2001 From: dmbreaker Date: Wed, 25 Jun 2014 16:02:10 +0400 Subject: [PATCH] Added comments with graphical representation of variables. --- Algorithms/BFSComponentExplorer.h | 8 ++++++++ RoutingAlgorithms/BasicRoutingInterface.h | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Algorithms/BFSComponentExplorer.h b/Algorithms/BFSComponentExplorer.h index 768c60012..7bc7ecb30 100644 --- a/Algorithms/BFSComponentExplorer.h +++ b/Algorithms/BFSComponentExplorer.h @@ -72,6 +72,14 @@ template class BFSComponentExplorer NodeID node, unsigned current_component) { + /* + Graphical representation of variables: + + u v w + *---------->*---------->* + e2 + */ + bfs_queue.emplace(node, node); // mark node as read m_component_index_list[node] = current_component; diff --git a/RoutingAlgorithms/BasicRoutingInterface.h b/RoutingAlgorithms/BasicRoutingInterface.h index 56d1607df..464c08850 100644 --- a/RoutingAlgorithms/BasicRoutingInterface.h +++ b/RoutingAlgorithms/BasicRoutingInterface.h @@ -158,6 +158,13 @@ template class BasicRoutingInterface std::pair edge; while (!recursion_stack.empty()) { + /* + Graphical representation of variables: + + edge.first edge.second + *------------------>* + edge_id + */ edge = recursion_stack.top(); recursion_stack.pop(); @@ -175,6 +182,14 @@ template class BasicRoutingInterface edge_weight = weight; } } + + /* + Graphical representation of variables: + + edge.first edge.second + *<------------------* + edge_id + */ if (SPECIAL_EDGEID == smaller_edge_id) { for (auto edge_id : facade->GetAdjacentEdgeRange(edge.second))