Skip to content

Commit ed60ce5

Browse files
committed
Implement Variable-sized Bin Packing
1 parent 64b2b28 commit ed60ce5

File tree

2,620 files changed

+234127
-3668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,620 files changed

+234127
-3668
lines changed

Diff for: .bazelrc

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
build --compilation_mode=opt
2+
3+
#build --define coinor=true
4+
#build --define cplex=true
5+
#build --define gurobi=true

Diff for: .ycm_extra_conf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
def Settings( **kwargs ):
1+
def Settings(**kwargs):
22
return {
33
'flags': [
44
'-x', 'c++',
55
'-Wall', '-Wextra', '-Werror',
66
'-I', '.',
77
'-I', './bazel-packingsolver/external/json/single_include/',
88
'-I', './bazel-packingsolver/external/googletest/googletest/include/',
9+
'-I', './bazel-packingsolver/external/boost/',
910
'-I', './bazel-packingsolver/external/optimizationtools/',
11+
'-I', './bazel-packingsolver/external/columngenerationsolver/',
12+
# '-I', './../columngenerationsolver/',
1013
],
1114
}
12-

Diff for: README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Note: PackingSolver favours efficiency and flexibility over ease of use. Therefo
1919
Compile:
2020
```shell
2121
bazel build -- //...
22+
# Or, to enable the column generation heuristic for VBPP:
23+
bazel build --define cplex=true -- //...
2224
```
2325

2426
Execute:
@@ -42,11 +44,11 @@ Each branching scheme has a list a compatible algorithms.
4244

4345
Each pair `-q`/`-a` respectively defines the branching scheme and the algorithm for a thread.
4446

45-
Options `--bin-infinite-copies`, `--bin-infinite-width`, `--bin-infinite-height`, `--item-infinite-copies` and `--unweighted` are available to modify the instance properties.
47+
Options `--bin-infinite-copies`, `--bin-infinite-width`, `--bin-infinite-height`, `--bin-unweighted`, `--item-infinite-copies` and `--unweighted` are available to modify the instance properties.
4648

4749
### Problem type rectangleguillotine (RG)
4850

49-
* Available objectives: `default`, `bin-packing` (`BPP`), `knapsack` (`KP`), `strip-packing-width` (`SPPW`), `strip-packing-height` (`SPPH`), `bin-packing-with-leftovers` (`BPPL`)
51+
* Available objectives: `default`, `bin-packing` (`BPP`), `knapsack` (`KP`), `strip-packing-width` (`SPPW`), `strip-packing-height` (`SPPH`), `bin-packing-with-leftovers` (`BPPL`), `variable-sized-bin-packing` (`VBPP`)
5052
* Available branching schemes: `rectangle-guillotine` (`RG`)
5153

5254
### Branching scheme rectangle-guillotine (RG)
@@ -79,11 +81,17 @@ Do not hesitate to contact us if you are aware of any variant or article that we
7981
All experiments can be reproduced using the following scripts:
8082
```shell
8183
python3 packingsolver/scripts/bench.py "roadef2018_A" "roadef2018_B" "roadef2018_X" # ~50h
82-
python3 packingsolver/scripts/bench.py "3NEGH-BPP-O" "3NEGH-BPP-R" "3GH-BPP-O" "3HGV-BPP-O" "long2020" # ~30h
84+
python3 packingsolver/scripts/bench.py "3NEGH-BPP-O" "3NEGH-BPP-R" "long2020_BPP" # ~10h
85+
python3 packingsolver/scripts/bench.py "3GH-BPP-O" "3HG-BPP-O" "3HGV-BPP-O" # ~7h
8386
python3 packingsolver/scripts/bench.py "2NEGH-BPP-O" "2NEGH-BPP-R" "2GH-BPP-O" # ~30h
8487
python3 packingsolver/scripts/bench.py "3NEG-KP-O" "3NEG-KP-R" "3NEGV-KP-O" "3HG-KP-O" # ~10h
85-
python3 packingsolver/scripts/bench.py "2NEG-KP-O" "2NEGH-KP-O" "2NEGV-KP-O" "2NEGH-KP-R" "2G-KP-O" "2GH-KP-O" "2GV-KP-O" # 1h
88+
python3 packingsolver/scripts/bench.py "2NEG-KP-O" "2NEGH-KP-O" "2NEGV-KP-O" "2NEGH-KP-R" # 1h
89+
python3 packingsolver/scripts/bench.py "2G-KP-O" "2GH-KP-O" "2GV-KP-O" # 1m
8690
python3 packingsolver/scripts/bench.py "3NEGH-SPP-O" "3NEGH-SPP-R" # ~20h
8791
python3 packingsolver/scripts/bench.py "2NEGH-SPP-O" "2NEGH-SPP-R" # ~4h
92+
python3 packingsolver/scripts/bench.py "3NEGH-CSP-O" "3NEGH-CSP-R" "long2020_CSP" # ~20h
93+
python3 packingsolver/scripts/bench.py "3GH-CSP-O" "3HG-CSP-O" "3HGV-CSP-O" # ~15h
94+
python3 packingsolver/scripts/bench.py "2NEGH-CSP-O" "2NEGH-CSP-R" "2GH-CSP-O" # ~30h
95+
python3 packingsolver/scripts/bench.py "3NEG-VBPP-O" "3NEG-VBPP-R" "2GH-VBPP-O" "2GH-VBPP-R" # ~20h
8896
```
8997

Diff for: WORKSPACE

+102-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,107 @@ cc_library(
3434
git_repository(
3535
name = "optimizationtools",
3636
remote = "https://github.com/fontanf/optimizationtools.git",
37-
commit = "aa1f5edb039109ac2eb7133e47e17d483299cf13",
38-
shallow_since = "1585857862 +0200",
37+
commit = "b51d64c7428acfde1ad8798404b1be9b413a1248",
38+
shallow_since = "1609062649 +0100",
39+
)
40+
41+
git_repository(
42+
name = "columngenerationsolver",
43+
remote = "https://github.com/fontanf/columngenerationsolver.git",
44+
commit = "f6fb6cb6f88de1146b33ed54e2e1c59ff58f3848",
45+
shallow_since = "1612113523 +0100",
46+
)
47+
48+
local_repository(
49+
name = "columngenerationsolver_",
50+
path = "../columngenerationsolver/",
51+
)
52+
53+
new_local_repository(
54+
name = "coinor",
55+
path = "/home/florian/Programmes/coinbrew/",
56+
build_file_content = """
57+
cc_library(
58+
name = "coinor",
59+
hdrs = glob(["dist/include/**/*.h*"], exclude_directories = 0),
60+
strip_include_prefix = "dist/include/",
61+
srcs = glob(["dist/lib/**/*.so"], exclude_directories = 0),
62+
visibility = ["//visibility:public"],
63+
)
64+
""",
65+
)
66+
67+
new_local_repository(
68+
name = "cplex",
69+
path = "/opt/ibm/ILOG/CPLEX_Studio129/",
70+
build_file_content = """
71+
cc_library(
72+
name = "concert",
73+
hdrs = glob(["concert/include/ilconcert/**/*.h"], exclude_directories = 0),
74+
strip_include_prefix = "concert/include/",
75+
srcs = ["concert/lib/x86-64_linux/static_pic/libconcert.a"],
76+
linkopts = [
77+
"-lm",
78+
"-lpthread",
79+
"-ldl",
80+
],
81+
visibility = ["//visibility:public"],
82+
)
83+
cc_library(
84+
name = "cplex",
85+
hdrs = glob(["cplex/include/ilcplex/*.h"]),
86+
strip_include_prefix = "cplex/include/",
87+
srcs = [
88+
"cplex/lib/x86-64_linux/static_pic/libilocplex.a",
89+
"cplex/lib/x86-64_linux/static_pic/libcplex.a",
90+
],
91+
deps = [":concert"],
92+
visibility = ["//visibility:public"],
93+
)
94+
cc_library(
95+
name = "cpoptimizer",
96+
hdrs = glob(["cpoptimizer/include/ilcp/*.h"]),
97+
strip_include_prefix = "cpoptimizer/include/",
98+
srcs = ["cpoptimizer/lib/x86-64_linux/static_pic/libcp.a"],
99+
deps = [":cplex"],
100+
visibility = ["//visibility:public"],
101+
)
102+
""",
103+
)
104+
105+
new_local_repository(
106+
name = "gurobi",
107+
path = "/home/florian/Programmes/gurobi811/linux64/",
108+
build_file_content = """
109+
cc_library(
110+
name = "gurobi",
111+
hdrs = [
112+
"include/gurobi_c.h",
113+
"include/gurobi_c++.h",
114+
],
115+
strip_include_prefix = "include/",
116+
srcs = [
117+
"lib/libgurobi_c++.a",
118+
"lib/libgurobi81.so",
119+
],
120+
visibility = ["//visibility:public"],
121+
)
122+
""",
123+
)
124+
125+
new_local_repository(
126+
name = "xpress",
127+
path = "/home/florian/Programmes/",
128+
build_file_content = """
129+
cc_library(
130+
name = "xpress",
131+
hdrs = [
132+
],
133+
strip_include_prefix = "include/",
134+
srcs = [
135+
],
136+
visibility = ["//visibility:public"],
137+
)
138+
""",
39139
)
40140

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ID,WIDTH,HEIGHT
2+
0,1000,1000
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ID,WIDTH,HEIGHT,COPIES
2+
0,730,300,68
3+
1,269,717,47
4+
2,463,369,69
5+
3,642,464,2
6+
4,453,329,78
7+
5,455,667,82
8+
6,506,482,42
9+
7,560,362,52
10+
8,483,260,13
11+
9,693,345,32
12+
10,381,510,8
13+
11,456,586,43
14+
12,457,453,12
15+
13,707,658,12
16+
14,639,650,93
17+
15,691,359,12
18+
16,434,700,21
19+
17,576,291,39
20+
18,728,739,6
21+
19,545,742,99

Diff for: data/rectangle/cintra2008/gcut10d.txt_bins.csv

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
ID,WIDTH,HEIGHT
2-
0,1000,1000
1+
ID,WIDTH,HEIGHT,COST
2+
0,1000,1000,1000000
3+
1,1200,800,960000
4+
2,1100,900,990000
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ID,WIDTH,HEIGHT
2+
0,1000,1000
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ID,WIDTH,HEIGHT,COPIES
2+
0,541,745,44
3+
1,344,301,32
4+
2,413,294,99
5+
3,266,341,9
6+
4,543,388,38
7+
5,367,701,33
8+
6,526,707,28
9+
7,286,706,9
10+
8,614,289,76
11+
9,348,592,10
12+
10,673,431,40
13+
11,475,362,96
14+
12,562,439,81
15+
13,530,638,5
16+
14,609,375,69
17+
15,540,274,29
18+
16,486,634,89
19+
17,272,377,80
20+
18,623,306,24
21+
19,266,714,94
22+
20,341,336,47
23+
21,340,296,90
24+
22,531,479,38
25+
23,571,589,60
26+
24,674,496,22
27+
25,560,497,1
28+
26,509,389,27
29+
27,650,332,7
30+
28,474,285,5
31+
29,419,503,16

Diff for: data/rectangle/cintra2008/gcut11d.txt_bins.csv

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
ID,WIDTH,HEIGHT
2-
0,1000,1000
1+
ID,WIDTH,HEIGHT,COST
2+
0,1000,1000,1000000
3+
1,1200,800,960000
4+
2,1100,900,990000
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ID,WIDTH,HEIGHT
2+
0,1000,1000
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
ID,WIDTH,HEIGHT,COPIES
2+
0,572,665,95
3+
1,482,640,3
4+
2,264,594,58
5+
3,349,566,23
6+
4,276,660,58
7+
5,745,422,35
8+
6,434,622,100
9+
7,446,433,24
10+
8,668,506,1
11+
9,405,635,66
12+
10,486,320,3
13+
11,554,549,3
14+
12,392,491,20
15+
13,459,528,91
16+
14,426,579,22
17+
15,728,359,64
18+
16,644,465,25
19+
17,382,323,61
20+
18,268,352,58
21+
19,324,512,83
22+
20,277,426,14
23+
21,254,685,76
24+
22,483,532,60
25+
23,678,414,73
26+
24,546,590,66
27+
25,716,640,4
28+
26,542,400,19
29+
27,634,596,1
30+
28,497,696,90
31+
29,417,300,43
32+
30,290,605,41
33+
31,321,520,8
34+
32,543,290,29
35+
33,599,269,3
36+
34,467,679,68
37+
35,583,421,57
38+
36,729,723,69
39+
37,465,590,16
40+
38,614,585,24
41+
39,446,327,26
42+
40,734,616,4
43+
41,479,606,34
44+
42,656,278,21
45+
43,537,355,72
46+
44,604,519,75
47+
45,746,596,80
48+
46,439,281,31
49+
47,339,405,32
50+
48,273,526,40
51+
49,625,568,12

Diff for: data/rectangle/cintra2008/gcut12d.txt_bins.csv

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
ID,WIDTH,HEIGHT
2-
0,1000,1000
1+
ID,WIDTH,HEIGHT,COST
2+
0,1000,1000,1000000
3+
1,1200,800,960000
4+
2,1100,900,990000
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ID,WIDTH,HEIGHT
2+
0,250,250
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ID,WIDTH,HEIGHT,COPIES
2+
0,167,184,90
3+
1,114,118,75
4+
2,167,152,71
5+
3,83,140,13
6+
4,70,86,39
7+
5,143,166,79
8+
6,120,160,63
9+
7,66,148,93
10+
8,87,141,61
11+
9,69,165,85

Diff for: data/rectangle/cintra2008/gcut1d.txt_bins.csv

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
ID,WIDTH,HEIGHT
2-
0,250,250
1+
ID,WIDTH,HEIGHT,COST
2+
0,250,250,62500
3+
1,275,225,61875
4+
2,300,200,60000
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ID,WIDTH,HEIGHT
2+
0,250,250
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ID,WIDTH,HEIGHT,COPIES
2+
0,120,133,61
3+
1,135,186,75
4+
2,86,75,33
5+
3,103,73,39
6+
4,66,85,20
7+
5,135,97,79
8+
6,91,175,56
9+
7,131,176,49
10+
8,71,176,34
11+
9,153,72,96
12+
10,87,148,19
13+
11,168,107,92
14+
12,18,90,8
15+
13,140,109,79
16+
14,132,159,13
17+
15,152,93,2
18+
16,135,68,78
19+
17,121,158,40
20+
18,68,94,17
21+
19,155,76,92

Diff for: data/rectangle/cintra2008/gcut2d.txt_bins.csv

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
ID,WIDTH,HEIGHT
2-
0,250,250
1+
ID,WIDTH,HEIGHT,COST
2+
0,250,250,62500
3+
1,275,225,61875
4+
2,300,200,60000
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ID,WIDTH,HEIGHT
2+
0,250,250

0 commit comments

Comments
 (0)