diff --git a/.editorconfig b/.editorconfig
index 979609fd6..7a915e98a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,7 +9,7 @@ indent_size = 4
indent_style = space
charset = utf-8
end_of_line = lf
-insert_final_newline = false
+insert_final_newline = true
trim_trailing_whitespace = true
# C++ files want tab indentation
diff --git a/.github/workflows/boost_version.yml b/.github/workflows/boost_version.yml
index d03a3e32c..62719b3f0 100644
--- a/.github/workflows/boost_version.yml
+++ b/.github/workflows/boost_version.yml
@@ -62,13 +62,29 @@ jobs:
sudo tar --bzip2 -xf boost_1_${{ matrix.boost_minor }}_0.tar.bz2
sudo mv boost_1_${{ matrix.boost_minor }}_0/boost /usr/include/
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
- name: Configure
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
mkdir build
cd build
- cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug -DWITH_DOC=OFF ..
+ cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
@@ -76,7 +92,7 @@ jobs:
make -j 4
sudo make install
- - name: Unapck data
+ - name: Unpack data
run: |
cd tools/testers
tar -xf matrix_new_values.tar.gz
diff --git a/.github/workflows/check-files.yml b/.github/workflows/check-files.yml
index 2d8d02b58..61ed93602 100644
--- a/.github/workflows/check-files.yml
+++ b/.github/workflows/check-files.yml
@@ -46,3 +46,18 @@ jobs:
sudo apt install -y shellcheck
- name: Run Shell Check
run: ./tools/scripts/test_shell.sh
+
+ style-check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Install Requirements
+ uses: actions/checkout@v2
+ with:
+ repository: 'google/styleguide'
+ ref: "gh-pages"
+ path: "code_linter/styleguide"
+ - name: Run linter
+ run: |
+ bash ./tools/scripts/code_checker.sh
\ No newline at end of file
diff --git a/.github/workflows/check-queries.yml b/.github/workflows/check-queries.yml
index dc06e8f98..9d9bb7e1a 100644
--- a/.github/workflows/check-queries.yml
+++ b/.github/workflows/check-queries.yml
@@ -52,12 +52,29 @@ jobs:
postgresql-${PGVER}-pgrouting \
postgresql-server-dev-${PGVER}
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
mkdir build
cd build
- cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug ..
+ cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
@@ -73,7 +90,7 @@ jobs:
tools/scripts/get_signatures.sh -p ${PGPORT}
git diff --exit-code --quiet sql/sigs/*.sig
- - name: Unapck data
+ - name: Unpack data
run: |
cd tools/testers
tar -xf matrix_new_values.tar.gz
diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml
index f8ed46703..cc3766ad8 100644
--- a/.github/workflows/clang.yml
+++ b/.github/workflows/clang.yml
@@ -55,12 +55,29 @@ jobs:
postgresql-${PGVER}-pgrouting \
postgresql-server-dev-${PGVER}
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
mkdir build
cd build
- CXX=clang++ CC=clang cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DWITH_DOC=OFF ..
+ CXX=clang++ CC=clang cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
@@ -68,7 +85,7 @@ jobs:
make -j 4
sudo make install
- - name: Unapck data
+ - name: Unpack data
run: |
cd tools/testers
tar -xf matrix_new_values.tar.gz
diff --git a/.github/workflows/doc-check.yml b/.github/workflows/doc-check.yml
index 695d179a4..1b4c99b8c 100644
--- a/.github/workflows/doc-check.yml
+++ b/.github/workflows/doc-check.yml
@@ -76,6 +76,23 @@ jobs:
pip install -r requirements.txt
pip list
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
if: env.PROCESS == 'true'
run: |
@@ -84,7 +101,8 @@ jobs:
cd build
cmake -DLINKCHECK=ON -DHTML=ON -DWITH_DOC=ON \
-DDE=ON -DES=ON -DFR=ON -DJA=ON -DIT=ON \
- -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release ..
+ -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release \
+ -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Check Links
if: env.PROCESS == 'true'
diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml
index 8249f252d..2d6368d0f 100644
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -56,13 +56,31 @@ jobs:
pip install -r requirements.txt
pip list
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure link checks
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
mkdir build
cd build
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release \
- -DWITH_DOC=ON -DES=ON ..
+ -DWITH_DOC=ON -DES=ON \
+ -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build Documentation
run: |
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index e0bf6cf69..1ce3b6007 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -9,6 +9,7 @@ on:
paths-ignore:
- '**.po'
+# TODO: Fix the macOS build for compiling and building VROOM with vrprouting.
jobs:
build:
name: Build
@@ -22,11 +23,34 @@ jobs:
run: |
brew install postgis boost pgrouting
+ - name: Install VROOM dependencies
+ run: |
+ brew install openssl asio glpk
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Source: https://github.com/VROOM-Project/vroom/issues/378
+ ln -s /usr/local/opt/openssl/include/openssl /usr/local/include
+ ln -s /usr/local/opt/openssl/lib/libssl.dylib /usr/local/lib/
+ ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i '' -e 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+ sed -i '' -e 's/\/usr\/include\/glpk.h/\/usr\/local\/opt\/glpk\/include\/glpk.h/' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
run: |
mkdir build
cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF ..
+ cmake -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
@@ -63,7 +87,7 @@ jobs:
sudo make install
cpan TAP::Parser::SourceHandler::pgTAP
- - name: Unapck data
+ - name: Unpack data
run: |
cd tools/testers
tar -xf matrix_new_values.tar.gz
diff --git a/.github/workflows/publish-doc.yml b/.github/workflows/publish-doc.yml
index a45af950d..9d75ee4f1 100644
--- a/.github/workflows/publish-doc.yml
+++ b/.github/workflows/publish-doc.yml
@@ -67,12 +67,29 @@ jobs:
pip install sphinx-bootstrap-theme
pip list
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
mkdir build
cd build
- cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON ..
+ cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ea2383dcf..8a090cbf5 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -75,12 +75,29 @@ jobs:
pip install sphinx-bootstrap-theme
pip list
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
run: |
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
mkdir build
cd build
- cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON ..
+ cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index f3d55f8e8..8c3b03d06 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -55,12 +55,29 @@ jobs:
postgresql-${{ matrix.psql }}-pgrouting \
postgresql-server-dev-${{ matrix.psql }}
+ - name: Install VROOM dependencies
+ run: |
+ sudo apt-get install libssl-dev libasio-dev libglpk-dev
+
+ - name: Build VROOM v1.10.0
+ run: |
+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
+ tar -zvxf v1.10.0.tar.gz
+ cd vroom-1.10.0/src
+
+ # Create object file with position independent code using -fPIC flag
+ sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
+
+ make
+ cd ..
+ echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
+
- name: Configure
run: |
export PATH=/usr/lib/postgresql/${{ matrix.psql }}/bin:$PATH
mkdir build
cd build
- cmake -DPOSTGRESQL_VERSION=${{ matrix.psql }} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DWITH_DOC=OFF ..
+ cmake -DPOSTGRESQL_VERSION=${{ matrix.psql }} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
- name: Build
run: |
@@ -68,7 +85,7 @@ jobs:
make -j 4
sudo make install
- - name: Unapck data
+ - name: Unpack data
run: |
cd tools/testers
tar -xf matrix_new_values.tar.gz
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b5a5a806..888cd6bb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,11 +52,13 @@ set(DOXYGEN_MINIMUM_VERSION "1.7")
set(SPHINX_MINIMUM_VERSION "1.8")
set(POSTGRESQL_MINIMUM_VERSION "12.0")
set(BOOST_MINIMUM_VERSION "1.65.0")
+set(VROOM_MINIMUM_VERSION "1.10.0")
message(STATUS "DOXYGEN_MINIMUM_VERSION=${DOXYGEN_MINIMUM_VERSION}")
message(STATUS "SPHINX_MINIMUM_VERSION=${SPHINX_MINIMUM_VERSION}")
message(STATUS "POSTGRESQL_MINIMUM_VERSION=${POSTGRESQL_MINIMUM_VERSION}")
message(STATUS "BOOST_MINIMUM_VERSION=${BOOST_MINIMUM_VERSION}")
+message(STATUS "VROOM_MINIMUM_VERSION=${VROOM_MINIMUM_VERSION}")
# cmake 3.2 adds unwanted flags
if(WIN32 AND MSVC)
@@ -71,7 +73,7 @@ endif()
#-----------------------------------------------------------------------------
-set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)
#---------------------------------------------
@@ -301,6 +303,19 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
+#-------------------
+# Add the VROOM library and dependencies
+#-------------------
+
+if(NOT VROOM_INSTALL_PATH)
+ message(FATAL_ERROR "VROOM installation path not specified. Please specify the vroom root directory in -DVROOM_INSTALL_PATH")
+endif()
+
+message(STATUS "VROOM_INSTALL_PATH ${VROOM_INSTALL_PATH}")
+
+include_directories(${VROOM_INSTALL_PATH}/src)
+link_libraries(${VROOM_INSTALL_PATH}/lib/libvroom.a)
+link_libraries(glpk)
#-------------------
# add the subdirectories that have the C/C++ code
diff --git a/NEWS b/NEWS
index 27c3c139a..ef239f50c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@
v0.2.0 Release Notes
*******************************************************************************
+*New experimental functions*
+
+- vrp_vroom
+- vrp_vroomJobs
+- vrp_vroomShipments
+
v0.1.0 Release Notes
*******************************************************************************
diff --git a/README.md b/README.md
index fd4fd3f13..75076f4b6 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
### Branches
* The *master* branch has the development of the next micro release
-* The *develop* branch has the development of the next minor/mayor release
+* The *develop* branch has the development of the next minor/major release
For the complete list of releases go to:
https://github.com/pgRouting/pgrouting/releases
@@ -26,25 +26,29 @@ Status of the project can be found [here](https://github.com/pgRouting/vrproutin
## INTRODUCTION
-vrpRouting extends the pgRouting/PostGIS/PostgreSQL geospatial database to provide algorithms for Vehilce Routing Problems
+vrpRouting extends the pgRouting/PostGIS/PostgreSQL geospatial database to provide algorithms for Vehicle Routing Problems.
+It requires VROOM as a dependency for building and computing the VRP solution. This release is compatible with VROOM version 1.10.0
-This library is under develpment an currently contains the following features:
+This library is under development and currently contains the following functions:
* `vrp_onedepot`
* `vrp_pgr_pickdelivereuclidean`
-* `vrp_pgr_pickdelive`r
+* `vrp_pgr_pickdeliver`
+* `vrp_vroom`
+* `vrp_vroomJobs`
+* `vrp_vroomShipments`
## REQUIREMENTS
Building requirements
--------------------
* Perl
-* C and C++ compilers with C++14 standard support
+* C and C++ compilers with C++17 standard support
* Postgresql >= TBD
* The Boost Graph Library (BGL) >= 1.65
* CMake >= 3.12
* Sphinx >= TBD
-
+* VROOM >= 1.10.0
User's requirements
--------------------
diff --git a/configuration.conf b/configuration.conf
index e824637cb..9e051b19c 100644
--- a/configuration.conf
+++ b/configuration.conf
@@ -27,3 +27,4 @@ viewRoute | N | Y | N
simulation | N | Y | N
optimizers | Y | N | N
initialsol | Y | N | N
+vroom | Y | Y | Y
diff --git a/doc/conf.py.in b/doc/conf.py.in
index 5c74d182e..46401c0e0 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -171,8 +171,8 @@ html_last_updated_fmt = '%b %d, %Y'
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
- # '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'],
- # 'using/windows': ['windowssidebar.html', 'searchbox.html'],
+ # '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'],
+ # 'using/windows': ['windowssidebar.html', 'searchbox.html'],
}
# Additional templates that should be rendered to pages, maps page names to
@@ -317,6 +317,14 @@ linkcheck_ignore = [
r"https://gis.stackexchange.com/",
"https://vrp.pgrouting.org/v0/en/pgr-category.html",
"https://vrp.pgrouting.org/latest/en/pgr-category.html",
+ "https://vrp.pgrouting.org/v0/en/vroom-category.html",
+ "https://vrp.pgrouting.org/latest/en/vroom-category.html",
+ "https://vrp.pgrouting.org/v0/en/vrp_vroom.html",
+ "https://vrp.pgrouting.org/latest/en/vrp_vroom.html",
+ "https://vrp.pgrouting.org/v0/en/vrp_vroomJobs.html",
+ "https://vrp.pgrouting.org/latest/en/vrp_vroomJobs.html",
+ "https://vrp.pgrouting.org/v0/en/vrp_vroomShipments.html",
+ "https://vrp.pgrouting.org/latest/en/vrp_vroomShipments.html",
# (see: https://github.com/sphinx-doc/sphinx/issues/7388)
r"https://github.com/pgRouting/vrprouting/", # limit only vrprouting
diff --git a/doc/general/CMakeLists.txt b/doc/general/CMakeLists.txt
index e542f46ef..be8954041 100644
--- a/doc/general/CMakeLists.txt
+++ b/doc/general/CMakeLists.txt
@@ -11,6 +11,7 @@ SET(LOCAL_FILES
sampledata.rst
support.rst
pgr-category.rst
+ vroom-category.rst
)
foreach (f ${LOCAL_FILES})
diff --git a/doc/general/experimental.rst b/doc/general/experimental.rst
index 6ea295034..0bd4a3aee 100644
--- a/doc/general/experimental.rst
+++ b/doc/general/experimental.rst
@@ -51,6 +51,7 @@ Experimental Functions
:maxdepth: 2
pgr-category
+ vroom-category
.. rubric:: See Also
diff --git a/doc/general/release_notes.rst b/doc/general/release_notes.rst
index c90d3ca57..8259f4938 100644
--- a/doc/general/release_notes.rst
+++ b/doc/general/release_notes.rst
@@ -25,6 +25,12 @@ To see the full list of changes check the list of `Git commits `__ → `vrpRouting v0 `__
+* Supported Versions
+ `Latest `__
+ (`v0 `__)
+
+
+VROOM - Category (Experimental)
+===============================================================================
+
+.. include:: experimental.rst
+ :start-after: begin-warn-expr
+ :end-before: end-warn-expr
+
+
+.. contents::
+
+.. rubric:: Functions
+
+.. toctree::
+ :maxdepth: 1
+
+ vrp_vroom
+ vrp_vroomJobs
+ vrp_vroomShipments
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+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.
+
+VROOM can solve several well-known types of vehicle routing problems (VRP).
+
+- TSP (travelling salesman problem)
+- CVRP (capacitated VRP)
+- VRPTW (VRP with time windows)
+- MDHVRPTW (multi-depot heterogeneous vehicle VRPTW)
+- PDPTW (pickup-and-delivery problem with TW)
+
+VROOM can also solve any mix of the above problem types.
+
+
+Characteristics
+...............................................................................
+
+VROOM models a Vehicle Routing Problem with ``vehicles``, ``jobs`` and ``shipments``.
+
+The **vehicles** denote the resources that pick and/or deliver the jobs and shipments.
+They are characterised by:
+
+- Capacity on arbitrary number of metrics
+- Skills
+- Working hours
+- Driver breaks
+- Start and end defined on a per-vehicle basis
+- Start and end can be different
+- Open trip optimization (only start or only end defined)
+
+The **jobs** denote the single-location pickup and/or delivery tasks, and the **shipments**
+denote the pickup-and-delivery tasks that should happen within the same route.
+They are characterised by:
+
+- Delivery/pickup amounts on arbitrary number of metrics
+- Service time windows
+- Service duration
+- Skills
+- Priority
+
+Terminologies
+...............................................................................
+
+- **Tasks**: Either jobs or shipments are referred to as tasks.
+- **Skills**: Every task and vehicle may have some set of skills. A task can be served by only that vehicle which has all the skills of the task.
+- **Priority**: Tasks may have some priority assigned, which is useful when all tasks cannot be performed due to constraints, so the tasks with low priority are left unassigned.
+- **Amount (for shipment), Pickup and delivery (for job)**: They denote the multidimensional quantities such as number of items, weights, volume, etc.
+- **Capacity (for vehicle)**: Every vehicle may have some capacity, denoting the multidimensional quantities. A vehicle can serve only those sets of tasks such that the total sum of the quantity does not exceed the vehicle capacity, at any point of the route.
+- **Time Window**: An interval of time during which some activity can be performed, such as working hours of the vehicle, break of the vehicle, or service start time for a task.
+- **Break**: Array of time windows, denoting valid slots for the break start of a vehicle.
+- **Service time**: The additional time to be spent by a vehicle while serving a task.
+- **Travel time**: The total time the vehicle travels during its route.
+- **Waiting time**: The total time the vehicle is idle, i.e. it is neither traveling nor servicing any task. It is generally the time spent by a vehicle waiting for a task service to open.
+
+Inner Queries
+-------------------------------------------------------------------------------
+
+Jobs SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/jobs_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+Shipments SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/shipments_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+.. inner_queries_start
+
+Vehicles SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/vehicles_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+Breaks SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/breaks_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+Time Windows SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/time_windows_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+Time Matrix SQL
+...............................................................................
+
+.. include:: ../../src/common/matrixRows_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+.. inner_queries_end
+
+Result Columns
+-------------------------------------------------------------------------------
+
+.. result_columns_start
+
+.. include:: ../sql/vroom/vrp_vroom.sql
+ :start-after: result start
+ :end-before: result end
+
+.. result_columns_end
+
+See Also
+-------------------------------------------------------------------------------
+
+.. see_also_start
+
+* `Wikipedia: Vehicle Routing problems `__
+* `VROOM: Vehicle Routing Open-source Optimization Machine `__
+* `VROOM API Documentation `__
+
+.. see_also_end
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/doc/vroom/CMakeLists.txt b/doc/vroom/CMakeLists.txt
new file mode 100644
index 000000000..d537ef8af
--- /dev/null
+++ b/doc/vroom/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+SET(LOCAL_FILES
+ vrp_vroom.rst
+ vrp_vroomJobs.rst
+ vrp_vroomShipments.rst
+ )
+
+foreach (f ${LOCAL_FILES})
+ configure_file(${f} "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}")
+ list(APPEND LOCAL_DOC_FILES ${PGR_DOCUMENTATION_SOURCE_DIR}/${f})
+endforeach()
+
+set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE)
+set(PROJECT_IMG_FILES ${PROJECT_IMG_FILES} PARENT_SCOPE)
diff --git a/doc/vroom/vrp_vroom.rst b/doc/vroom/vrp_vroom.rst
new file mode 100644
index 000000000..2987ee976
--- /dev/null
+++ b/doc/vroom/vrp_vroom.rst
@@ -0,0 +1,116 @@
+..
+ ****************************************************************************
+ vrpRouting Manual
+ Copyright(c) vrpRouting Contributors
+
+ This documentation is licensed under a Creative Commons Attribution-Share
+ Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
+ ****************************************************************************
+
+|
+
+* `Documentation `__ → `vrpRouting v0 `__
+* Supported Versions
+ `Latest `__
+ (`v0 `__)
+
+
+vrp_vroom - Experimental
+===============================================================================
+
+``vrp_vroom`` - Vehicle Routing Problem with VROOM, involving both jobs and shipments.
+
+.. include:: experimental.rst
+ :start-after: begin-warn-expr
+ :end-before: end-warn-expr
+
+.. rubric:: Availability
+
+Version 0.2.0
+
+* New **experimental** function
+
+
+Description
+-------------------------------------------------------------------------------
+
+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.
+This function can be used to get the solution to a problem involving both jobs and
+shipments.
+
+.. index::
+ single: vrp_vroom -- Experimental on v0.2
+
+Signature
+-------------------------------------------------------------------------------
+
+.. include:: ../sql/vroom/vrp_vroom.sql
+ :start-after: signature start
+ :end-before: signature end
+
+**Example**: This example is based on the VROOM Data of the :doc:`sampledata` network:
+
+.. literalinclude:: doc-vrp_vroom.queries
+ :start-after: -- q1
+ :end-before: -- q2
+
+Parameters
+-------------------------------------------------------------------------------
+
+.. include:: ../sql/vroom/vrp_vroom.sql
+ :start-after: parameters start
+ :end-before: parameters end
+
+Inner Queries
+-------------------------------------------------------------------------------
+
+Jobs SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/jobs_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+Shipments SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/shipments_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+.. include:: vroom-category.rst
+ :start-after: inner_queries_start
+ :end-before: inner_queries_end
+
+Result Columns
+-------------------------------------------------------------------------------
+
+.. include:: vroom-category.rst
+ :start-after: result_columns_start
+ :end-before: result_columns_end
+
+Additional Example
+-------------------------------------------------------------------------------
+
+Problem involving 2 jobs and 1 shipment, using a single vehicle, similar to the VROOM Documentation
+`Example 2 `__ with a shipment.
+
+.. literalinclude:: doc-vrp_vroom.queries
+ :start-after: -- q2
+ :end-before: -- q3
+
+See Also
+-------------------------------------------------------------------------------
+
+* :doc:`vroom-category`
+* The queries use the :doc:`sampledata` network.
+
+.. include:: vroom-category.rst
+ :start-after: see_also_start
+ :end-before: see_also_end
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/doc/vroom/vrp_vroomJobs.rst b/doc/vroom/vrp_vroomJobs.rst
new file mode 100644
index 000000000..be67cf924
--- /dev/null
+++ b/doc/vroom/vrp_vroomJobs.rst
@@ -0,0 +1,108 @@
+..
+ ****************************************************************************
+ vrpRouting Manual
+ Copyright(c) vrpRouting Contributors
+
+ This documentation is licensed under a Creative Commons Attribution-Share
+ Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
+ ****************************************************************************
+
+|
+
+* `Documentation `__ → `vrpRouting v0 `__
+* Supported Versions
+ `Latest `__
+ (`v0 `__)
+
+
+vrp_vroomJobs - Experimental
+===============================================================================
+
+``vrp_vroomJobs`` - Vehicle Routing Problem with VROOM, involving only jobs.
+
+.. include:: experimental.rst
+ :start-after: begin-warn-expr
+ :end-before: end-warn-expr
+
+.. rubric:: Availability
+
+Version 0.2.0
+
+* New **experimental** function
+
+
+Description
+-------------------------------------------------------------------------------
+
+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.
+This function can be used to get the solution to a problem involving only jobs.
+
+.. index::
+ single: vrp_vroomJobs -- Experimental on v0.2
+
+Signature
+-------------------------------------------------------------------------------
+
+.. include:: ../sql/vroom/vrp_vroomJobs.sql
+ :start-after: signature start
+ :end-before: signature end
+
+**Example**: This example is based on the VROOM Data of the :doc:`sampledata` network:
+
+.. literalinclude:: doc-vrp_vroomJobs.queries
+ :start-after: -- q1
+ :end-before: -- q2
+
+Parameters
+-------------------------------------------------------------------------------
+
+.. include:: ../sql/vroom/vrp_vroomJobs.sql
+ :start-after: parameters start
+ :end-before: parameters end
+
+Inner Queries
+-------------------------------------------------------------------------------
+
+Jobs SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/jobs_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+.. include:: vroom-category.rst
+ :start-after: inner_queries_start
+ :end-before: inner_queries_end
+
+Result Columns
+-------------------------------------------------------------------------------
+
+.. include:: vroom-category.rst
+ :start-after: result_columns_start
+ :end-before: result_columns_end
+
+Additional Example
+-------------------------------------------------------------------------------
+
+Problem involving 2 jobs, using a single vehicle, corresponding to the VROOM Documentation
+`Example 2 `__.
+
+.. literalinclude:: doc-vrp_vroomJobs.queries
+ :start-after: -- q2
+ :end-before: -- q3
+
+See Also
+-------------------------------------------------------------------------------
+
+* :doc:`vroom-category`
+* The queries use the :doc:`sampledata` network.
+
+.. include:: vroom-category.rst
+ :start-after: see_also_start
+ :end-before: see_also_end
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/doc/vroom/vrp_vroomShipments.rst b/doc/vroom/vrp_vroomShipments.rst
new file mode 100644
index 000000000..5a504eeed
--- /dev/null
+++ b/doc/vroom/vrp_vroomShipments.rst
@@ -0,0 +1,109 @@
+..
+ ****************************************************************************
+ vrpRouting Manual
+ Copyright(c) vrpRouting Contributors
+
+ This documentation is licensed under a Creative Commons Attribution-Share
+ Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
+ ****************************************************************************
+
+|
+
+* `Documentation `__ → `vrpRouting v0 `__
+* Supported Versions
+ `Latest `__
+ (`v0 `__)
+
+
+vrp_vroomShipments - Experimental
+===============================================================================
+
+``vrp_vroomShipments`` - Vehicle Routing Problem with VROOM, involving only shipments.
+
+.. include:: experimental.rst
+ :start-after: begin-warn-expr
+ :end-before: end-warn-expr
+
+.. rubric:: Availability
+
+Version 0.2.0
+
+* New **experimental** function
+
+
+Description
+-------------------------------------------------------------------------------
+
+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.
+This function can be used to get the solution to a problem involving only shipments.
+
+.. index::
+ single: vrp_vroomShipments -- Experimental on v0.2
+
+Signature
+-------------------------------------------------------------------------------
+
+.. include:: ../sql/vroom/vrp_vroomShipments.sql
+ :start-after: signature start
+ :end-before: signature end
+
+**Example**: This example is based on the VROOM Data of the :doc:`sampledata` network:
+
+.. literalinclude:: doc-vrp_vroomShipments.queries
+ :start-after: -- q1
+ :end-before: -- q2
+
+Parameters
+-------------------------------------------------------------------------------
+
+.. include:: ../sql/vroom/vrp_vroomShipments.sql
+ :start-after: parameters start
+ :end-before: parameters end
+
+Inner Queries
+-------------------------------------------------------------------------------
+
+Shipments SQL
+...............................................................................
+
+.. include:: ../../src/common/vroom/shipments_input.c
+ :start-after: vrp_vroom start
+ :end-before: vrp_vroom end
+
+.. include:: vroom-category.rst
+ :start-after: inner_queries_start
+ :end-before: inner_queries_end
+
+Result Columns
+-------------------------------------------------------------------------------
+
+.. include:: vroom-category.rst
+ :start-after: result_columns_start
+ :end-before: result_columns_end
+
+Additional Example
+-------------------------------------------------------------------------------
+
+Problem involving 1 shipment, using a single vehicle, similar to the VROOM Documentation
+`Example 2 `__ without jobs
+and with a shipment.
+
+.. literalinclude:: doc-vrp_vroomShipments.queries
+ :start-after: -- q2
+ :end-before: -- q3
+
+See Also
+-------------------------------------------------------------------------------
+
+* :doc:`vroom-category`
+* The queries use the :doc:`sampledata` network.
+
+.. include:: vroom-category.rst
+ :start-after: see_also_start
+ :end-before: see_also_end
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/docqueries/vroom/CMakeLists.txt b/docqueries/vroom/CMakeLists.txt
new file mode 100644
index 000000000..ad8f8281f
--- /dev/null
+++ b/docqueries/vroom/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Do not use extensions
+SET(LOCAL_FILES
+ doc-vrp_vroom
+ doc-vrp_vroomJobs
+ doc-vrp_vroomShipments
+ )
+
+foreach (f ${LOCAL_FILES})
+ configure_file("${f}.result" "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries")
+ list(APPEND LOCAL_DOC_FILES "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries")
+endforeach()
+
+set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE)
diff --git a/docqueries/vroom/doc-vrp_vroom.result b/docqueries/vroom/doc-vrp_vroom.result
new file mode 100644
index 000000000..371ee2ad9
--- /dev/null
+++ b/docqueries/vroom/doc-vrp_vroom.result
@@ -0,0 +1,91 @@
+BEGIN;
+BEGIN
+SET client_min_messages TO NOTICE;
+SET
+-- q1
+SELECT *
+FROM vrp_vroom(
+ 'SELECT * FROM vroom.jobs',
+ 'SELECT * FROM vroom.jobs_time_windows',
+ 'SELECT * FROM vroom.shipments',
+ 'SELECT * FROM vroom.shipments_time_windows',
+ 'SELECT * FROM vroom.vehicles',
+ 'SELECT * FROM vroom.breaks',
+ 'SELECT * FROM vroom.breaks_time_windows',
+ 'SELECT * FROM vroom.matrix'
+);
+ seq | vehicle_seq | vehicle_id | step_seq | step_type | task_id | arrival | travel_time | service_time | waiting_time | load
+-----+-------------+------------+----------+-----------+---------+---------+-------------+--------------+--------------+------
+ 1 | 1 | 1 | 1 | 1 | -1 | 300 | 0 | 0 | 0 | {30}
+ 2 | 1 | 1 | 2 | 5 | 1 | 300 | 0 | 0 | 0 | {30}
+ 3 | 1 | 1 | 3 | 2 | 2 | 350 | 50 | 250 | 900 | {30}
+ 4 | 1 | 1 | 4 | 3 | 5 | 1500 | 50 | 2250 | 11850 | {40}
+ 5 | 1 | 1 | 5 | 3 | 3 | 15650 | 100 | 2250 | 0 | {60}
+ 6 | 1 | 1 | 6 | 4 | 5 | 17950 | 150 | 2250 | 225 | {50}
+ 7 | 1 | 1 | 7 | 4 | 3 | 20425 | 150 | 2250 | 200 | {30}
+ 8 | 1 | 1 | 8 | 6 | -1 | 22925 | 200 | 0 | 0 | {30}
+ 9 | 2 | 2 | 1 | 1 | -1 | 275 | 0 | 0 | 0 | {70}
+ 10 | 2 | 2 | 2 | 5 | 2 | 275 | 0 | 10 | 0 | {70}
+ 11 | 2 | 2 | 3 | 2 | 5 | 360 | 75 | 250 | 665 | {70}
+ 12 | 2 | 2 | 4 | 2 | 3 | 1325 | 125 | 250 | 1400 | {70}
+ 13 | 2 | 2 | 5 | 2 | 4 | 2975 | 125 | 250 | 550 | {70}
+ 14 | 2 | 2 | 6 | 6 | -1 | 3775 | 125 | 0 | 0 | {70}
+ 15 | 3 | 3 | 1 | 1 | -1 | 0 | 0 | 0 | 0 | {20}
+ 16 | 3 | 3 | 2 | 5 | 3 | 0 | 0 | 0 | 0 | {20}
+ 17 | 3 | 3 | 3 | 2 | 1 | 0 | 0 | 250 | 3625 | {20}
+ 18 | 3 | 3 | 4 | 3 | 4 | 3875 | 0 | 2250 | 2500 | {40}
+ 19 | 3 | 3 | 5 | 4 | 4 | 8700 | 75 | 2250 | 225 | {20}
+ 20 | 3 | 3 | 6 | 6 | -1 | 11250 | 150 | 0 | 0 | {20}
+ 21 | 4 | 4 | 1 | 1 | -1 | 250 | 0 | 0 | 0 | {0}
+ 22 | 4 | 4 | 2 | 5 | 4 | 250 | 0 | 0 | 0 | {0}
+ 23 | 4 | 4 | 3 | 3 | 2 | 275 | 25 | 2250 | 100 | {10}
+ 24 | 4 | 4 | 4 | 3 | 1 | 2650 | 50 | 2250 | 0 | {20}
+ 25 | 4 | 4 | 5 | 4 | 2 | 4990 | 140 | 2250 | 0 | {10}
+ 26 | 4 | 4 | 6 | 4 | 1 | 7351 | 251 | 2250 | 17574 | {0}
+ 27 | 4 | 4 | 7 | 6 | -1 | 27200 | 276 | 0 | 0 | {0}
+(27 rows)
+
+-- q2
+SELECT *
+FROM vrp_vroom(
+ $jobs$
+ SELECT * FROM (
+ VALUES (1414, 2), (1515, 3)
+ ) AS C(id, location_index)
+ $jobs$,
+ NULL,
+ $shipments$
+ SELECT * FROM (
+ VALUES (100, 1, 4)
+ ) AS C(id, p_location_index, d_location_index)
+ $shipments$,
+ NULL,
+ $vehicles$
+ SELECT * FROM (
+ VALUES (1, 1, 4)
+ ) AS C(id, start_index, end_index)
+ $vehicles$,
+ NULL,
+ NULL,
+ $matrix$
+ SELECT * FROM (
+ VALUES (1, 2, 2104), (1, 3, 197), (1, 4, 1299),
+ (2, 1, 2103), (2, 3, 2255), (2, 4, 3152),
+ (3, 1, 197), (3, 2, 2256), (3, 4, 1102),
+ (4, 1, 1299), (4, 2, 3153), (4, 3, 1102)
+ ) AS C(start_vid, end_vid, agg_cost)
+ $matrix$
+);
+ seq | vehicle_seq | vehicle_id | step_seq | step_type | task_id | arrival | travel_time | service_time | waiting_time | load
+-----+-------------+------------+----------+-----------+---------+---------+-------------+--------------+--------------+------
+ 1 | 1 | 1 | 1 | 1 | -1 | 0 | 0 | 0 | 0 | {}
+ 2 | 1 | 1 | 2 | 3 | 100 | 0 | 0 | 0 | 0 | {}
+ 3 | 1 | 1 | 3 | 2 | 1414 | 2104 | 2104 | 0 | 0 | {}
+ 4 | 1 | 1 | 4 | 2 | 1515 | 4359 | 4359 | 0 | 0 | {}
+ 5 | 1 | 1 | 5 | 4 | 100 | 5461 | 5461 | 0 | 0 | {}
+ 6 | 1 | 1 | 6 | 6 | -1 | 5461 | 5461 | 0 | 0 | {}
+(6 rows)
+
+-- q3
+ROLLBACK;
+ROLLBACK
diff --git a/docqueries/vroom/doc-vrp_vroom.test.sql b/docqueries/vroom/doc-vrp_vroom.test.sql
new file mode 100644
index 000000000..c0ce92438
--- /dev/null
+++ b/docqueries/vroom/doc-vrp_vroom.test.sql
@@ -0,0 +1,44 @@
+\echo -- q1
+SELECT *
+FROM vrp_vroom(
+ 'SELECT * FROM vroom.jobs',
+ 'SELECT * FROM vroom.jobs_time_windows',
+ 'SELECT * FROM vroom.shipments',
+ 'SELECT * FROM vroom.shipments_time_windows',
+ 'SELECT * FROM vroom.vehicles',
+ 'SELECT * FROM vroom.breaks',
+ 'SELECT * FROM vroom.breaks_time_windows',
+ 'SELECT * FROM vroom.matrix'
+);
+\echo -- q2
+SELECT *
+FROM vrp_vroom(
+ $jobs$
+ SELECT * FROM (
+ VALUES (1414, 2), (1515, 3)
+ ) AS C(id, location_index)
+ $jobs$,
+ NULL,
+ $shipments$
+ SELECT * FROM (
+ VALUES (100, 1, 4)
+ ) AS C(id, p_location_index, d_location_index)
+ $shipments$,
+ NULL,
+ $vehicles$
+ SELECT * FROM (
+ VALUES (1, 1, 4)
+ ) AS C(id, start_index, end_index)
+ $vehicles$,
+ NULL,
+ NULL,
+ $matrix$
+ SELECT * FROM (
+ VALUES (1, 2, 2104), (1, 3, 197), (1, 4, 1299),
+ (2, 1, 2103), (2, 3, 2255), (2, 4, 3152),
+ (3, 1, 197), (3, 2, 2256), (3, 4, 1102),
+ (4, 1, 1299), (4, 2, 3153), (4, 3, 1102)
+ ) AS C(start_vid, end_vid, agg_cost)
+ $matrix$
+);
+\echo -- q3
diff --git a/docqueries/vroom/doc-vrp_vroomJobs.result b/docqueries/vroom/doc-vrp_vroomJobs.result
new file mode 100644
index 000000000..db6a8f149
--- /dev/null
+++ b/docqueries/vroom/doc-vrp_vroomJobs.result
@@ -0,0 +1,65 @@
+BEGIN;
+BEGIN
+SET client_min_messages TO NOTICE;
+SET
+-- q1
+SELECT *
+FROM vrp_vroomJobs(
+ 'SELECT * FROM vroom.jobs',
+ 'SELECT * FROM vroom.jobs_time_windows',
+ 'SELECT * FROM vroom.vehicles',
+ 'SELECT * FROM vroom.breaks',
+ 'SELECT * FROM vroom.breaks_time_windows',
+ 'SELECT * FROM vroom.matrix'
+);
+ seq | vehicle_seq | vehicle_id | step_seq | step_type | task_id | arrival | travel_time | service_time | waiting_time | load
+-----+-------------+------------+----------+-----------+---------+---------+-------------+--------------+--------------+-------
+ 1 | 1 | 1 | 1 | 1 | -1 | 300 | 0 | 0 | 0 | {20}
+ 2 | 1 | 1 | 2 | 5 | 1 | 300 | 0 | 0 | 0 | {20}
+ 3 | 1 | 1 | 3 | 2 | 1 | 300 | 0 | 250 | 3325 | {20}
+ 4 | 1 | 1 | 4 | 6 | -1 | 3875 | 0 | 0 | 0 | {20}
+ 5 | 2 | 2 | 1 | 1 | -1 | 275 | 0 | 0 | 0 | {100}
+ 6 | 2 | 2 | 2 | 5 | 2 | 275 | 0 | 10 | 0 | {100}
+ 7 | 2 | 2 | 3 | 2 | 2 | 335 | 50 | 250 | 915 | {100}
+ 8 | 2 | 2 | 4 | 2 | 5 | 1590 | 140 | 250 | 0 | {100}
+ 9 | 2 | 2 | 5 | 2 | 3 | 1890 | 190 | 250 | 835 | {100}
+ 10 | 2 | 2 | 6 | 2 | 4 | 2975 | 190 | 250 | 550 | {100}
+ 11 | 2 | 2 | 7 | 6 | -1 | 3775 | 190 | 0 | 0 | {100}
+(11 rows)
+
+-- q2
+SELECT *
+FROM vrp_vroomJobs(
+ $jobs$
+ SELECT * FROM (
+ VALUES (1414, 2), (1515, 3)
+ ) AS C(id, location_index)
+ $jobs$,
+ NULL,
+ $vehicles$
+ SELECT * FROM (
+ VALUES (1, 1, 4)
+ ) AS C(id, start_index, end_index)
+ $vehicles$,
+ NULL,
+ NULL,
+ $matrix$
+ SELECT * FROM (
+ VALUES (1, 2, 2104), (1, 3, 197), (1, 4, 1299),
+ (2, 1, 2103), (2, 3, 2255), (2, 4, 3152),
+ (3, 1, 197), (3, 2, 2256), (3, 4, 1102),
+ (4, 1, 1299), (4, 2, 3153), (4, 3, 1102)
+ ) AS C(start_vid, end_vid, agg_cost)
+ $matrix$
+);
+ seq | vehicle_seq | vehicle_id | step_seq | step_type | task_id | arrival | travel_time | service_time | waiting_time | load
+-----+-------------+------------+----------+-----------+---------+---------+-------------+--------------+--------------+------
+ 1 | 1 | 1 | 1 | 1 | -1 | 0 | 0 | 0 | 0 | {}
+ 2 | 1 | 1 | 2 | 2 | 1414 | 2104 | 2104 | 0 | 0 | {}
+ 3 | 1 | 1 | 3 | 2 | 1515 | 4359 | 4359 | 0 | 0 | {}
+ 4 | 1 | 1 | 4 | 6 | -1 | 5461 | 5461 | 0 | 0 | {}
+(4 rows)
+
+-- q3
+ROLLBACK;
+ROLLBACK
diff --git a/docqueries/vroom/doc-vrp_vroomJobs.test.sql b/docqueries/vroom/doc-vrp_vroomJobs.test.sql
new file mode 100644
index 000000000..c2d39c778
--- /dev/null
+++ b/docqueries/vroom/doc-vrp_vroomJobs.test.sql
@@ -0,0 +1,36 @@
+\echo -- q1
+SELECT *
+FROM vrp_vroomJobs(
+ 'SELECT * FROM vroom.jobs',
+ 'SELECT * FROM vroom.jobs_time_windows',
+ 'SELECT * FROM vroom.vehicles',
+ 'SELECT * FROM vroom.breaks',
+ 'SELECT * FROM vroom.breaks_time_windows',
+ 'SELECT * FROM vroom.matrix'
+);
+\echo -- q2
+SELECT *
+FROM vrp_vroomJobs(
+ $jobs$
+ SELECT * FROM (
+ VALUES (1414, 2), (1515, 3)
+ ) AS C(id, location_index)
+ $jobs$,
+ NULL,
+ $vehicles$
+ SELECT * FROM (
+ VALUES (1, 1, 4)
+ ) AS C(id, start_index, end_index)
+ $vehicles$,
+ NULL,
+ NULL,
+ $matrix$
+ SELECT * FROM (
+ VALUES (1, 2, 2104), (1, 3, 197), (1, 4, 1299),
+ (2, 1, 2103), (2, 3, 2255), (2, 4, 3152),
+ (3, 1, 197), (3, 2, 2256), (3, 4, 1102),
+ (4, 1, 1299), (4, 2, 3153), (4, 3, 1102)
+ ) AS C(start_vid, end_vid, agg_cost)
+ $matrix$
+);
+\echo -- q3
diff --git a/docqueries/vroom/doc-vrp_vroomShipments.result b/docqueries/vroom/doc-vrp_vroomShipments.result
new file mode 100644
index 000000000..625293f5e
--- /dev/null
+++ b/docqueries/vroom/doc-vrp_vroomShipments.result
@@ -0,0 +1,70 @@
+BEGIN;
+BEGIN
+SET client_min_messages TO NOTICE;
+SET
+-- q1
+SELECT *
+FROM vrp_vroomShipments(
+ 'SELECT * FROM vroom.shipments',
+ 'SELECT * FROM vroom.shipments_time_windows',
+ 'SELECT * FROM vroom.vehicles',
+ 'SELECT * FROM vroom.breaks',
+ 'SELECT * FROM vroom.breaks_time_windows',
+ 'SELECT * FROM vroom.matrix'
+);
+ seq | vehicle_seq | vehicle_id | step_seq | step_type | task_id | arrival | travel_time | service_time | waiting_time | load
+-----+-------------+------------+----------+-----------+---------+---------+-------------+--------------+--------------+------
+ 1 | 1 | 1 | 1 | 1 | -1 | 300 | 0 | 0 | 0 | {0}
+ 2 | 1 | 1 | 2 | 5 | 1 | 300 | 0 | 0 | 0 | {0}
+ 3 | 1 | 1 | 3 | 3 | 4 | 300 | 0 | 2250 | 6075 | {20}
+ 4 | 1 | 1 | 4 | 4 | 4 | 8700 | 75 | 2250 | 225 | {0}
+ 5 | 1 | 1 | 5 | 3 | 5 | 11265 | 165 | 2250 | 2085 | {10}
+ 6 | 1 | 1 | 6 | 3 | 3 | 15650 | 215 | 2250 | 0 | {30}
+ 7 | 1 | 1 | 7 | 4 | 5 | 17950 | 265 | 2250 | 225 | {20}
+ 8 | 1 | 1 | 8 | 4 | 3 | 20425 | 265 | 2250 | 200 | {0}
+ 9 | 1 | 1 | 9 | 6 | -1 | 22925 | 315 | 0 | 0 | {0}
+ 10 | 2 | 4 | 1 | 1 | -1 | 250 | 0 | 0 | 0 | {0}
+ 11 | 2 | 4 | 2 | 5 | 4 | 250 | 0 | 0 | 0 | {0}
+ 12 | 2 | 4 | 3 | 3 | 2 | 275 | 25 | 2250 | 100 | {10}
+ 13 | 2 | 4 | 4 | 3 | 1 | 2650 | 50 | 2250 | 0 | {20}
+ 14 | 2 | 4 | 5 | 4 | 2 | 4990 | 140 | 2250 | 0 | {10}
+ 15 | 2 | 4 | 6 | 4 | 1 | 7351 | 251 | 2250 | 17574 | {0}
+ 16 | 2 | 4 | 7 | 6 | -1 | 27200 | 276 | 0 | 0 | {0}
+(16 rows)
+
+-- q2
+SELECT *
+FROM vrp_vroomShipments(
+ $shipments$
+ SELECT * FROM (
+ VALUES (100, 1, 4)
+ ) AS C(id, p_location_index, d_location_index)
+ $shipments$,
+ NULL,
+ $vehicles$
+ SELECT * FROM (
+ VALUES (1, 1, 4)
+ ) AS C(id, start_index, end_index)
+ $vehicles$,
+ NULL,
+ NULL,
+ $matrix$
+ SELECT * FROM (
+ VALUES (1, 2, 2104), (1, 3, 197), (1, 4, 1299),
+ (2, 1, 2103), (2, 3, 2255), (2, 4, 3152),
+ (3, 1, 197), (3, 2, 2256), (3, 4, 1102),
+ (4, 1, 1299), (4, 2, 3153), (4, 3, 1102)
+ ) AS C(start_vid, end_vid, agg_cost)
+ $matrix$
+);
+ seq | vehicle_seq | vehicle_id | step_seq | step_type | task_id | arrival | travel_time | service_time | waiting_time | load
+-----+-------------+------------+----------+-----------+---------+---------+-------------+--------------+--------------+------
+ 1 | 1 | 1 | 1 | 1 | -1 | 0 | 0 | 0 | 0 | {}
+ 2 | 1 | 1 | 2 | 3 | 100 | 0 | 0 | 0 | 0 | {}
+ 3 | 1 | 1 | 3 | 4 | 100 | 1299 | 1299 | 0 | 0 | {}
+ 4 | 1 | 1 | 4 | 6 | -1 | 1299 | 1299 | 0 | 0 | {}
+(4 rows)
+
+-- q3
+ROLLBACK;
+ROLLBACK
diff --git a/docqueries/vroom/doc-vrp_vroomShipments.test.sql b/docqueries/vroom/doc-vrp_vroomShipments.test.sql
new file mode 100644
index 000000000..71fc684a6
--- /dev/null
+++ b/docqueries/vroom/doc-vrp_vroomShipments.test.sql
@@ -0,0 +1,36 @@
+\echo -- q1
+SELECT *
+FROM vrp_vroomShipments(
+ 'SELECT * FROM vroom.shipments',
+ 'SELECT * FROM vroom.shipments_time_windows',
+ 'SELECT * FROM vroom.vehicles',
+ 'SELECT * FROM vroom.breaks',
+ 'SELECT * FROM vroom.breaks_time_windows',
+ 'SELECT * FROM vroom.matrix'
+);
+\echo -- q2
+SELECT *
+FROM vrp_vroomShipments(
+ $shipments$
+ SELECT * FROM (
+ VALUES (100, 1, 4)
+ ) AS C(id, p_location_index, d_location_index)
+ $shipments$,
+ NULL,
+ $vehicles$
+ SELECT * FROM (
+ VALUES (1, 1, 4)
+ ) AS C(id, start_index, end_index)
+ $vehicles$,
+ NULL,
+ NULL,
+ $matrix$
+ SELECT * FROM (
+ VALUES (1, 2, 2104), (1, 3, 197), (1, 4, 1299),
+ (2, 1, 2103), (2, 3, 2255), (2, 4, 3152),
+ (3, 1, 197), (3, 2, 2256), (3, 4, 1102),
+ (4, 1, 1299), (4, 2, 3153), (4, 3, 1102)
+ ) AS C(start_vid, end_vid, agg_cost)
+ $matrix$
+);
+\echo -- q3
diff --git a/docqueries/vroom/test.conf b/docqueries/vroom/test.conf
new file mode 100644
index 000000000..8cd4cabd0
--- /dev/null
+++ b/docqueries/vroom/test.conf
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+ 'any' => {
+ 'comment' => 'VRP with VROOM tests.',
+ 'data' => [ ],
+ 'tests' => [qw(
+ doc-vrp_vroom
+ doc-vrp_vroomJobs
+ doc-vrp_vroomShipments
+ )],
+ 'documentation' => [qw(
+ doc-vrp_vroom
+ doc-vrp_vroomJobs
+ doc-vrp_vroomShipments
+ )]
+ },
+
+);
+
+1;
diff --git a/include/c_common/arrays_input.h b/include/c_common/arrays_input.h
index f5677d0e0..33db7eadc 100644
--- a/include/c_common/arrays_input.h
+++ b/include/c_common/arrays_input.h
@@ -37,4 +37,7 @@ int64_t* pgr_get_bigIntArray(size_t *arrlen, ArrayType *input);
/** @brief Allows the input array to be empty */
int64_t* pgr_get_bigIntArray_allowEmpty(size_t *arrlen, ArrayType *input);
+/** @brief Allows the input array, with non-negative elements to be empty */
+uint32_t* pgr_get_positiveIntArray_allowEmpty(size_t *arrlen, ArrayType *input);
+
#endif // INCLUDE_C_COMMON_ARRAYS_INPUT_H_
diff --git a/include/c_common/get_check_data.h b/include/c_common/get_check_data.h
index 3625ab1ff..c8fdf224c 100644
--- a/include/c_common/get_check_data.h
+++ b/include/c_common/get_check_data.h
@@ -44,7 +44,6 @@ spi_getChar(
HeapTuple *tuple,
TupleDesc *tupdesc,
Column_info_t info,
- bool strict,
char default_value);
/** @brief Function returns the values of specified columns in array. */
@@ -63,6 +62,22 @@ spi_getBigIntArr_allowEmpty(
Column_info_t info,
size_t *the_size);
+/** @brief Function returns the values of specified columns in array. */
+int64_t*
+spi_getPositiveBigIntArr_allowEmpty(
+ HeapTuple *tuple,
+ TupleDesc *tupdesc,
+ Column_info_t info,
+ size_t *the_size);
+
+/** @brief Function returns the values of specified columns in array. */
+uint32_t*
+spi_getPositiveIntArr_allowEmpty(
+ HeapTuple *tuple,
+ TupleDesc *tupdesc,
+ Column_info_t info,
+ size_t *the_size);
+
/** @brief gets value of specified column in double type. */
double
spi_getFloat8(
@@ -81,7 +96,7 @@ spi_getText(
/** @name timestamp related
* @{ */
/** @brief Converts timestamp to timestamp without timezone */
-TTimestamp timestamp_without_timezone( TTimestamp timestamp);
+TTimestamp timestamp_without_timezone(TTimestamp timestamp);
/** @brief gets a timestamp value from postgres type TIMESTAMP */
TTimestamp get_TTimestamp(HeapTuple*, TupleDesc*, Column_info_t, TTimestamp);
@@ -114,6 +129,27 @@ TInterval get_PositiveTInterval_plain(HeapTuple*, TupleDesc*, Column_info_t, TIn
/** get Id from data */
Id get_Id(HeapTuple*, TupleDesc*, Column_info_t, Id);
+/** get Idx from data */
+Idx get_Idx(HeapTuple*, TupleDesc*, Column_info_t, Idx);
+
+/** get StepType from data */
+StepType get_StepType(HeapTuple *, TupleDesc *, Column_info_t, StepType);
+
+/** get MatrixIndex from data */
+MatrixIndex get_MatrixIndex(HeapTuple*, TupleDesc*, Column_info_t, MatrixIndex);
+
+/** get Duration from data */
+Duration get_Duration(HeapTuple*, TupleDesc*, Column_info_t, Duration);
+
+/** get Kind from data */
+char get_Kind(HeapTuple*, TupleDesc*, Column_info_t, char);
+
+/** get Priority from data */
+Priority get_Priority(HeapTuple*, TupleDesc*, Column_info_t, Priority);
+
+/** get Distance from data */
+Distance get_Distance(HeapTuple*, TupleDesc*, Column_info_t, Distance);
+
/** get Amount from data */
Amount get_Amount(HeapTuple*, TupleDesc*, Column_info_t, Amount);
diff --git a/include/c_common/matrixRows_input.h b/include/c_common/matrixRows_input.h
index 5e3169981..2c3c473c0 100644
--- a/include/c_common/matrixRows_input.h
+++ b/include/c_common/matrixRows_input.h
@@ -42,4 +42,10 @@ void get_matrixRows_plain(
Matrix_cell_t **rows,
size_t *total_rows);
+/** @brief Get the travel time matrix of vroom with integer types*/
+void get_matrixRows_vroom_plain(
+ char *sql,
+ Matrix_cell_t **rows,
+ size_t *total_rows);
+
#endif // INCLUDE_C_COMMON_MATRIXROWS_INPUT_H_
diff --git a/include/c_common/vroom/breaks_input.h b/include/c_common/vroom/breaks_input.h
new file mode 100644
index 000000000..9ced90937
--- /dev/null
+++ b/include/c_common/vroom/breaks_input.h
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+File: breaks_input.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
+#ifndef INCLUDE_C_COMMON_VROOM_BREAKS_INPUT_H_
+#define INCLUDE_C_COMMON_VROOM_BREAKS_INPUT_H_
+#pragma once
+
+#include
+
+#include "c_common/get_check_data.h"
+#include "c_types/column_info_t.h"
+#include "c_types/vroom/vroom_break_t.h"
+
+#ifdef PROFILE
+#include "c_common/debug_macro.h"
+#include "c_common/time_msg.h"
+#endif
+
+/** @brief Reads the VROOM breaks */
+void
+get_vroom_breaks(
+ char *breaks_sql,
+ Vroom_break_t **breaks,
+ size_t *total_breaks);
+
+#endif // INCLUDE_C_COMMON_VROOM_BREAKS_INPUT_H_
diff --git a/include/c_common/vroom/jobs_input.h b/include/c_common/vroom/jobs_input.h
new file mode 100644
index 000000000..8cc5a51ac
--- /dev/null
+++ b/include/c_common/vroom/jobs_input.h
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+File: jobs_input.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
+#ifndef INCLUDE_C_COMMON_VROOM_JOBS_INPUT_H_
+#define INCLUDE_C_COMMON_VROOM_JOBS_INPUT_H_
+#pragma once
+
+#include
+
+#include "c_common/get_check_data.h"
+#include "c_types/column_info_t.h"
+#include "c_types/vroom/vroom_job_t.h"
+
+#ifdef PROFILE
+#include "c_common/debug_macro.h"
+#include "c_common/time_msg.h"
+#endif
+
+/** @brief Reads the VROOM jobs */
+void
+get_vroom_jobs(
+ char *jobs_sql,
+ Vroom_job_t **jobs,
+ size_t *total_jobs);
+
+#endif // INCLUDE_C_COMMON_VROOM_JOBS_INPUT_H_
diff --git a/include/c_common/vroom/shipments_input.h b/include/c_common/vroom/shipments_input.h
new file mode 100644
index 000000000..22bc7fa06
--- /dev/null
+++ b/include/c_common/vroom/shipments_input.h
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+File: shipments_input.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
+#ifndef INCLUDE_C_COMMON_VROOM_SHIPMENTS_INPUT_H_
+#define INCLUDE_C_COMMON_VROOM_SHIPMENTS_INPUT_H_
+#pragma once
+
+#include
+
+#include "c_common/get_check_data.h"
+#include "c_types/column_info_t.h"
+#include "c_types/vroom/vroom_shipment_t.h"
+
+#ifdef PROFILE
+#include "c_common/debug_macro.h"
+#include "c_common/time_msg.h"
+#endif
+
+/** @brief Reads the VROOM shipments */
+void
+get_vroom_shipments(
+ char *shipments_sql,
+ Vroom_shipment_t **shipments,
+ size_t *total_shipments);
+
+#endif // INCLUDE_C_COMMON_VROOM_SHIPMENTS_INPUT_H_
diff --git a/include/c_common/vroom/time_windows_input.h b/include/c_common/vroom/time_windows_input.h
new file mode 100644
index 000000000..a252a0d43
--- /dev/null
+++ b/include/c_common/vroom/time_windows_input.h
@@ -0,0 +1,59 @@
+/*PGR-GNU*****************************************************************
+File: time_windows_input.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
+#ifndef INCLUDE_C_COMMON_VROOM_TIME_WINDOWS_INPUT_H_
+#define INCLUDE_C_COMMON_VROOM_TIME_WINDOWS_INPUT_H_
+#pragma once
+
+#include
+#include
+
+#include "c_common/get_check_data.h"
+#include "c_types/column_info_t.h"
+#include "c_types/vroom/vroom_time_window_t.h"
+
+#ifdef PROFILE
+#include "c_common/debug_macro.h"
+#include "c_common/time_msg.h"
+#endif
+
+/** @brief Reads the VROOM time windows */
+void
+get_vroom_time_windows(
+ char *time_windows_sql,
+ Vroom_time_window_t **time_windows,
+ size_t *total_time_windows);
+
+/** @brief Reads the VROOM shipments time windows */
+void
+get_vroom_shipments_time_windows(
+ char *time_windows_sql,
+ Vroom_time_window_t **time_windows,
+ size_t *total_time_windows);
+
+#endif // INCLUDE_C_COMMON_VROOM_TIME_WINDOWS_INPUT_H_
diff --git a/include/c_common/vroom/vehicles_input.h b/include/c_common/vroom/vehicles_input.h
new file mode 100644
index 000000000..298f2a7c5
--- /dev/null
+++ b/include/c_common/vroom/vehicles_input.h
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+File: vehicles_input.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
+#ifndef INCLUDE_C_COMMON_VROOM_VEHICLES_INPUT_H_
+#define INCLUDE_C_COMMON_VROOM_VEHICLES_INPUT_H_
+#pragma once
+
+#include
+
+#include "c_common/get_check_data.h"
+#include "c_types/column_info_t.h"
+#include "c_types/vroom/vroom_vehicle_t.h"
+
+#ifdef PROFILE
+#include "c_common/debug_macro.h"
+#include "c_common/time_msg.h"
+#endif
+
+/** @brief Reads the VROOM vehicles */
+void
+get_vroom_vehicles(
+ char *vehicles_sql,
+ Vroom_vehicle_t **vehicles,
+ size_t *total_vehicles);
+
+#endif // INCLUDE_C_COMMON_VROOM_VEHICLES_INPUT_H_
diff --git a/include/c_types/column_info_t.h b/include/c_types/column_info_t.h
index 7d6ca522a..571be6b42 100644
--- a/include/c_types/column_info_t.h
+++ b/include/c_types/column_info_t.h
@@ -30,15 +30,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
/* for int64_t */
#ifndef __cplusplus
# include
+# include
#endif
// used for getting the data
typedef
enum {
+ INTEGER,
ANY_INTEGER,
ANY_NUMERICAL,
TEXT,
CHAR1,
+ INTEGER_ARRAY,
ANY_INTEGER_ARRAY,
TIMESTAMP,
INTERVAL
@@ -48,7 +51,7 @@ enum {
typedef
struct {
int colNumber;
- unsigned long type;
+ uint64_t type;
bool strict;
char *name;
expectType eType;
diff --git a/include/c_types/typedefs.h b/include/c_types/typedefs.h
index 6bf1e7c84..9a8117d2c 100644
--- a/include/c_types/typedefs.h
+++ b/include/c_types/typedefs.h
@@ -39,12 +39,24 @@ using Speed = double;
using Multiplier = double;
using Id = int64_t;
using Idx = uint64_t;
+using MatrixIndex = int64_t;
+using Duration = uint32_t;
+using Priority = uint32_t;
+using Distance = uint32_t;
+using Skill = uint32_t;
+using StepType = int32_t;
using PickDeliveryOrders_t = struct PickDeliveryOrders_t;
using Vehicle_t = struct Vehicle_t;
using Matrix_cell_t = struct Matrix_cell_t;
using Time_multipliers_t = struct Time_multipliers_t;
using Solution_rt = struct Solution_rt;
using Short_vehicle_rt = struct Short_vehicle_rt;
+using Vroom_job_t = struct Vroom_job_t;
+using Vroom_shipment_t = struct Vroom_shipment_t;
+using Vroom_vehicle_t = struct Vroom_vehicle_t;
+using Vroom_break_t = struct Vroom_break_t;
+using Vroom_time_window_t = struct Vroom_time_window_t;
+using Vroom_rt = struct Vroom_rt;
/*
* Index on a container
*/
@@ -60,15 +72,27 @@ typedef uint32_t PAmount;
typedef double Speed;
typedef double Multiplier;
typedef int64_t Id;
+typedef uint64_t Idx;
+typedef int64_t MatrixIndex;
+typedef uint32_t Duration;
+typedef uint32_t Priority;
+typedef uint32_t Distance;
+typedef uint32_t Skill;
+typedef int32_t StepType;
typedef struct PickDeliveryOrders_t PickDeliveryOrders_t;
typedef struct Vehicle_t Vehicle_t;
typedef struct Matrix_cell_t Matrix_cell_t;
typedef struct Time_multipliers_t Time_multipliers_t;
typedef struct Solution_rt Solution_rt;
typedef struct Short_vehicle_rt Short_vehicle_rt;
+typedef struct Vroom_job_t Vroom_job_t;
+typedef struct Vroom_shipment_t Vroom_shipment_t;
+typedef struct Vroom_vehicle_t Vroom_vehicle_t;
+typedef struct Vroom_break_t Vroom_break_t;
+typedef struct Vroom_time_window_t Vroom_time_window_t;
+typedef struct Vroom_rt Vroom_rt;
#endif
-
/*************************************************************************/
#endif // INCLUDE_C_TYPES_TYPEDEFS_H_
diff --git a/include/c_types/vroom/vroom_break_t.h b/include/c_types/vroom/vroom_break_t.h
new file mode 100644
index 000000000..4246837ea
--- /dev/null
+++ b/include/c_types/vroom/vroom_break_t.h
@@ -0,0 +1,52 @@
+/*PGR-GNU*****************************************************************
+File: vroom_break_t.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+/*! @file */
+
+#ifndef INCLUDE_C_TYPES_VROOM_VROOM_BREAK_T_H_
+#define INCLUDE_C_TYPES_VROOM_VROOM_BREAK_T_H_
+#pragma once
+
+#include "c_types/typedefs.h"
+
+/** @brief Vehicle's break attributes
+
+@note C/C++/postgreSQL connecting structure for input
+name | description
+:----- | :-------
+id | Identifier of break
+vehicle_id | Identifier of vehicle
+service | Duration of break
+*/
+struct Vroom_break_t {
+ Idx id; /** Identifier of break */
+ Idx vehicle_id; /** Identifier of vehicle */
+ Duration service; /** Duration of break */
+};
+
+
+#endif // INCLUDE_C_TYPES_VROOM_VROOM_BREAK_T_H_
diff --git a/include/c_types/vroom/vroom_job_t.h b/include/c_types/vroom/vroom_job_t.h
new file mode 100644
index 000000000..76e3af6b5
--- /dev/null
+++ b/include/c_types/vroom/vroom_job_t.h
@@ -0,0 +1,70 @@
+/*PGR-GNU*****************************************************************
+File: vroom_job_t.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+/*! @file */
+
+#ifndef INCLUDE_C_TYPES_VROOM_VROOM_JOB_T_H_
+#define INCLUDE_C_TYPES_VROOM_VROOM_JOB_T_H_
+#pragma once
+
+#include "c_types/typedefs.h"
+
+/** @brief Job's attributes
+
+@note C/C++/postgreSQL connecting structure for input
+name | description
+:----- | :-------
+id | The job's identifier
+location_index | Location index of job in matrix
+service | Job service duration
+delivery | Quantities for delivery
+delivery_size | Number of delivery quantities
+pickup | Quantities for pickup
+pickup_size | Number of pickup quantities
+skills | Mandatory skills
+skills_size | Number of mandatory skills
+priority | Priority level of job
+*/
+struct Vroom_job_t {
+ Idx id; /** The job's identifier */
+ MatrixIndex location_index; /** Location index of job in matrix */
+
+ Duration service; /** Job service duration */
+
+ Amount *delivery; /** Quantities for delivery */
+ size_t delivery_size; /** Number of delivery quantities */
+
+ Amount *pickup; /** Quantities for pickup */
+ size_t pickup_size; /** Number of pickup quantities */
+
+ Skill *skills; /** Mandatory skills */
+ size_t skills_size; /** Number of mandatory skills */
+
+ Priority priority; /** Priority level of job */
+};
+
+#endif // INCLUDE_C_TYPES_VROOM_VROOM_JOB_T_H_
diff --git a/include/c_types/vroom/vroom_rt.h b/include/c_types/vroom/vroom_rt.h
new file mode 100644
index 000000000..d5961fa55
--- /dev/null
+++ b/include/c_types/vroom/vroom_rt.h
@@ -0,0 +1,66 @@
+/*PGR-GNU*****************************************************************
+File: vroom_rt.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+/*! @file */
+
+#ifndef INCLUDE_C_TYPES_VROOM_VROOM_RT_H_
+#define INCLUDE_C_TYPES_VROOM_VROOM_RT_H_
+#pragma once
+
+#include "c_types/typedefs.h"
+
+/** @brief Solution's attributes
+
+@note C/C++/postgreSQL connecting structure for input
+name | description
+:----- | :-------
+vehicle_seq | Sequence for ordering a single vehicle
+vehicle_id | The vehicle's identifier
+step_seq | Step sequence of the vehicle
+step_type | Step sequence of the vehicle
+task_id | The task's identifier
+arrival_time | Estimated time of arrival
+travel_time | Cumulated travel time upon arrival
+service_time | Service time at this step
+waiting_time | Waiting time upon arrival at this step
+load | Vehicle load after step completion
+*/
+struct Vroom_rt {
+ Idx vehicle_seq; /** Sequence for ordering a single vehicle */
+ Idx vehicle_id; /** The vehicle's identifier */
+ Idx step_seq; /** Step sequence of the vehicle */
+ StepType step_type; /** Type of the step */
+ Id task_id; /** The task's identifier */
+ Duration arrival_time; /** Estimated time of arrival */
+ Duration travel_time; /** Cumulated travel time upon arrival */
+ Duration service_time; /** Service time at this step */
+ Duration waiting_time; /** Waiting time upon arrival at this step */
+ Amount *load; /** Vehicle's load after step completion array */
+ size_t load_size; /** Vehicle's load array size */
+};
+
+#endif // INCLUDE_C_TYPES_VROOM_VROOM_RT_H_
diff --git a/include/c_types/vroom/vroom_shipment_t.h b/include/c_types/vroom/vroom_shipment_t.h
new file mode 100644
index 000000000..ed61b60c4
--- /dev/null
+++ b/include/c_types/vroom/vroom_shipment_t.h
@@ -0,0 +1,72 @@
+/*PGR-GNU*****************************************************************
+File: vroom_shipment_t.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+/*! @file */
+
+#ifndef INCLUDE_C_TYPES_VROOM_VROOM_SHIPMENT_T_H_
+#define INCLUDE_C_TYPES_VROOM_VROOM_SHIPMENT_T_H_
+#pragma once
+
+#include "c_types/typedefs.h"
+
+/** @brief Vehicles's attributes
+
+@note C/C++/postgreSQL connecting structure for input
+name | description
+:----- | :-------
+id | Shipment identifier
+p_location_index | Pickup location index in matrix
+p_service | Pickup service time
+d_location_index | Delivery location index in matrix
+d_service | Delivery service time
+amount | Quantities for shipment
+amount_size | Number of quantities
+skills | Mandatory skills
+skills_size | Number of skills
+priority | Priority level of shipment
+*/
+struct Vroom_shipment_t {
+ Idx id; /** Shipment identifier */
+
+ /** pickup shipment */
+ MatrixIndex p_location_index; /** Pickup location index in matrix */
+ Duration p_service; /** Pickup service time */
+
+ /** delivery shipment */
+ MatrixIndex d_location_index; /** Delivery location index in matrix */
+ Duration d_service; /** Delivery service time */
+
+ Amount *amount; /** Quantities for shipment */
+ size_t amount_size; /** Number of quantities */
+
+ Skill *skills; /** Mandatory skills */
+ size_t skills_size; /** Number of skills */
+
+ Priority priority; /** Priority level of shipment */
+};
+
+#endif // INCLUDE_C_TYPES_VROOM_VROOM_SHIPMENT_T_H_
diff --git a/include/c_types/vroom/vroom_time_window_t.h b/include/c_types/vroom/vroom_time_window_t.h
new file mode 100644
index 000000000..99e7dd86b
--- /dev/null
+++ b/include/c_types/vroom/vroom_time_window_t.h
@@ -0,0 +1,53 @@
+/*PGR-GNU*****************************************************************
+File: vroom_time_window_t.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+/*! @file */
+
+#ifndef INCLUDE_C_TYPES_VROOM_VROOM_TIME_WINDOW_T_H_
+#define INCLUDE_C_TYPES_VROOM_VROOM_TIME_WINDOW_T_H_
+#pragma once
+
+#include "c_types/typedefs.h"
+
+/** @brief Time window's attributes
+
+@note C/C++/postgreSQL connecting structure for input
+name | description
+:----- | :-------
+id | Identifier of the job/shipment/break
+kind | Whether the shipment is a pickup ('p') or a delivery ('d')
+start_time | Time window start time
+end_time | Time window end time
+*/
+struct Vroom_time_window_t {
+ Idx id;
+ char kind;
+ Duration start_time;
+ Duration end_time;
+};
+
+#endif // INCLUDE_C_TYPES_VROOM_VROOM_TIME_WINDOW_T_H_
diff --git a/include/c_types/vroom/vroom_vehicle_t.h b/include/c_types/vroom/vroom_vehicle_t.h
new file mode 100644
index 000000000..4231297e3
--- /dev/null
+++ b/include/c_types/vroom/vroom_vehicle_t.h
@@ -0,0 +1,70 @@
+/*PGR-GNU*****************************************************************
+File: vroom_vehicle_t.h
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+/*! @file */
+
+#ifndef INCLUDE_C_TYPES_VROOM_VROOM_VEHICLE_T_H_
+#define INCLUDE_C_TYPES_VROOM_VROOM_VEHICLE_T_H_
+#pragma once
+
+#include "c_types/typedefs.h"
+
+/** @brief Vehicles's attributes
+
+@note C/C++/postgreSQL connecting structure for input
+name | description
+:----- | :-------
+id | The vehicle's identifier
+start_index | Start location index in matrix
+end_index | End location index in matrix
+capacity | Vehicle's capacity array
+capacity_size | Vehicle's capacity array size
+skills | Vehicle's skills
+skills_size | Number of vehicle's skills
+time_window_start | Time window start time
+time_window_end | Time window end time
+speed_factor | Vehicle travel time multiplier
+*/
+struct Vroom_vehicle_t {
+ Idx id; /** The vehicle's identifier */
+ MatrixIndex start_index; /** Start location index in matrix */
+ MatrixIndex end_index; /** End location index in matrix */
+
+ Amount *capacity; /** Vehicle's capacity array */
+ size_t capacity_size; /** Vehicle's capacity array size */
+
+ Skill *skills; /** Vehicle's skills */
+ size_t skills_size; /** Number of vehicle's skills */
+
+ Duration time_window_start; /** Time window start time */
+ Duration time_window_end; /** Time window end time */
+
+ double speed_factor; /** Vehicle travel time multiplier */
+};
+
+
+#endif // INCLUDE_C_TYPES_VROOM_VROOM_VEHICLE_T_H_
diff --git a/include/cpp_common/base_matrix.h b/include/cpp_common/base_matrix.h
index 0d47ece23..16be2d7cf 100644
--- a/include/cpp_common/base_matrix.h
+++ b/include/cpp_common/base_matrix.h
@@ -38,6 +38,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "c_types/typedefs.h"
#include "cpp_common/identifiers.hpp"
+#include "structures/generic/matrix.h"
+
typedef struct Matrix_cell_t Matrix_cell_t;
namespace vrprouting {
@@ -62,6 +64,7 @@ class Base_Matrix {
Base_Matrix() = default;
/** @brief Constructs a matrix for only specific identifiers */
Base_Matrix(Matrix_cell_t *, size_t, const Identifiers&, Multiplier);
+ Base_Matrix(Matrix_cell_t *, size_t, const Identifiers &);
explicit Base_Matrix(const std::map, Id> &, Multiplier);
/** @name status of the matrix
@@ -70,6 +73,8 @@ class Base_Matrix {
/** @brief does the matrix values not given by the user? */
bool has_no_infinity() const;
+ vroom::Matrix get_vroom_matrix() const;
+
/** @brief does the matrix obeys the triangle inequality? */
bool obeys_triangle_inequality() const;
size_t fix_triangle_inequality(size_t depth = 0);
diff --git a/include/cpp_common/vrp_vroom_problem.hpp b/include/cpp_common/vrp_vroom_problem.hpp
new file mode 100644
index 000000000..be9309bb1
--- /dev/null
+++ b/include/cpp_common/vrp_vroom_problem.hpp
@@ -0,0 +1,533 @@
+/*PGR-GNU*****************************************************************
+File: vrp_vroom_problem.hpp
+
+Copyright (c) 2021 pgRouting developers
+Mail: project@pgrouting.org
+
+Function's developer:
+Copyright (c) 2021 Ashish Kumar
+Mail: ashishkr23438@gmail.com
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
+#ifndef INCLUDE_CPP_COMMON_VRP_VROOM_PROBLEM_HPP_
+#define INCLUDE_CPP_COMMON_VRP_VROOM_PROBLEM_HPP_
+#pragma once
+
+#include
+#include
+#include