Adv Opt Report

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Université Toulouse III - Paul Sabatier

PROJECT
REPORT

ADVANCED OPTIMIZATION
MASTER 1

COMPUTER SCIENCE FOR AEROSPACE

FACULTY OF SCIENCES AND ENGINEERING

Su
bmitted by:

Pamit
DUGGAL

-21911401

TOULOUSE, 2021
EXERCISES ON BIN PACKING AND SET PACKING

BIN PACKING-
Exercise 4.

Write a ZIMPL program that reads abin packinginstance from such a file, and
solves it.Note: in order to read the array of sizes, one can use the two following
instructions:

set tmpsizes[<i> in I] := {read file as "<1n>" skip 1+i use 1} ;param sizes[<i> in I] :=
ord(tmpsizes[i],1,1);

Answer-

Here we have the Objective Function -

By Minimizing B we represent the bin packing problem.

 Yi represents the bin Whose value is Boolean (0,1).


 Xi represents the element j that goes in bin i.
 the value of Xi is 1 if element j is in bin i and if it is not in bin j then the value
is O.

 The given file " u120_07.bpa " is unable to be solved using the SCIP solver.
 During coding we can find that, Other files can be solved using the
binpacking.zpI file.
 Here we find that this is an example Of a NP complete Problem as the
execution is not possible to be performed in a defined time limit.
------------------------------------------------------------------------------------------------------

SET PACKING-

Exercise 6.

Set packing has the same input as set cover: a family E1, . . . Ep of p subsets of
some reference set E containing n objects 1, 2, . . . n. But the objective this time is
to find a set containing as many disjoint parts Ei as possible.

Question 6.1

Write a program to solve instances of set packing with ZIMPL.

Answer-

------------------------------------------------------------------------------------------------------

 U- Natural numbers
 N- Set of natural numbers.
 Boolean variables: x(s),∀s ∈ S: true if the set s is included in the set
packing, false otherwise.
 Objective function: maximize Ps∈N x(s)
 Constraints: No elements should be included more than once
The Best solution is 28 done in 920.67 seconds.

 Traces:
Reading set-packing2.zpl
Reading set-cover-1.txt
Instructions evaluated: 3178577853
Name: set-packing2.zpl Variables: 450 Constraints: 17827 Non Zeros: 35654
Writing [set-packing2.lp]
Writing [set-packing2.tbl]

OUTPUTS

 SCIP> read set-packing2.lp

 read problem <set-packing2.lp>


============

original problem has 450 variables (0 bin, 450 int, 0 impl, 0 cont) and 17827 constraints
SCIP> optimize

feasible solution found by trivial heuristic after 0.0 seconds, objective value 0.000000e+00
presolving:
(round 1, exhaustive) 0 del vars, 0 del conss, 0 add conss, 0 chg bounds, 0 chg sides, 0 chg
coeffs, 17827 upgd conss, 0 impls, 17827 clqs
(0.2s) probing: 51/450 (11.3%) - 0 fixings, 0 aggregations, 0 implications, 0 bound changes
(0.2s) probing aborted: 50/50 successive totally useless probings
presolving (2 rounds: 2 fast, 2 medium, 2 exhaustive):
0 deleted vars, 0 deleted constraints, 0 added constraints, 0 tightened bounds, 0 added holes,
0 changed sides, 0 changed coefficients
0 implications, 17827 cliques
presolved problem has 450 variables (450 bin, 0 int, 0 impl, 0 cont) and 17827 constraints
17827 constraints of type <setppc>
transformed objective value is always integral (scale: 1)
Presolving Time: 0.21
transformed 1/1 original solutions to the transformed problem space

time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |confs|strbr|
dualbound | primalbound | gap
Q 0.3s| 1 | 0 | 0 | - | 47M| 0 | - | 450 | 17k| 450 | 17k| 0 | 0 | 0 | 4.500000e+02 |
2.200000e+01 |1945.45%
0.5s| 1 | 0 | 604 | - | 48M| 0 | 450 | 450 | 17k| 450 | 17k| 0 | 0 | 0 | 2.250000e+02
| 2.200000e+01 | 922.73%
0.9s| 1 | 0 | 702 | - | 56M| 0 | 412 | 450 | 17k| 450 | 17k| 3 | 0 | 0 | 2.060000e+02
| 2.200000e+01 | 836.36%
2.0s| 1 | 0 | 787 | - | 58M| 0 | 382 | 450 | 17k| 450 | 17k| 6 | 0 | 0 | 1.910000e+02
| 2.200000e+01 | 768.18%
3.5s| 1 | 0 | 839 | - | 59M| 0 | 356 | 450 | 17k| 450 | 17k| 8 | 0 | 0 | 1.780000e+02
| 2.200000e+01 | 709.09%
5.3s| 1 | 0 | 955 | - | 61M| 0 | 333 | 450 | 17k| 450 | 17k| 11 | 0 | 0 |
1.665000e+02 | 2.200000e+01 | 656.82%
7.3s| 1 | 0 | 1016 | - | 63M| 0 | 304 | 450 | 17k| 450 | 17k| 14 | 0 | 0 |
1.520000e+02 | 2.200000e+01 | 590.91%
9.6s| 1 | 0 | 1296 | - | 65M| 0 | 243 | 450 | 17k| 450 | 17k| 57 | 0 | 0 |
1.215000e+02 | 2.200000e+01 | 452.27%
12.3s| 1 | 0 | 1590 | - | 67M| 0 | 217 | 450 | 17k| 450 | 17k| 84 | 0 | 0 |
1.085000e+02 | 2.200000e+01 | 393.18%
15.1s| 1 | 0 | 2037 | - | 69M| 0 | 190 | 450 | 17k| 450 | 17k| 110 | 0 | 0 |
9.500000e+01 | 2.200000e+01 | 331.82%
17.8s| 1 | 0 | 2286 | - | 71M| 0 | 169 | 450 | 17k| 450 | 17k| 121 | 0 | 0 |
8.375000e+01 | 2.200000e+01 | 280.68%
20.5s| 1 | 0 | 2552 | - | 73M| 0 | 146 | 450 | 17k| 450 | 17k| 141 | 0 | 0 |
7.225000e+01 | 2.200000e+01 | 228.41%
21.8s| 1 | 0 | 2852 | - | 75M| 0 | 140 | 450 | 17k| 450 | 17k| 156 | 0 | 0 |
6.575000e+01 | 2.200000e+01 | 198.86%
23.2s| 1 | 0 | 3180 | - | 77M| 0 | 111 | 450 | 17k| 450 | 17k| 167 | 0 | 0 |
5.350000e+01 | 2.200000e+01 | 143.18%
24.2s| 1 | 0 | 3325 | - | 79M| 0 | 96 | 450 | 17k| 450 | 18k| 180 | 0 | 0 |
4.800000e+01 | 2.200000e+01 | 118.18%
time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |confs|strbr|
dualbound | primalbound | gap
25.3s| 1 | 0 | 3971 | - | 81M| 0 | 84 | 450 | 17k| 450 | 18k| 189 | 0 | 0 |
4.200000e+01 | 2.200000e+01 | 90.91%
26.1s| 1 | 0 | 4097 | - | 83M| 0 | 95 | 450 | 17k| 450 | 18k| 198 | 0 | 0 |
3.555556e+01 | 2.200000e+01 | 61.62%
27.3s| 1 | 0 | 4183 | - | 85M| 0 | 93 | 450 | 17k| 450 | 18k| 204 | 0 | 0 |
3.525000e+01 | 2.200000e+01 | 60.23%
28.6s| 1 | 0 | 4488 | - | 85M| 0 | 90 | 450 | 17k| 450 | 18k| 207 | 0 | 0 |
3.266667e+01 | 2.200000e+01 | 48.48%
29.7s| 1 | 0 | 4530 | - | 87M| 0 | 104 | 450 | 17k| 450 | 18k| 212 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
31.0s| 1 | 0 | 4624 | - | 88M| 0 | 92 | 450 | 17k| 450 | 18k| 220 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.1s| 1 | 0 | 4664 | - | 90M| 0 | 95 | 450 | 17k| 450 | 18k| 230 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.1s| 1 | 0 | 4718 | - | 90M| 0 | 99 | 450 | 17k| 450 | 18k| 237 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.2s| 1 | 0 | 4788 | - | 91M| 0 | 107 | 450 | 17k| 450 | 17k| 244 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.2s| 1 | 0 | 4842 | - | 91M| 0 | 106 | 450 | 17k| 450 | 17k| 249 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.3s| 1 | 0 | 4914 | - | 91M| 0 | 103 | 450 | 17k| 450 | 17k| 255 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.3s| 1 | 0 | 4984 | - | 91M| 0 | 90 | 450 | 17k| 450 | 17k| 258 | 0 | 0 |
3.100000e+01 | 2.200000e+01 | 40.91%
32.4s| 1 | 0 | 5046 | - | 91M| 0 | 99 | 450 | 17k| 450 | 17k| 264 | 0 | 0 |
3.094444e+01 | 2.200000e+01 | 40.66%
.......

time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |confs|strbr|
dualbound | primalbound | gap
845s| 22300 | 2670 |611749 | 27.2 | 350M| 83 | 56 | 450 | 19k| 450 | 17k|4662 |2361 |2423 |
3.000000e+01 | 2.800000e+01 | 7.14%
850s| 22400 | 2678 |614242 | 27.2 | 350M| 83 | 79 | 450 | 19k| 450 | 18k|4674 |2361 |2424 |
3.000000e+01 | 2.800000e+01 | 7.14%
857s| 22500 | 2684 |616022 | 27.1 | 350M| 83 | - | 450 | 19k| 450 | 17k|4729 |2365 |2427 |
3.000000e+01 | 2.800000e+01 | 7.14%
864s| 22600 | 2708 |618242 | 27.1 | 350M| 83 | 78 | 450 | 19k| 450 | 17k|4769 |2369 |2431 |
3.000000e+01 | 2.800000e+01 | 7.14%
865s| 22700 | 2736 |620881 | 27.1 | 350M| 83 | 44 | 450 | 19k| 450 | 17k|4770 |2369 |2431 |
3.000000e+01 | 2.800000e+01 | 7.14%
865s| 22800 | 2746 |622773 | 27.1 | 350M| 83 | - | 450 | 19k| 450 | 17k|4772 |2382 |2431 |
3.000000e+01 | 2.800000e+01 | 7.14%
867s| 22900 | 2770 |625208 | 27.1 | 350M| 83 | 64 | 450 | 19k| 450 | 17k|4777 |2382 |2431 |
3.000000e+01 | 2.800000e+01 | 7.14%
868s| 23000 | 2786 |627395 | 27.0 | 350M| 83 | - | 450 | 19k| 450 | 17k|4778 |2382 |2432 |
3.000000e+01 | 2.800000e+01 | 7.14%
868s| 23100 | 2810 |629783 | 27.0 | 350M| 83 | - | 450 | 19k| 450 | 17k|4778 |2382 |2432 |
3.000000e+01 | 2.800000e+01 | 7.14%
873s| 23200 | 2824 |631974 | 27.0 | 350M| 83 | 71 | 450 | 19k| 450 | 17k|4786 |2397 |2432 |
3.000000e+01 | 2.800000e+01 | 7.14%
883s| 23300 | 2840 |634234 | 27.0 | 350M| 83 | 54 | 450 | 19k| 450 | 17k|4832 |2407 |2432 |
3.000000e+01 | 2.800000e+01 | 7.14%
893s| 23400 | 2852 |636477 | 27.0 | 350M| 83 | - | 450 | 19k| 450 | 17k|4886 |2411 |2433 |
3.000000e+01 | 2.800000e+01 | 7.14%
901s| 23500 | 2860 |638564 | 26.9 | 350M| 83 | - | 450 | 19k| 450 | 17k|4924 |2421 |2434 |
3.000000e+01 | 2.800000e+01 | 7.14%
906s| 23600 | 2868 |640697 | 26.9 | 350M| 83 | - | 450 | 19k| 450 | 17k|4962 |2427 |2434 |
3.000000e+01 | 2.800000e+01 | 7.14%
909s| 23700 | 2884 |643113 | 26.9 | 350M| 83 | - | 450 | 19k| 450 | 17k|4962 |2427 |2435 |
3.000000e+01 | 2.800000e+01 | 7.14%
time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |confs|strbr|
dualbound | primalbound | gap
910s| 23800 | 2902 |646711 | 26.9 | 350M| 83 | 68 | 450 | 19k| 450 | 18k|5013 |2432 |2435 |
3.000000e+01 | 2.800000e+01 | 7.14%
910s| 23900 | 2914 |649256 | 26.9 | 350M| 83 | 90 | 450 | 19k| 450 | 17k|5030 |2432 |2435 |
3.000000e+01 | 2.800000e+01 | 7.14%
916s| 24000 | 2916 |651144 | 26.9 | 350M| 83 | - | 450 | 19k| 450 | 17k|5086 |2442 |2435 |
3.000000e+01 | 2.800000e+01 | 7.14%
^Cpressed CTRL-C 1 times (5 times for forcing termination)

SCIP Status : solving was interrupted [user interrupt]


Solving Time (sec) : 920.67
Solving Nodes : 24030
Primal Bound : +2.80000000000000e+01 (726 solutions)
Dual Bound : +3.00000000000000e+01
Gap : 7.14 %

SCIP> display solution

objective value: 28
x#4 1 (obj:1)
x#29 1 (obj:1)
x#43 1 (obj:1)
x#53 1 (obj:1)
x#70 1 (obj:1)
x#84 1 (obj:1)
x#106 1 (obj:1)
x#130 1 (obj:1)
x#137 1 (obj:1)
x#164 1 (obj:1)
x#178 1 (obj:1)
x#184 1 (obj:1)
x#202 1 (obj:1)
x#220 1 (obj:1)
x#228 1 (obj:1)
x#254 1 (obj:1)
x#259 1 (obj:1)
x#285 1 (obj:1)
x#291 1 (obj:1)
x#314 1 (obj:1)
x#319 1 (obj:1)
x#346 1 (obj:1)
x#361 1 (obj:1)
x#377 1 (obj:1)
x#402 1 (obj:1)
x#407 1 (obj:1)
x#422 1 (obj:1)
x#441 1 (obj:1)

You might also like