ai4co / rl4co

A PyTorch library for all things Reinforcement Learning (RL) for Combinatorial Optimization (CO)
https://rl4.co
MIT License
381 stars 70 forks source link

[Enhancement, Minor] Fix the `visited` shape of CVRP #172

Closed cbhua closed 4 months ago

cbhua commented 4 months ago

Description

In CVRP and CVRPTW, previously the size of visited is [batch_size, 1, num_node]. Now the size of visited is changed to [batch_size, num_node].

Motivation and Context

All other environments use the size of visited with [batch_size, num_node]. Change the CVRP and CVRPTW's for the consequence.

Also, the previous size [batch_size, 1, num_node] introduced a few expanding and squeezing operations, which are a bit massive and hard to read. Using the size of [batch_size, num_node] could make the code clean.

Types of changes

Checklist