Skip to content

jeongseongwon99/cs470_project

 
 

Repository files navigation

[CS470 Team 23] School Bus Routing Problem with Attention Model

We use attention model to solve SBRP considering number of routes. Taking number of routes (reprensenting the bus on SBRP) into account, we trained our own model instance with new objective function.

Our implementatin is mainly on the problems/vrp/problem_vrp.py and the class CVRP_BUS inside it. We also implement more real-world like validation data generation on generate_data_cvrp_bus.py. Our train result is on team23_model directory which are used on result_team23.ipynb (for epoch 99).

TITLE EXAMPLE

Paper

Most of code implementation is based on the source code from repository of the paper Attention, Learn to Solve Routing Problems! which has been accepted at ICLR 2019

Usage

Generating data

Training data is generated on the fly. To generate validation as used in result_team23.ipynb

python generate_data_cvrp_bus.py -f --graph_sizes 20 

Generated data will be saved as data/cvrp_bus/cvrp_bus20_validation_seed1234.pkl

Training

For training our model instance with new objective function:

python run.py --problem 'cvrp_bus'  --graph_size 20 --baseline rollout --run_name 'cvrp_bus_20_rollout'

The output will be saved on outputs/cvrp_bus_20 directory.

Evaluation of the model and Visualization

See result_team23.ipynb for an example of loading a pretrained model and plotting the result for Capacitated VRP with 20 nodes. We compared our model with new objective function and previous pretrained model with naive distance objective on this jupyter notebook with 10000 validation data.

Below is the one of the comparisons. You can check the result_team23.ipynb for more cases. comparison_example

Other options and help

python run.py -h
python eval.py -h

Acknowledgements

Thanks to wouterkool/attention-learn-to-route for making us to reproduce our product.

About

attention_routing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 98.5%
  • Python 1.4%
  • Other 0.1%