File size: 2,271 Bytes
b3aa878 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | {
"case_id": "case_knapsack",
"problem_type": "knapsack",
"natural_language": "Select items to maximize profit. Item profits are 24, 13, 23, 15, 16 and weights are 12, 7, 11, 8, 9. Knapsack capacity is 26. Each item can be taken at most once.",
"binding": {
"problem_hint": "knapsack",
"entities": {
"items": [
{
"id": "I1",
"label": null,
"attributes": {}
},
{
"id": "I2",
"label": null,
"attributes": {}
},
{
"id": "I3",
"label": null,
"attributes": {}
},
{
"id": "I4",
"label": null,
"attributes": {}
},
{
"id": "I5",
"label": null,
"attributes": {}
}
]
},
"parameters": {
"profit": {
"name": "profit",
"value": [
24.0,
13.0,
23.0,
15.0,
16.0
],
"unit": null,
"source_span": null
},
"weight": {
"name": "weight",
"value": [
12.0,
7.0,
11.0,
8.0,
9.0
],
"unit": null,
"source_span": null
}
},
"scalars": {
"capacity": 26.0
},
"binding_confidence": 0.88
},
"formulation": {
"problem_type": "knapsack",
"sets": {
"I": "items"
},
"parameters": [
"profit",
"weight"
],
"variables": [
{
"name": "x",
"indices": [
"i"
],
"domain": "binary",
"non_negative": true,
"description": "1 if item i is selected"
}
],
"objective": {
"sense": "maximize",
"expression": "sum(profit[i] * x[i] for i in I)",
"description": "Maximize total profit"
},
"constraints": [
{
"name": "capacity",
"expression": "sum(weight[i] * x[i] for i in I)",
"sense": "<=",
"rhs_expression": "capacity",
"description": "Respect knapsack capacity"
}
],
"notes": []
},
"ground_truth_objective": 51.0
} |