GSoC 2021 VRP functionality with VROOM on the database - pgRouting/pgrouting Wiki

Original URL: https://github.com/pgRouting/pgrouting/wiki/GSoC-2021-VRP-functionality-with-VROOM-on-the-database

Table of Contents

Proposal

Brief Description

The project aims at implementing the VRP functionality in the vrprouting repository of pgrouting, using VROOM as a library in C++.

VROOM is an open-source optimization engine, that aims at providing good solutions to well-known Vehicle Routing Problems (VRP), such as:

I propose to implement this functionality as an extension to PostGIS, the PostgreSQL geospatial database, by porting it to vrprouting, so that this functionality can be used in the PostgreSQL database

State of the Project Before GSoC

The vrprouting repository has been recently created by extracting the code of the pgrouting repository involving the VRP functions. It currently contains the functions to solve the Pickup-and-Delivery problem (vrp_pgr_pickDeliver and vrp_pgr_pickDeliverEuclidean) and the Single Depot VRP problem (vrp_oneDepot). However, the VROOM functionality is not yet implemented in vrprouting, which if implemented, can provide good solutions to these problems in an efficient way.

Benefits to the Community

Implementing the VROOM functionality as a postgreSQL extension will be very beneficial to those users who want to use the VROOM functionality in the database. VROOM provides a good solution to well-known vehicle routing problems within small computing times, and it can scale to handle very big instances. It is also customizable and supports user-defined cost matrices. Therefore the VROOM functionality in vrprouting can be of great use to the community, as the users can use it to solve real-world vehicle routing problems efficiently.

Deliverables

The deliverables at the end of GSoC period are:

Only if time allows:

Detailed Proposal

Detailed Proposal in PDF format

Participants

Title GitHub Handle Name
1st Mentor @cvvergara Vicky Vergara
2nd Mentor @ashrafroni Ashraf Hossain
3rd Mentor @rahulworld Rahul Chauhan
Student Developer @krashish8 Ashish Kumar

Timeline

Community Bonding Period (May 17th - June 6th)

First Coding Period (June 7th - July 11th)

Week 1 (June 7th - June 13th)

Week 2 (June 14th - June 20th)

Week 3 (June 21st - June 27th)

Week 4 (June 28th - July 4th)

Week 5 (July 5th - July 11th)

Second Coding Period (July 12th - August 15th)

Week 6 (July 12th - July 18th)

Week 7 (July 19th - July 25th)

Week 8 (July 26th - August 1st)

Week 9 (August 2nd - August 8th)

Week 10 (August 9th - August 15th)

Log of Pull Requests

Link to all the Pull Requests made in GSoC-pgRouting repository for GSoC 2021

Pull Request Description Date Status
#11 Updated documentation for develop Aug 13th, 2021 Merged
#10 [GSoC-2021] Experimental VROOM Category functions - vrp_vroom, vrp_vroomJobs, vrp_vroomShipments Aug 11th, 2021 Merged
#189 GSoC-2021 Week 9: vrp_vroom Aug 8th, 2021 Merged
#185 GSoC-2021 Week 8: vrp_vroom July 31st, 2021 Merged
#183 GSoC-2021 Week 7: vrp_vroom July 24th, 2021 Merged
#180 GSoC-2021 Week 6: vrp_vroom July 18th, 2021 Merged
#178 GSoC-2021 Week 5: vrp_vroom July 10rd, 2021 Merged
#177 GSoC-2021 Week 4: vrp_vroom July 3rd, 2021 Merged
#174 GSoC-2021 Week 3: vrp_vroom June 26th, 2021 Merged
#170 GSoC-2021 Week 2: vrp_vroom June 19th, 2021 Merged
#167 GSoC-2021 Week 1: vrp_vroom June 12th, 2021 Merged
#165 GSoC-2021 Bonding Period: vrp_vroom June 5th, 2021 Merged
#141 GSoC Task 2: Adding name in contributor list February 9th, 2021 GSoC Task Pull Request - Not to Merge

Slides

https://docs.google.com/presentation/d/1hQeRd-BpQfaz2cMViOenhpQun6Mvi28dnislwvbG73M/edit?usp=sharing

Final Report

(The below report was sent to the two mailing lists of OSGeo - SoC and pgrouting-dev)

Hello everyone,

With the GSoC period coming to an end, I hereby present the final report of my work, which I did over the past 10 weeks. It has been a great experience working twice during GSoC with the pgRouting community and the mentors. This report is in accordance with the guidelines set by Google [1] and OSGeo GSoC Admins [2].

  1. (a) Title: VRP functionality with VROOM on the database for pgRouting
    (b) Organization: pgRouting under OSGeo.

  2. Abstract:

The GSoC project dealt with the implementation of the VROOM category functions in the vrpRouting repository of pgRouting.

VROOM is an open-source optimization engine that aims at providing good solutions to various real-life vehicle routing problems (VRP) within a small computing time. It can solve several well-known types of vehicle routing problems (VRP):

The project dealt with implementing the VROOM functionality as a PostgreSQL function so that it can be used directly in the database. It involved creating the three functions in vrpRouting - vrp_vroom, vrp_vroomJobs, and vrp_vroomShipments.

  1. The state of the project before GSoC:

The vrpRouting repository was created a few months before the starting of the GSoC program, by extracting the code of the pgrouting repository involving the VRP functions. It initially contained the functions to solve the Pickup-and-Delivery problem (vrp_pgr_pickDeliver and vrp_pgr_pickDeliverEuclidean) and the Single Depot VRP problem (vrp_oneDepot). However, the VROOM functionality was not implemented in vrprouting. The three functions that I created under the VROOM category did not exist before GSoC.

  1. The addition that my project brought to pgRouting:

My project added the code, documentation (with the docqueries), and the pgTAP tests of these three functions:

We wanted some standard external library for solving the VRP problems (similar to how the other pgRouting functions used Boost for adding the graph algorithms), and that was made available through these functions that I created during GSoC.

  1. Potential Future Work:

The implementation of these functions is complete. We can create more similar functions having different signatures based on the use-case, such as replacing the time with timestamps. The VROOM functionality can be tested by creating performance tests. Also, the build can be made compatible with other OS, such as macOS and Windows, as the build perhaps fails on macOS. Different applications of the functions can be studied, and specific functions can be made based on that.

  1. Links:

(i) Users Documentation:

(ii) Tag:

(iii) Pull Requests:

(iv) Wiki Page:

  1. Image:

  2. Media:

I'm glad to participate in the GSoC program twice as a student developer. I would be happy if my code proves beneficial to the community. Thanks to everyone for the support!

Thank you,
Ashish Kumar.

[1]. https://developers.google.com/open-source/gsoc/help/work-product
[2]. https://lists.osgeo.org/pipermail/soc/2021-August/004804.html

Weekly Reports

Second Coding Period (July 12th - August 15th)

Week 10 (August 9th - August 15th)

Week 9 (August 2nd - August 8th)

Week 8 (July 26th - August 1st)

Week 7 (July 19th - July 25th)

Week 6 (July 12th - July 18th)

First Coding Period (June 7th - July 11th)

Week 5 (July 5th - July 11th)

Week 4 (June 28th - July 4th)

Week 3 (June 21st - June 27th)

Week 2 (June 14th - June 20th)

Week 1 (June 7th - June 13th)

Community Bonding Period (May 17th - June 6th)

Tasks

Meetings

  1. May 21st

    • Introductory meeting with the mentors for the future plans of the GSoC period.
  2. June 1st

    • Met with the core developer of VROOM - Julien Coupey, along with other pgRouting mentors - Daniel and Vicky, to introduce and discuss regarding the project, the VROOM, its terminologies, etc.

Pre-Bonding Period (March 10th - April 13th)

References

  1. Vehicle Routing Open-source Optimization Machine: VROOM-Project/vroom
  2. vrpRouting - Vehicle Routing problems on PostgreSQL: pgRouting/vrprouting
  3. Vehicle Routing Problems - Wikipedia
  4. VROOM API Documentation
  5. VROOM Documentation - Examples
  6. OpenStreetMap data for Ile-de-France: ile-de-france
  7. OpenStreetMap data extracts - Geofabrik
  8. Open Source Routing Machine (OSRM) - Backend: Project-OSRM/osrm-backend
  9. Vehicle Routing Functions - Category (Experimental) - vrpRouting documentation
  10. A sequential insertion heuristic for the initial solution to a constrained vehicle routing problem