Code Monkey home page Code Monkey logo

ddo-caching's Introduction

ddo-caching

This repository contains the implementation of a generic branch-and-bound algorithm based on decision diagrams. All the code related to the classical algorithm was written by xgillard who created the DDO solver. New pruning techniques based on caching detailed in an article under review were implemented in src/mdd/with_barrier.rs and src/solver/barrier.rs.

Important: This code concerns an experimental feature which is now integrated to the main DDO project, which is actively maintained and developed. Please go there if you would like to get a more recent version or would like support.

Description

The goal of this software is to demonstrate the effect of caching inside a generic decision diagram-based branch-and-bound solver.

Requirements

You need Rust and Cargo to compile the project. Follow the instructions here to get them on your machine.

Usage

For the best performance, compile the project in release mode with:

cargo build --release --all-targets

This will create executables in the target/release/examples folder for each problem specified in the examples folder.

If you want to learn how to solve a TSPTW (Traveling Salesman Problem with Time Windows) instance, you can then type:

./target/release/examples/tsptw solve --help

which will output:

USAGE:
    tsptw solve [OPTIONS] --file <file>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --cutset <cutset>       [default: lel]
    -f, --file <file>          
    -s, --solver <solver>       [default: parallel]
    -T, --threads <threads>    
    -t, --timeout <timeout>     [default: 60]
    -w, --width <width> 

The parameters are the following:

  • solver: The available solvers are parallel and barrier. They both implement the branch-and-bound algorithm based on decision diagrams but barrier features more pruning techniques.
  • cutset: The lel and frontier cutsets are implemented for both algorithms.
  • width: There is a different width strategy for each problem implemented in the examples folder. You can use this parameter as a multiplying factor of the width strategy.
  • timeout: The maximum time allowed for the algorithm, in seconds.
  • threads: The number of threads to use. Disclaimer: the barrier solver is not yet optimized for multi-threading.
  • file: The path to the instance to solve.

The following command runs the branch-and-bound algorithm with barrier and with a frontier cutset on the instance AFG/rbg010a.tw on a single thread:

./target/release/examples/tsptw solve --solver barrier --cutset frontier --threads 1 --file resources/tsptw/AFG/rbg010a.tw

Three different problems are available in the examples folder:

  • Traveling Salesman with Time Windows: tsptw
  • Pigment Sequencing Problem: psp
  • Single-Row Facility Layout Problem: srflp

Each with benchmark instances in the resources folder.

Results

The results reported in the paper are obtained by running DDO with and without caching (respectively barrier and parallel) on a single thread with three different values for the width factor α (1, 10 and 100) on each instance of the three problems. They are summarized in the file results.csv and visualized by several figures in the paper. Figure 7 shows the cumulative number of instances solved through time by each configuration and for each problem. A significant improvement is observed when using caching (B&B+C) compared the classical algorithm (B&B).

Figure 7

Ongoing Development

The techniques presented in the article are now integrated into the main DDO project, which is actively maintained unlike this repository which exists for archival purposes.

References

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.