Giter VIP home page Giter VIP logo

vrp-1's Introduction

crates.io build codecov

VRP example

Description

This project provides the way to solve multiple variations of Vehicle Routing Problem known as rich VRP. It provides default metaheuristic implementation which can be roughly described as Multi-objective Parthenogenesis based Evolutionary Algorithm with Ruin and Recreate Mutation Operator.

Design goal

Although performance is constantly in focus, the main idea behind design is extensibility: the project aims to support a wide range of VRP variations known as Rich VRP. This is achieved through various extension points: custom constraints, objective functions, acceptance criteria, etc.

Getting started

For general installation steps and basic usage options, please check next sections. More detailed overview of features is presented in A Vehicle Routing Problem Solver Documentation.

Installation

You can install vrp solver using three different ways:

Install from Docker

The fastest way to get vrp solver on your environment is to use docker image:

  • run public image from Github Container Registry:
    docker run -it -v $(pwd):/repo --name vrp-cli --rm ghcr.io/reinterpretcat/vrp/vrp-cli:1.7.2
  • build image locally using Dockerfile provided:
docker build -t vrp_solver .
docker run -it -v $(pwd):/repo --rm vrp_solver

Please note that the docker image is built using musl, not glibc standard library. So there might be some performance implications.

Install from Cargo

You can install vrp solver cli tool directly with cargo install:

cargo install vrp-cli

Ensure that your $PATH is properly configured to source the crates binaries, and then run solver using the vrp-cli command.

Install from source

Once pulled the source code, you can build it using cargo:

cargo build --release

Built binaries can be found in the ./target/release directory.

Alternatively, you can try to run the following script from the project root:

./solve_problem.sh examples/data/pragmatic/objectives/berlin.default.problem.json

It will build the executable and automatically launch the solver with the specified VRP definition. Results are stored in the folder where a problem definition is located.

Usage

Use can use vrp solver either from command line or from code:

Use from command line

vrp-cli crate is designed to use on problems defined in scientific or custom json (aka pragmatic) format:

vrp-cli solve pragmatic problem_definition.json -m routing_matrix.json --max-time=120

Please refer to getting started section in the documentation for more details.

Use from code

If you're using rust, then you can simply use vrp-scientific, vrp-pragmatic crates to solve VRP problem defined in pragmatic or scientific format using default metaheuristic. For more complex scenarios, please refer to vrp-core documentation.

If you're using some other language, e.g java, kotlin, javascript, python, please check interop section in documentation examples to see how to call the library from it.

Project structure

The project consists of the following parts:

  • vrp solver code: the source code of the solver is split into four crates:
    • vrp-core: a core crate with various metaheuristic building blocks and its default implementation
    • vrp-scientific: a crate with functionality to solve problems from some of scientific benchmarks on top of the core crate
    • vrp-pragmatic: a crate which provides logic to solve rich VRP using pragmatic json format on top of the core crate
    • vrp-cli: a crate which aggregates logic of others crates and exposes them as a library and application
  • docs: a source code of the user guide documentation published here. Use mdbook tool to build it locally.
  • examples: provides various examples:
    • data: a data examples such as problem definition, configuration, etc.
    • json-pragmatic: an example how to solve problem in pragmatic json format from rust code using the project crates
    • jvm-interop: a gradle project which demonstrates how to use the library from java and kotlin

Status

Experimental.

vrp-1's People

Contributors

reinterpretcat avatar andrewgy8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.