Skip to content

GSoC 2019 Edward Moore's Algorithm, Breadth First Search and Binary Breadth First Search

Gvs Akhil edited this page May 25, 2019 · 36 revisions

Table of Contents

Proposal

Brief Description

Edward Moore's Algorithm is an improvement over Bellman-Ford algorithm and can compute single-source minimum cost paths in weighted (including negative weights) directed graphs. It has an average running time of O(E) on random graphs and the same worst-case complexity as Bellman-Ford's algorithm of O(V*E).

Boost::Breadth First Search is the implementation of the classic Breadth First Algorithm in the Boost Graph Library. It is a basic graph traversal algorithm which can be applied to any type of graph. One of its various applications is to find the path with minimum edges from a given source to any arbitrary destination. It has a linear time complexity of O(V + E).

Binary Breadth First Search is a modification of the standard Breadth First Search algorithm and can calculate single-source minimum cost paths in a weighted graph where weights of all edges are either zero or some constant C. It has a linear time complexity of O(V+E) compared to O(E + V log V) of Dijkstra’s algorithm.

This project aims to add the above three algorithms into pgRouting during the GSoC period.

State of the Project Before GSoC

pgRouting currently does not have any of the proposed algorithms implemented.

The algorithm to be improved by Edward Moore's algorithm, i.e Bellman-Ford algorithm has been implemented in pgRouting during the 2018 GSoC period by Sourabh Garg.

Breadth First Search is used in various other already-implemented algorithms. However, a single standard function does not exist.

The variants of Dijkstra’s algorithm implemented in pgRouting have a run-time complexity no better than O(E + V log V). This can be improved for the special case of binary weighted graphs using Binary Breadth First Search for a run-time complexity of O(E + V).

Deliverables

  1. Connect Boosts Breadth First Search to pgRouting.
  2. Implementation of Binary Breadth First Search for pgRouting.
  3. Implementation of Edward Moore's algorithm for pgRouting.

Each implemented function will include relevant documentation and tests.

Timeline

Community Bonding Period (May 6th - May 27th)

  • Set up the development environment.
  • Interact with mentors, introduce myself to the community and actively get involved in the discussion.
  • Get familiar with pgRouting’s development style. Understand expected coding, documentation and testing standards set by pgRouting.
  • Set up wiki page to keep track of weekly progress.
  • Develop a better understanding of PostgreSQL, PostGIS, Pl/pgSQL and how they interact with pgRouting.
  • Learn to create unit tests using pgTap.
  • Implement simple dummy functions to better understand pgRouting.

First Coding Period (May 27th - June 23rd)

Week 1 (May 27th - June 2nd)

  • Design pgr_BreadthFirstSearch() function.
  • Create a basic skeleton for documentation and tests.

Week 2 (June 3rd - June 9th)

  • Create the code skeleton of the SQL and C code which allows the C++ implementation of the function to work with PostgreSQL.

Week 3 (June 10th - June 16th)

  • Implement pgr_BreadthFirstSearch() function along with its helper files.

Week 4 (June 17th - June 23rd)

  • Prepare documentation for pgr_BreadthFirstSearch() function.
  • Complete testing along with writing pgTap tests for pgr_BreadthFirstSearch() function.
  • Prepare a report for First Evaluation.

Second Coding Period (June 24th - July 21st)

Week 5 (June 24th - June 30th)

  • Design pgr_BinaryBreadthFirstSearch() function.
  • Create a basic skeleton for documentation and tests.
  • Work on feedback provided from the first evaluation.

Week 6 (July 1st - July 7th)

  • Create the code skeleton of the SQL and C code which allows the C++ implementation of the function to work with PostgreSQL.

Week 7 (July 8th - July 14th)

  • Implement pgr_BinaryBreadthFirstSearch() function along with its helper files.

Week 8 (July 15th - July 21st)

  • Prepare documentation for pgr_BinaryBreadthFirstSearch() function.
  • Complete testing along with writing pgTap tests for pgr_BinaryBreadthFirstSearch() function.
  • Prepare a report for Second Evaluation.

Third Coding Period (July 22nd - August 18th)

Week 9 (July 22nd - July 28th)

  • Work on feedback provided from the second evaluation.
  • Design pgr_EdwardMoore() function.
  • Create a basic skeleton for documentation and tests.

Week 10 (July 29th - August 4th)

  • Create the code skeleton of the SQL and C code which allows the C++ implementation of the function to work with PostgreSQL.
  • Begin pgr_EdwardMoore() implementation.

Week 11 (August 5th - August 11th)

  • Finish pgr_EdwardMoore() implementation.
  • Complete testing along with writing pgTap tests for pgr_EdwardMoore() function.

Week 12 (August 12th - August 18th)

  • Review, complete and finalize all documentation and tests for all algorithms implemented.
  • Create a detailed final report.

Detailed Proposal

Detailed Proposal in PDF format

Log of Pull Requests

Pull Request Description Date Status
#1 GSoC pgRouting Application Requirements 8 May 2019 Merged
#1197 Pre-Bonding period documentation improvement 29 March 2019 Merged

Weekly Reports

Third Evaluation Period (July 22nd - August 18th)

Week 12 (August 12th - August 18th)

Week 11 (August 5th - August 11th)

Week 10 (July 29th - August 4th)

Week 9 (July 22nd - July 28th)

Second Evaluation Period (June 24th - July 21st)

Week 8 (July 15th - July 21st)

Week 7 (July 8th - July 14th)

Week 6 (July 1st - July 7th)

Week 5 (June 24th - June 30th)

First Evaluation Period (May 27th - June 23rd)

Week 4 (June 17th - June 23rd)

Week 3 (June 10th - June 16th)

Week 2 (June 2nd - June 9th)

Week 1 (May 27th - June 2nd)

Community Bonding Period (May 6th - May 27th)

  • Set up the development environment.
  • Interact with mentors, introduce myself to the community and actively get involved in the discussion.
  • Set up a wiki page to keep track of weekly progress.
  • Add a wiki link to OSGeo's accepted students wiki page.
  • Introduce myself and my project on OSGeo's SOC mailing list.
  • Get familiar with pgRouting’s development style. Understand expected coding, documentation and testing standards set by pgRouting.
  • Develop a better understanding of PostgreSQL, PostGIS, Pl/pgSQL and how they interact with pgRouting.
  • Learn to create unit tests using pgTap.
  • Implement simple dummy functions to better understand pgRouting.

Pre-Bonding Period (March 25th - April 9th)

Clone this wiki locally