Web application for solving the Vehicle Routing Problem using OptaPlanner.
First, clone this repository and cd
into it.
Frontend and backend are built and run independently. Open two terminal windows.
-
Install
npm
. If you’re on Fedora, you can do this by running:sudo dnf install npm
-
Install dependencies:
cd optaweb-vehicle-routing-frontend npm install
-
Run frontend:
npm start
Tip
|
Prevent
npm start from launching your default browserIf you don’t want You can use echo BROWSER=none >> .env.local |
JDK 8 is the only system prerequisite. To install OpenJDK 8 on Fedora, run:
sudo dnf install java-1.8.0-openjdk-devel
-
Download OpenStreetMap data for Belgium from Geofabrik:
-
Download the OSM file belgium-latest.osm.pbf.
-
Save it to
optaweb-vehicle-routing/optaweb-vehicle-routing-backend/local/openstreetmap/belgium-latest.osm.pbf
.
-
Build backend:
cd optaweb-vehicle-routing-backend ./mvnw install
-
Run backend:
java -jar target/optaweb-vehicle-routing-backend-*.jar
See Backend Development Guide to learn how to run backend during development.
If you want to try a different region than Belgium, download an OSM file from
Geofabrik
and select it with app.routing.osm-file
property when starting the backend.
Don’t forget to use app.region.country-codes
property to override geosearch results constraint.
There is currently only one out-of-the-box data set for Belgium so the Load demo button won’t work with other regions.
java -jar target/optaweb-vehicle-routing-backend-*.jar \
--app.routing.osm-file=massachusetts-latest.osm.pbf \
--app.region.country-codes=US
Caution
|
Using large OSM files
For best user experience it is recommended to use smaller regions like individual European or US states. Using OSM files larger than 1 GB will require significant RAM size and take a lot of time (up to several hours) for the initial processing. |
There is a built-in demo data set consisting of a several large Belgian cities. If you want to have more demos offered by the Load demo dropdown, you can prepare your own data sets. To do that, follow these steps:
-
Add a depot and a set of visits by clicking on the map or using geosearch.
-
Click Export and save the file in
optaweb-vehicle-routing-backend/local/data
directory. -
Edit the YAML file and choose a unique name for the data set.
-
Restart the backend.
After you restart the backend, files in the data
directory will be made available
in the Load demo dropdown.