Dual Formulation Example
From 30 model questions
Write the dual of the following primal problem:
Maximise: z = -5x1 + 2x2
Subject to the constraints:
x1 - x2 ≥ 2
2x1 + 3x2 ≤ 5
x1, x2 ≥ 0
1. If primal is a maximisation problem, its dual will be a minimisation problem, and vice versa.
2. No. of dual variables = no. of primal constraints.
3. No. of dual constraints = no. of primal variables.
4. The transpose of the coefficient matrix of the primal is the coefficient matrix of the dual.
5. The direction of constraints of the dual is the reverse of the direction of constraints in the
primal.
6. If the kth primal constraint is a strict equality, then the kth dual variable will be unrestricted in
sign.
7. If the ith primal variable is unrestricted in sign, then the ith dual constraint will be a strict
equality.
8. If the primal is a maximisation problem, then before formulating the dual all the constraints
should be converted into ‘≤ type’. If the primal is a minimisation problem, then before
formulating the dual all the constraints should be converted into ‘≥ type’.
9. The objective function coefficients of the primal become the RHS constants of the
constraints of the dual and the RHS constants of the primal constraints become the objective
function coefficients of the variables in the dual.
10. If a variable is unrestricted in sign, it can be written as the difference between two non-
negative variables.
Primal:
Max z = -5x1 + 2x2
s/t
x1 - x2 ≥ 2
2x1 + 3x2 ≤ 5
x1, x2 ≥ 0
∵ 𝑝𝑟𝑖𝑚𝑎𝑙 𝑖𝑠 𝑎 𝑚𝑎𝑥𝑖𝑚𝑖𝑠𝑎𝑡𝑖𝑜𝑛 𝑝𝑟𝑜𝑏𝑙𝑒𝑚
∴ 𝑤𝑒 ℎ𝑎𝑣𝑒 𝑡𝑜 𝑒𝑛𝑠𝑢𝑟𝑒 𝑡ℎ𝑎𝑡 𝑎𝑙𝑙 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 𝑎𝑟𝑒 𝑜𝑓 "≤" 𝑡𝑦𝑝𝑒
∴ 𝑡ℎ𝑒 𝑝𝑟𝑖𝑚𝑎𝑙 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑟𝑒𝑤𝑟𝑖𝑡𝑡𝑒𝑛 𝑎𝑠:
𝑀𝑎𝑥 𝑧 = −5𝑥1 + 2𝑥2
𝑠/𝑡
−𝑥1 + 𝑥2 ≤ −2
2𝑥1 + 3𝑥2 ≤ 5
𝑥1, 𝑥2 ≥ 0
𝑀𝑎𝑥 𝑧 = −5𝑥1 + 2𝑥2
𝑠/𝑡
−𝑥1 + 𝑥2 ≤ −2
2𝑥1 + 3𝑥2 ≤ 5
𝑥1, 𝑥2 ≥ 0
Primal objective function: maximise
Dual objective function: minimise
Number of dual variables = number of primal constraints = 2 (𝑦1, 𝑦2)
Number of dual constraints = number of primal variables = 2
Coefficient matrix of dual constraints = transpose of the coefficient matrix of primal
constraints =
−1 1
2 3
𝑡
=
−1 2
1 3
∵ 𝑡ℎ𝑒 𝑝𝑟𝑖𝑚𝑎𝑙 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 𝑎𝑟𝑒 𝑜𝑓 "≤" 𝑡𝑦𝑝𝑒
∴ 𝑡ℎ𝑒 𝑑𝑢𝑎𝑙 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑜𝑓 "≥" 𝑡𝑦𝑝𝑒
RHS constants of dual constraints = Objective function coefficients of primal variables
Objective function coefficients of dual variables = RHS constants of primal constraints
∴ 𝑡ℎ𝑒 𝑑𝑢𝑎𝑙 𝑐𝑎𝑛 𝑏𝑒 𝑤𝑟𝑖𝑡𝑡𝑒𝑛 𝑎𝑠:
𝑀𝑖𝑛 𝑧 = −2𝑦1 + 5𝑦2
𝑠/𝑡
−𝑦1 + 2𝑦2 ≥ −5
𝑦1 + 3𝑦2 ≥ 2
𝑦1, 𝑦2 ≥ 0

Dual formulation example

  • 1.
  • 2.
    Write the dualof the following primal problem: Maximise: z = -5x1 + 2x2 Subject to the constraints: x1 - x2 ≥ 2 2x1 + 3x2 ≤ 5 x1, x2 ≥ 0
  • 3.
    1. If primalis a maximisation problem, its dual will be a minimisation problem, and vice versa. 2. No. of dual variables = no. of primal constraints. 3. No. of dual constraints = no. of primal variables. 4. The transpose of the coefficient matrix of the primal is the coefficient matrix of the dual. 5. The direction of constraints of the dual is the reverse of the direction of constraints in the primal. 6. If the kth primal constraint is a strict equality, then the kth dual variable will be unrestricted in sign. 7. If the ith primal variable is unrestricted in sign, then the ith dual constraint will be a strict equality. 8. If the primal is a maximisation problem, then before formulating the dual all the constraints should be converted into ‘≤ type’. If the primal is a minimisation problem, then before formulating the dual all the constraints should be converted into ‘≥ type’. 9. The objective function coefficients of the primal become the RHS constants of the constraints of the dual and the RHS constants of the primal constraints become the objective function coefficients of the variables in the dual. 10. If a variable is unrestricted in sign, it can be written as the difference between two non- negative variables.
  • 4.
    Primal: Max z =-5x1 + 2x2 s/t x1 - x2 ≥ 2 2x1 + 3x2 ≤ 5 x1, x2 ≥ 0 ∵ 𝑝𝑟𝑖𝑚𝑎𝑙 𝑖𝑠 𝑎 𝑚𝑎𝑥𝑖𝑚𝑖𝑠𝑎𝑡𝑖𝑜𝑛 𝑝𝑟𝑜𝑏𝑙𝑒𝑚 ∴ 𝑤𝑒 ℎ𝑎𝑣𝑒 𝑡𝑜 𝑒𝑛𝑠𝑢𝑟𝑒 𝑡ℎ𝑎𝑡 𝑎𝑙𝑙 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 𝑎𝑟𝑒 𝑜𝑓 "≤" 𝑡𝑦𝑝𝑒 ∴ 𝑡ℎ𝑒 𝑝𝑟𝑖𝑚𝑎𝑙 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑟𝑒𝑤𝑟𝑖𝑡𝑡𝑒𝑛 𝑎𝑠: 𝑀𝑎𝑥 𝑧 = −5𝑥1 + 2𝑥2 𝑠/𝑡 −𝑥1 + 𝑥2 ≤ −2 2𝑥1 + 3𝑥2 ≤ 5 𝑥1, 𝑥2 ≥ 0
  • 5.
    𝑀𝑎𝑥 𝑧 =−5𝑥1 + 2𝑥2 𝑠/𝑡 −𝑥1 + 𝑥2 ≤ −2 2𝑥1 + 3𝑥2 ≤ 5 𝑥1, 𝑥2 ≥ 0 Primal objective function: maximise Dual objective function: minimise Number of dual variables = number of primal constraints = 2 (𝑦1, 𝑦2) Number of dual constraints = number of primal variables = 2 Coefficient matrix of dual constraints = transpose of the coefficient matrix of primal constraints = −1 1 2 3 𝑡 = −1 2 1 3 ∵ 𝑡ℎ𝑒 𝑝𝑟𝑖𝑚𝑎𝑙 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 𝑎𝑟𝑒 𝑜𝑓 "≤" 𝑡𝑦𝑝𝑒 ∴ 𝑡ℎ𝑒 𝑑𝑢𝑎𝑙 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑜𝑓 "≥" 𝑡𝑦𝑝𝑒 RHS constants of dual constraints = Objective function coefficients of primal variables Objective function coefficients of dual variables = RHS constants of primal constraints
  • 6.
    ∴ 𝑡ℎ𝑒 𝑑𝑢𝑎𝑙𝑐𝑎𝑛 𝑏𝑒 𝑤𝑟𝑖𝑡𝑡𝑒𝑛 𝑎𝑠: 𝑀𝑖𝑛 𝑧 = −2𝑦1 + 5𝑦2 𝑠/𝑡 −𝑦1 + 2𝑦2 ≥ −5 𝑦1 + 3𝑦2 ≥ 2 𝑦1, 𝑦2 ≥ 0