Skip to main content

or-problems formulated as gym environments to solve logisitcal-problems

Project description

License: MIT Tests Workflow PyPI version

Logo LogoBlack

Introduction

Logistics-OR-gym is a "collection" of Open AI Gym environments ment to simualte logistical problems such as routing, container filling and supply chain

Install

You can install the envs using pypi

pip install logistics-or-gym

Python versions supported are: >=3.10 <3.12

Available Environments

Routing

Heterogeneous Capacitated Vehicle Routing Problem (HCVRP)

HCVRP simulates routing problems when the number of vehicles is >=1 (This means it also covers the case for CVRP if only that is needed) and different speeds. This implementation follows the one from:

@article{Li2021,
   abstract = {Existing deep reinforcement learning (DRL) based methods for solving the capacitated vehicle routing problem (CVRP) intrinsically cope with homogeneous vehicle fleet, in which the fleet is assumed as repetitions of a single vehicle. Hence, their key to construct a solution solely lies in the selection of the next node (customer) to visit excluding the selection of vehicle. However, vehicles in real-world scenarios are likely to be heterogeneous with different characteristics that affect their capacity (or travel speed), rendering existing DRL methods less effective. In this paper, we tackle heterogeneous CVRP (HCVRP), where vehicles are mainly characterized by different capacities. We consider both min-max and min-sum objectives for HCVRP, which aim to minimize the longest or total travel time of the vehicle(s) in the fleet. To solve those problems, we propose a DRL method based on the attention mechanism with a vehicle selection decoder accounting for the heterogeneous fleet constraint and a node selection decoder accounting for the route construction, which learns to construct a solution by automatically selecting both a vehicle and a node for this vehicle at each step. Experimental results based on randomly generated instances show that, with desirable generalization to various problem sizes, our method outperforms the state-of-the-art DRL method and most of the conventional heuristics, and also delivers competitive performance against the state-of-the-art heuristic method, i.e., SISR. Additionally, the results of extended experiments demonstrate that our method is also able to solve CVRPLib instances with satisfactory performance.},
   author = {Jingwen Li and Yining Ma and Ruize Gao and Zhiguang Cao and Andrew Lim and Wen Song and Jie Zhang},
   doi = {10.1109/TCYB.2021.3111082},
   journal = {IEEE Transactions on Cybernetics},
   keywords = {Computer architecture,Decoding,Deep reinforcement learning (DRL),Optimization,Reinforcement learning,Routing,Search problems,Vehicle routing,heterogeneous CVRP (HCVRP),min-max objective,min-sum objective.},
   month = {10},
   publisher = {Institute of Electrical and Electronics Engineers Inc.},
   title = {Deep Reinforcement Learning for Solving the Heterogeneous Capacitated Vehicle Routing Problem},
   url = {http://arxiv.org/abs/2110.02629 http://dx.doi.org/10.1109/TCYB.2021.3111082},
   year = {2021},
}

To use the environment simply use the gym library to create it:

import gymnasium as gym
gym.make("hcvrp-v0")

The arguments you can pass are:

n_vehicles=3, 
n_nodes=50

There will be more arguments later. All fields are public so in the meantime just rewrite the properties

TODO

  • HCVRP
  • Container filling (3D binpacking)
  • Dynamic HCVRP (For delivery)
  • Supply Chain Management (Not yet decided on which ones)

Credit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logistics_or_gym-0.5.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logistics_or_gym-0.5.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file logistics_or_gym-0.5.0.tar.gz.

File metadata

  • Download URL: logistics_or_gym-0.5.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1012-azure

File hashes

Hashes for logistics_or_gym-0.5.0.tar.gz
Algorithm Hash digest
SHA256 88a8c54873b15f0ccc011085f348b906eb2e528aac35d31c495929c1ee543c14
MD5 88d9ea5f4da7f744fb6119a60e3ce728
BLAKE2b-256 c85e78b8a6c5e3d51e492d1350e2584ccea892cf244d373216aaf90324ae133c

See more details on using hashes here.

File details

Details for the file logistics_or_gym-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: logistics_or_gym-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1012-azure

File hashes

Hashes for logistics_or_gym-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb8f1db1ff582526c5e6cd68459a75b6cc7c09b149c6533e59a5c4801eb0054
MD5 c19b00e207bd25b40f2e5b405af69612
BLAKE2b-256 0e36ce8b7705d0aa96373183f3154d011d8422189b0866ee4725a02b78f12e5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page