/optaweb-traveling-salesman

Web application solving the traveling salesman problem using OptaPlanner

Primary LanguageJava

OptaWeb Vehicle Routing

Build Status

Web application for solving the Vehicle Routing Problem using OptaPlanner.

Running the Application

First, clone this repository and cd into it.

Frontend and backend are built and run independently. Open two terminal windows.

Run Frontend

  1. Install npm. If you’re on Fedora, you can do this by running:

    sudo dnf install npm
  2. Install dependencies.

    cd optaweb-tsp-ui
    npm install
  3. Run frontend.

    npm start
  4. Open http://localhost:3000/

Tip
Prevent npm start from launching your default browser

If you don’t want npm start to open a new browser tab each time you run it, export an environment variable BROWSER=none.

You can use .env.local file to make this preference permanent. To do that, run

echo BROWSER=none >> .env.local

Run Backend

JDK 8 is the only system prerequisite. To install OpenJDK 8 on Fedora, run:

sudo dnf install java-1.8.0-openjdk-devel
  1. Download OpenStreetMap data for Belgium from Geofabrik.

    1. Open http://download.geofabrik.de/europe/belgium.html.

    2. Download the OSM file belgium-latest.osm.pbf.

    3. Save it to optaweb-vehicle-routing/optaweb-vehicle-routing-backend/local/openstreetmap/belgium-latest.osm.pbf.

  2. Run backend.

    cd optaweb-vehicle-routing-backend
    ./mvnw spring-boot:run

See Backend Development Guide to learn how to run backend during development.

Tip
Use a different OSM file

If you want to try a different region than Belgium, download an OSM file from Geofabrik and use a system property when starting the backend to change the data file:

./mvnw spring-boot:run -Dosmfile=massachusetts-latest.osm.pbf
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.