GithubHelp home page GithubHelp logo

sgbs's Introduction

Simulation-Guided Beam Search for Neural Combinatorial Optimization

This repository is the official implementation of Simulation-Guided Beam Search for Neural Combinatorial Optimization (NeurIPS 2022).

https://arxiv.org/abs/2207.06190

sgbs_3steps


Inference with SGBS/SGBS+EAS method

๐Ÿ“‹ TSP

SGBS

cd ./TSP/2_SGBS  
python3 test.py

SGBS+EAS

cd ./TSP/3_SGBS+EAS  
python3 test.py

๐Ÿ“‹ CVRP

SGBS

cd ./CVRP/2_SGBS  
python3 test.py

SGBS+EAS

cd ./CVRP/3_SGBS+EAS  
python3 test.py

๐Ÿ“‹ FFSP

To run SGBS and SGBS+EAS for FFSP, you have to download and unpack FFSP.tar.gz first.
See Requirements - FFSP trained model & dataset section.

SGBS

cd ./FFSP/2_SGBS  
python3 test_ffsp20.py
python3 test_ffsp50.py
python3 test_ffsp100.py

SGBS+EAS

cd ./FFSP/3_SGBS+EAS  
python3 test_ffsp20.py
python3 test_ffsp50.py
python3 test_ffsp100.py

Inference with Greedy, Sampling, Beam Search, MCTS or SGBS method for CVRP

cd ./CVRP/2_SGBS  
python3 test.py -disable_aug --mode greedy
python3 test.py -disable_aug --mode sampling
python3 test.py -disable_aug --mode obs
python3 test.py -disable_aug --mode mcts
python3 test.py -disable_aug --mode sgbs

-disable_aug: disables instance augmentation
--mode: specifies inference method, (obs means original beam search method)

If you want test small number of test episodes, you can use --ep option. For example, if you want test just 10 episodes with greedy method,

python3 test.py -disable_aug --mode greedy --ep 10

Note: MCTS takes a lot of time compared to other methods.


Requirements - FFSP trained model & dataset

Download FFSP trained model and dataset file from https://drive.google.com/file/d/1TdkeErG1FCUMxoe8ENpxiWwUopPIUikb/view?usp=sharing.
Move FFSP.tar.gz into your root folder and unpack it.

tar -xvzf FFSP.tar.gz

Language and Libraries

python 3.8.6
torch 1.11.0

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.