Skip to content

Commit

Permalink
Fix column generation algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Sep 21, 2024
1 parent db40cde commit 1dccd64
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 2 deletions.
57 changes: 57 additions & 0 deletions data/irregular/users/2024-09-21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"objective": "knapsack",
"parameters": {
"item_bin_minimum_spacing": 0.0,
"item_item_minimum_spacing": 0.0
},
"bin_types": [
{
"copies": 1,
"width": 50.0,
"height": 50.0,
"type": "rectangle"
},
{
"copies": 1,
"width": 200.0,
"height": 200.0,
"type": "rectangle"
}
],
"item_types": [
{
"copies": 1,
"shapes": [
{
"type": "polygon",
"vertices": [
{
"x": 100.0,
"y": 100.0
},
{
"x": 0.0,
"y": 100.0
},
{
"x": 0.0,
"y": 0.0
},
{
"x": 100.0,
"y": 0.0
}
],
"holes": []
}
],
"allowed_rotations": [
{
"start": 0,
"end": 0
}
],
"allow_mirroring": false
}
]
}
81 changes: 81 additions & 0 deletions data/irregular/users/2024-09-21_solution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"bins": [
{
"copies": 1,
"id": 1,
"items": [
{
"angle": 0.0,
"id": 0,
"item_shapes": [
{
"shape": [
{
"type": "LineSegment",
"xe": 0.0,
"xs": 100.0,
"ye": 100.0,
"ys": 100.0
},
{
"type": "LineSegment",
"xe": 0.0,
"xs": 0.0,
"ye": 0.0,
"ys": 100.0
},
{
"type": "LineSegment",
"xe": 100.0,
"xs": 0.0,
"ye": 0.0,
"ys": 0.0
},
{
"type": "LineSegment",
"xe": 100.0,
"xs": 100.0,
"ye": 100.0,
"ys": 0.0
}
]
}
],
"mirror": false,
"x": 0.0,
"y": 0.0
}
],
"shape": [
{
"type": "LineSegment",
"xe": 200.0,
"xs": 0.0,
"ye": 0.0,
"ys": 0.0
},
{
"type": "LineSegment",
"xe": 200.0,
"xs": 200.0,
"ye": 200.0,
"ys": 0.0
},
{
"type": "LineSegment",
"xe": 0.0,
"xs": 200.0,
"ye": 200.0,
"ys": 200.0
},
{
"type": "LineSegment",
"xe": 0.0,
"xs": 0.0,
"ye": 0.0,
"ys": 200.0
}
]
}
]
}
2 changes: 1 addition & 1 deletion extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ set(COLUMNGENERATIONSOLVER_USE_CLP ON)
FetchContent_Declare(
columngenerationsolver
GIT_REPOSITORY https://github.com/fontanf/columngenerationsolver.git
GIT_TAG 8f9ac25f724ffe13d239728974752567afd2a586
GIT_TAG 84c6642d53203259c356d4186b3a0919578b8634
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../columngenerationsolver/"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(columngenerationsolver)
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/column_generation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ColumnGenerationPricingSolver: public columngenerationsolver::PricingSolve

std::vector<BinPos> fixed_bin_types_;

std::vector<ItemPos> filled_demands_;
std::vector<double> filled_demands_;

};

Expand Down
3 changes: 3 additions & 0 deletions test/irregular/irregular_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,7 @@ INSTANTIATE_TEST_SUITE_P(
}, {
fs::path("data") / "irregular" / "users" / "2024-09-11.json",
fs::path("data") / "irregular" / "users" / "2024-09-11_solution.json"
}, {
fs::path("data") / "irregular" / "users" / "2024-09-21.json",
fs::path("data") / "irregular" / "users" / "2024-09-21_solution.json"
}}));

0 comments on commit 1dccd64

Please sign in to comment.