IntegerProgramming
IntegerProgramming
INPUT:
Define parameters (e.g., costs, capacities, demands, supply limits)
DECISION VARIABLES:
Define:
- x_ij: continuous/integer variable representing amount assigned
- y_ij: binary variable for yes/no decisions
- w_j: integer variable for multiples or piecewise logic
OBJECTIVE:
Define goal (minimize cost OR maximize profit)
CONSTRAINTS:
1. Supply / Demand / Capacity constraints
2. Logical / Conditional / Exclusive constraints
3. Linking constraints (x <= M*y)
4. Special rules (e.g., min thresholds, multiples, total limits)
VARIABLE TYPES:
Specify which variables are:
- Continuous (x ≥ 0)
- Binary (y ∈ {0,1})
- Integer (e.g., w_j ∈ {0,1,...,k})
1. Segregated Storage Problem - Goal: Assign commodities to silos at minimum cost, respecting capacity
INPUT:
c[i][j]: cost of storing commodity i in silo j
b[j]: capacity of silo j
d[i]: required tons of commodity i
DECISION VARIABLES:
x[i][j] = tons of commodity i stored in silo j
y[i][j] = 1 if commodity i is stored in silo j, 0 otherwise (for IP only)
OBJECTIVE:
Minimize sum over i,j of c[i][j] * x[i][j]
CONSTRAINTS:
1. sum over i of x[i][j] ≤ b[j] for all silos j
2. sum over j of x[i][j] = d[i] for all commodities i
3. If silo can store only 1 commodity: sum over i of y[i][j] ≤ 1
4. Link: x[i][j] ≤ M * y[i][j] (M = max commodity amount)
VARIABLE TYPES:
x[i][j] ≥ 0
y[i][j] ∈ {0, 1}
Goal: Award bids to minimize fuel cost while meeting base demand and company constraints
INPUT:
DECISION VARIABLES:
x[i][j] = amount supplied from company i to base j
y[j] = 1 if company A is used at base j
z[j] = 1 if company B supplies >10 at base j
w[j] = number of 10K units for company C to base j
OBJECTIVE:
Minimize total cost = sum over i,j of c[i][j] * x[i][j]
CONSTRAINTS:
1. Company supply: sum over j of x[i][j] ≤ d[i]
2. Base demand: sum over i of x[i][j] = b[j]
3. Company A (min award): x[1][j] ≥ 15*y[j]; x[1][j] ≤ M*y[j]
4. Company B (limit large awards): x[2][j] ≥ 10*z[j]; x[2][j] ≤ 10*(1-z[j]) + M*z[j]; sum z[j] ≤ 1
5. Company C (multiples): x[3][j] = 10*w[j]
VARIABLE TYPES:
x[i][j] ≥ 0
y[j], z[j] ∈ {0,1}
w[j] ∈ {0,1,...,6}
3. Knapsack Problem
INPUT:
DECISION VARIABLES:
y[i] = 1 if item i is selected, 0 otherwise
OBJECTIVE:
Maximize sum over i of v[i] * y[i]
CONSTRAINT:
sum over i of w[i] * y[i] ≤ W
VARIABLE TYPES:
y[i] ∈ {0,1}
INPUT:
c[i][j]: cost/time for assigning worker i to task j
DECISION VARIABLES:
x[i][j] = 1 if worker i is assigned to task j
OBJECTIVE:
Minimize total cost = sum of c[i][j] * x[i][j]
CONSTRAINTS:
1. Each worker does 1 task: sum over j of x[i][j] = 1
2. Each task assigned once: sum over i of x[i][j] = 1
VARIABLE TYPES:
x[i][j] ∈ {0,1}