1 / 28

Generalized BPP

Generalized BPP. Guido Perboli (guido.perboli@polito.it) DAUIN - Politecnico di Torino. 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

hallam
Download Presentation

Generalized BPP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Generalized BPP Guido Perboli (guido.perboli@polito.it) DAUIN - Politecnico di Torino

  2. Problem • Set of items • Volume vi • Set of bins • Maximum loadable volume Vj • Cost cj • 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 Generalized BPP

  3. Formulation Generalized BPP

  4. 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 Generalized BPP

  5. LB for GBPP Generalized BPP

  6. 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 zj=1-yj • zj is 1 if the bin is not used Generalized BPP

  7. LB for GBPP Generalized BPP

  8. LB for GBPP Generalized BPP

  9. 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 Generalized BPP

  10. New Solution Local Search StoppingConditions Yes Exit Init Sol by Constructive Heur. Constructive Heur No Non ImprovingIter. Limit Yes No Init Scores Sort Attributesby Score Update Scores Reinit Scores Shopkeeper Algorithm Scheme Generalized BPP

  11. 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) Generalized BPP

  12. Short Term Update description

  13. Hypothesis • Item 1 first element in the item list • Number of items N • Number of Bins in the solution B Generalized BPP

  14. Sliding Generalized BPP

  15. 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+d • If k in not i, swap the scores of i and k Generalized BPP

  16. 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 d • Swap the scores of item i+k and j+k • d is another parameter (initial value 3) Generalized BPP

  17. 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 d • Swap the scores of item i+k and j+d-k • d is another parameter (initial value 3) Generalized BPP

  18. 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 a (initial value 0.3) Generalized BPP

  19. 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 a (initial value 0.3) Generalized BPP

  20. Some remarks on the source code

  21. Work material & Laboratories • Code • Visual Studio 2005 solution file • Instance data • Batch to make the tests (prove_totali.bat) Generalized BPP

  22. 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 Generalized BPP

  23. 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 Generalized BPP

  24. 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 Generalized BPP

  25. Generalized BPP

  26. Warnings • When you move your files on another computer you can have problems due to subversions of the libraries Generalized BPP

  27. How to compile in release mode Generalized BPP

  28. How to debug Generalized BPP

More Related