diff --git a/doc/src/pgRouting-introduction.rst b/doc/src/pgRouting-introduction.rst index b540cbeb83..fe3d299945 100644 --- a/doc/src/pgRouting-introduction.rst +++ b/doc/src/pgRouting-introduction.rst @@ -66,6 +66,7 @@ This Release Contributors Individuals in this release (in alphabetical order) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Aniket Agarwal, Ashish Kumar, Cayetano Benavent, Daniel Kastl, diff --git a/include/yen/pgr_ksp.hpp b/include/yen/pgr_ksp.hpp index 32fb1d01e8..d1e8a60f61 100644 --- a/include/yen/pgr_ksp.hpp +++ b/include/yen/pgr_ksp.hpp @@ -53,7 +53,7 @@ class Pgr_ksp : public Pgr_messages { m_start(0), m_end(0), m_K(0), - m_heap_paths(false) { + m_heap_paths(false) { //! heap is for debuging purpose to check whether the algorithm is running well or not m_vis = new Visitor; } ~Pgr_ksp() { @@ -100,12 +100,12 @@ class Pgr_ksp : public Pgr_messages { auto paths = get_results(); if (!m_heap_paths && paths.size() > m_K) paths.resize(m_K); - return paths; + return paths; //! contain K shortest Paths } void clear() { - m_Heap.clear(); - m_ResultSet.clear(); + m_Heap.clear(); //! clearing heap_paths + m_ResultSet.clear(); //! clearing all the paths stored previously } @@ -125,20 +125,20 @@ class Pgr_ksp : public Pgr_messages { protected: //! the actual algorithm - void executeYen(G &graph) { + void executeYen(G &graph) { clear(); - curr_result_path = getFirstSolution(graph); + curr_result_path = getFirstSolution(graph); //! it will give the first shortest path m_vis->on_insert_first_solution(curr_result_path); - if (m_ResultSet.size() == 0) return; // no path found + if (m_ResultSet.size() == 0) return; //! no path found - while (m_ResultSet.size() < m_K) { + while (m_ResultSet.size() < m_K) { //! looping till k shortest paths doNextCycle(graph); - if (m_Heap.empty()) break; + if (m_Heap.empty()) break; //! if there will no k paths possible curr_result_path = *m_Heap.begin(); - curr_result_path.recalculate_agg_cost(); - m_ResultSet.insert(curr_result_path); - m_Heap.erase(m_Heap.begin()); + curr_result_path.recalculate_agg_cost(); + m_ResultSet.insert(curr_result_path); //! inserting the ith shortest path in result + m_Heap.erase(m_Heap.begin()); //! removing the inserted path from heap_paths } } @@ -147,7 +147,7 @@ class Pgr_ksp : public Pgr_messages { //! Performs the first Dijkstra of the algorithm protected: - Path getFirstSolution(G &graph) { + Path getFirstSolution(G &graph) { //! here first sortest path will be calculated using dijkstra algorithm Path path; path = algorithms::dijkstra(graph, m_start, m_end); @@ -161,7 +161,7 @@ class Pgr_ksp : public Pgr_messages { protected: //! Performs the next cycle of the algorithm - void doNextCycle(G &graph) { + void doNextCycle(G &graph) { for (unsigned int i = 0; i < curr_result_path.size(); ++i) { int64_t spurNodeId = curr_result_path[i].node;