pgRouting / vrprouting

Vehicle Routing Problems on the Database
GNU General Public License v2.0
20 stars 6 forks source link

GSoC' 22: Detailed description and signature of the new OR-Tools Bin Packing category functions to be added in vrpRouting #41

Closed Manas23601 closed 2 years ago

Manas23601 commented 2 years ago

Description

Google OR-Tools is an open-source software suite that can solve optimization problems such as:

OR-Tools Bin Packing Category Functions:

  1. vrp_knapsack
    
    vrp_knapsack(
    Weights_Costs SQL, capacity ANY-INTEGER, [, max_rows])

RETURNS SET OF (item_id)

2. `vrp_multiple_knapsack`

vrp_multiple_knapsack( Weights_Costs SQL, capacities ARRAY[ANY-INTEGER], [, max_rows])

RETURNS SET OF (knapsack_number, item_id)

3. `vrp_bin_packing`

vrp_bin_packing( Weights SQL, bin_capacity ANY-INTEGER, [, max_rows])

RETURNS SET OF (bin_number, item_id)


## Parameters:
1. `vrp_knapsack`  

Parameter | Type | Description
-------------- | ------- | ---------------
**Weights_Cost SQL** | ``TEXT`` |  **Weights_Cost SQL** query describing the weight and cost of each item
**Capacity** | ``ANY-INTEGER`` |  Maximum Capacity of the knapsack
**max_rows** | ``ANY-INTEGER`` |  Maximum items(rows) to fetch from bin_packing_data table. Default = 100000

2. `vrp_multiple_knapsack`

Parameter | Type | Description
-------------- | ------- | ---------------
**Weights_Cost SQL** | ``TEXT`` |  **Weights_Cost SQL** query describing the weight and cost of each item
**Capacities** | ``ARRAY[ANY-INTEGER]`` |  An Array describing maximum capacity of each knapsack
**max_rows** | ``ANY-INTEGER`` |  Maximum items(rows) to fetch from bin_packing_data table. Default = 100000

3. `vrp_bin_packing`

Parameter | Type | Description
-------------- | ------- | ---------------
**Weights SQL** | ``TEXT`` |  **Weights_Cost SQL** query describing the weight of each item
**Bin_Capacity** | ``ANY-INTEGER`` |  Maximum Capacity of Bin.
**max_rows** | ``ANY-INTEGER`` |  Maximum items(rows) to fetch from bin_packing_data table. Default = 100000

## Inner Query:

### **Weights_Cost SQL**

Column | Type | Default | Description
---------- | ------- | --------- | ----------------
**id** | ``ANY-INTEGER`` | | unique Identifier of the edge
**weight** | ``ANY-INTEGER`` | | weight of the item
**cost** | ``ANY-INTEGER`` | | cost of the item

### **Weights SQL**

Column | Type | Default | Description
---------- | ------- | --------- | ----------------
**id** | ``ANY-INTEGER`` | | unique Identifier of the edge
**weight** | ``ANY-INTEGER`` | | weight of the item

Where:
``ANY-INTEGER``  =  SMALLINT, INTEGER, BIGINT
``ANY-NUMERICAL``  =  SMALLINT, INTEGER, BIGINT, REAL, FLOAT

## Result Columns:
1. `vrp_knapsack`

Column | Type | Description
---------- | ------- | --------------
**item_id** | ``ANY-INTEGER`` |  Integer to identify an item.

2. `vrp_multiple_knapsack`

Column | Type | Description
---------- | ------- | --------------
**item_id** | ``ANY-INTEGER`` |  Integer to identify an item.
**knapsack_number** | ``ANY-INTEGER`` |  Integer to identify knapsack.

3. `vrp_bin_packing`

Column | Type | Description
---------- | ------- | --------------
**item_id** | ``ANY-INTEGER`` |  Integer to identify an item.
**bin_number** | ``ANY-INTEGER`` |  Integer to identify bin.
cvvergara commented 2 years ago

Work done on #40