Download presentation
Presentation is loading. Please wait.
Published byDarcy Griffin Modified over 9 years ago
1
Generalized BPP Guido Perboli (guido.perboli@polito.it) DAUIN - Politecnico di Torino
2
2 Generalized BPP Problem Set of items Volume v i Set of bins Maximum loadable volume V j Cost c j Use the mix of containers of minimum cost All the items are loaded For each used bin, the volume of the items is at most the maximum loadable volume
3
3 Generalized BPP Formulation
4
4 Generalized BPP LB for GBPP Consider to continuously load the items Choose the bins such that the volume of the bins is at least the total volume of the items We can write this problem as a minimization Knapsack (Min KP) Consider the bins as the items in the Min KP Consider as the size of the Knapsack the total volume of the GBPP items
5
5 Generalized BPP LB for GBPP
6
6 Generalized BPP LB for GBPP We have a lot of specific codes to solve the Max KP We can rewrite the Min KP as a Max KP Substitute z j =1-y j z j is 1 if the bin is not used
7
7 Generalized BPP LB for GBPP
8
8 Generalized BPP LB for GBPP
9
9 Generalized BPP UB for the GBPP: BFD heuristics Order the bins by non-decreasing costs (and non-increasing volume if the costs are equal) Order the items by non-increasing volumes For each item i Load i in the best partially loaded bin If i cannot be loaded in any bin Add a new bin and load i in it
10
10 Generalized BPP Shopkeeper Algorithm Scheme Init Sol by Constructive Heur. Init Scores Sort Attributes by Score Constructive Heur Stopping Conditions Update Scores Reinit Scores Non Improving Iter. Limit Exit New Solution Local Search Yes No
11
11 Generalized BPP What do you have to define? Stopping criteria Common: max 1 second of CPU per instance Others: to be defined Scoring initialization As in the example (given by the loading of the initial solution) Optional: redefine it Short term update Start with your assignments Modify them in order to obtain the best results Long term update (optional)
12
Short Term Update description
13
13 Generalized BPP Hypothesis Item 1 first element in the item list Number of items N Number of Bins in the solution B
14
14 Generalized BPP Sliding
15
15 Generalized BPP Grasp- Like Already implemented in the online code Cycling on all the items: i: current item, Randomly choose an item k between i and i+ If k in not i, swap the scores of i and k
16
16 Generalized BPP Substring Swap Choose an item i between item 1 and M M is a parameter, initially set to N/2 Choose an item j between item M+1 and N For k=0 to Swap the scores of item i+k and j+k is another parameter (initial value 3)
17
17 Generalized BPP Substring Swap 2 Choose an item i between item 1 and M M is a parameter, initially set to N/2 Choose an item j between item M+1 and N For k=0 to Swap the scores of item i+k and j+ -k is another parameter (initial value 3)
18
18 Generalized BPP Worst Bins First Get the k worst bins (initial value 3) Bins with largest residual space Increase the scores of the items in these bins the best scoring by a parameter (initial value 0.3)
19
19 Generalized BPP Best Bins Last Get the k best bins (initial value 3) Bins with smallest residual space Decrease the scores of the items in these bins the best scoring by a parameter (initial value 0.3)
20
Some remarks on the source code
21
21 Generalized BPP Work material & Laboratories Code Visual Studio 2005 solution file Instance data Batch to make the tests (prove_totali.bat)
22
22 Generalized BPP Executable parameters -if instancefile -lf logfile (log the main data in csv format compatible with Excel Example -if data\monaci\prob_1_A_0_4.txt -lf miolog.csv
23
23 Generalized BPP Core code All the instance data are in mydata All the method-based data are in kpGlobalData computeLBKnapsack: compute the LB computeBFD: compute the BFD solution First parameter: mydata Second parameter: list of items pointer computeBFDFromLb Compute an UB intializing the list of the bins with the bins given by the LB
24
24 Generalized BPP Additional code copySolution: function that copies a solution on another (the two pointers must be already allocaed) Common defines File commonDefines.h _MYDEBUG_ If not commented, activate the debug code (you must recompile) _MYDEBUG_SOL If not commented, activate the usage of the isFeasible member of the solution class in order to check if a solution is formally correct computeBFDGrasp Function using a GRASP like BFD heuristic where the item list is randomly perturbed
25
25 Generalized BPP
26
26 Generalized BPP Warnings When you move your files on another computer you can have problems due to subversions of the libraries
27
27 Generalized BPP How to compile in release mode
28
28 Generalized BPP How to debug
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.