Unit Iii
Unit Iii
Assignment Problem:
3.1 Introduction:
1. What is the Assignment Problem? Explain its importance and
applications.
Answer:
The Assignment Problem is a fundamental type of optimization problem in which the goal is to
assign a number of resources (like workers, machines, or jobs) to an equal number of tasks in the
most efficient way, often to minimize cost or maximize profit or efficiency.
• The supply and demand at all sources and destinations is exactly one.
• The assignment must be one-to-one (each job is assigned to one person, and each person
gets only one job).
Importance:
Applications:
Answer:
Let there be n agents and n tasks. Let CijC_{ij}Cij be the cost of assigning agent iii to task jjj. Define a
binary variable:
3a.What are the characteristics of the Assignment Problem?
Answer:
1. One-to-One Matching: Each agent is assigned to only one task and vice versa.
2. Square Matrix: The cost matrix is always a square matrix. If not, dummy rows or
columns are added.
3. Deterministic: All parameters (costs, agents, tasks) are known and fixed.
4. Objective: Usually to minimize total cost or maximize total profit.
5. Binary Decision Variables: Each decision variable can be only 0 or 1.
6. Special case of Linear Programming: But solved more efficiently using specialized
methods.
Answer:
3.2 Zero-One Programming Model:
4a. Solve this Zero-One Programming Problem:
A company is considering three projects. The profit and cost are as follows:
b.What are the main challenges in solving Zero-One Programming Models?
Answer:
• Non-convex solution space makes the problem hard to solve using traditional LP
methods.
• It often requires combinatorial optimization techniques like:
o Branch and Bound
o Cutting Planes
o Heuristic or Metaheuristic methods (e.g., Genetic Algorithms)
• Solving time increases exponentially with the number of variables.
Answer:
Suppose a company wants to choose among 5 products (P1 to P5) to advertise. Each product has an
associated advertising cost and expected return (profit). The total budget is $100,000.
b. What is the role of constraints in a Zero-One Programming problem?
Answer:
Thus, constraints make sure the selected binary choices result in a practical and
implementable solution.
Answer:
There are 3 nurses (N1, N2, N3) and 3 shifts (Morning, Evening, Night). Each nurse can
work only one shift per day, and each shift must be assigned to exactly one nurse.
Let:
• xij=1x_{ij} = 1xij=1 if Nurse iii is assigned to Shift jjj, else 0.
Constraints:
Answer:
Rounding off LP (Linear Programming) solutions to get 0 or 1 values does not guarantee a
feasible or optimal solution for the original binary problem. Here's why:
Answer:
The Assignment Problem is a type of optimization problem that involves assigning resources
(agents) to tasks in a way that minimizes cost or maximizes profit. The problem can be
classified into several types, depending on the nature of the cost or profit structure and the
constraints. The main types of Assignment Problems are:
Each type of Assignment Problem can be solved efficiently using specific algorithms suited
to the structure of the problem.
Answer:
The balanced and unbalanced Assignment Problems differ primarily in the relationship
between the number of agents and tasks.
Answer:
In an Assignment Problem, the goal is to either minimize costs or maximize profits based
on the given cost/profit matrix. Here's the difference:
Answer:
1. Identify the imbalance: Check if the number of agents and tasks are unequal.
o If there are more agents than tasks, you will add dummy tasks.
o If there are more tasks than agents, you will add dummy agents.
2. Add Dummy Tasks or Agents:
o If there are more agents than tasks, add dummy tasks (with zero cost).
o If there are more tasks than agents, add dummy agents (with zero cost).
For example, if you have 6 agents and only 5 tasks, add one dummy task, making the
matrix square (6x6).
Example: If you have 6 workers (agents) and 5 tasks, your original matrix might look like
this:
b. Give an example of a real-world scenario where the Dual Assignment
Problem can be applied.
Answer:
A Dual Assignment Problem can arise in scenarios where you need to assign two sets of
agents to two sets of tasks while optimizing both assignments. This situation arises when
both task assignments and pairings must be optimized.
Example:
• Scenario: A hospital needs to assign doctors to patients, but at the same time,
specialty needs and patient preferences must be considered. Each doctor has a
specialty (e.g., Cardiology, Neurology, etc.), and each patient requires specific care
based on their condition. The hospital needs to pair doctors with patients such that
both the doctor’s specialty matches the patient’s needs, and the pairing maximizes the
total patient satisfaction while optimizing doctor allocation.
Solution:
• The dual assignment problem involves assigning both the doctors to tasks (patients)
and optimizing the pairing of specialties to maximize satisfaction, which can be
modeled as a dual assignment problem.
Let’s say we have a cost matrix CCC of order n×nn \times nn×n:
1. Row Reduction:
o Subtract the smallest element of each row from all the elements in that row.
o This ensures each row has at least one zero.
2. Column Reduction:
o After row reduction, subtract the smallest element of each column from all
the elements in that column.
o This step ensures each column has at least one zero.
3. Cover All Zeros:
o Cover all zeros in the matrix using the minimum number of horizontal and
vertical lines.
o If the number of lines = nnn, then an optimal assignment exists among those
zeros.
4. Test for Optimality:
o If the number of lines used < nnn, proceed to the next step.
o Otherwise, proceed to assignment and solve.
5. Modify the Matrix:
o Find the smallest uncovered value (i.e., not covered by any line).
o Subtract it from all uncovered elements.
o Add it to all elements covered twice (intersection of lines).
o Repeat steps 3 and 4 until an optimal assignment is found.
6. Make the Optimal Assignment:
o Choose a zero in the matrix, assign it, and eliminate all other zeros in that row
and column.
o Repeat until all agents are assigned exactly one task.
11. Solve the following assignment problem using the Hungarian Method:
• Row 1: [7, 0, 5, 6]
• Row 2: [3, 1, 0, 4]
• Row 3: [4, 7, 0, 7]
• Row 4: [3, 2, 5, 0]
• Man 1 → Job 2
• Man 2 → Job 1
• Man 3 → Job 3
• Man 4 → Job 4
Answer:
Steps:
Example:
• Max value = 9
• Convert matrix:
b. What are the advantages and limitations of the Hungarian Method?
Answer:
Advantages:
Limitations:
• Not suitable for very large datasets due to memory and computational limits.
• Requires the problem to be in a square matrix format (unbalanced problems need
modification).
• The standard method only applies to one-to-one assignment problems (not suitable
for many-to-many assignments).
• Modifications are needed for problems involving multiple criteria or dynamic
changes.
Answer:
The Hungarian Method is used in many real-life optimization problems where resource-
task assignment is required:
1. Workforce Assignment:
o Assigning employees to jobs/tasks based on skill, cost, or preference.
o Example: Scheduling shift workers in hospitals or factories.
2. College Seat Allocation:
o Assigning students to universities or courses to maximize preferences or cutoff
scores.
3. Machine Scheduling:
o Assigning machines to tasks in manufacturing processes to minimize time or
cost.
4. Airline Crew Scheduling:
oAssigning pilots and crew members to flights to minimize layover costs and
maximize efficiency.
5. Matching in Online Platforms:
o Platforms like Uber or food delivery services use variations of the Hungarian
Method to assign riders to drivers.
Answer:
Problem:
• Left Branch (Include A–Job 1): Remove Row A and Column 1. Solve subproblem
with remaining matrix.
• Right Branch (Exclude A–Job 1): Set cost of A–Job 1 to ∞. Solve new matrix.
Answer:
Advantages:
Disadvantages:
• Computationally expensive: Becomes slow for large-scale problems due to
exponential growth of branches.
• Memory intensive: Requires tracking many subproblems in memory.
• Not ideal for real-time decision-making unless problem size is small or well-
structured.
Answer:
Answer:
b. What are the key differences between Linear Programming and Integer
Programming? Why is IP more complex?
Answer:
Answer:
A factory produces two types of products: A and B. Each unit of A requires 3 hours of labor
and each unit of B requires 2 hours. The total labor available is 18 hours. Product A gives a
profit of $5, and product B gives $4.
Additionally:
• The factory can produce only whole units (no partial products).
• A minimum of 2 units of A must be produced.
Objective: Maximize profit
Decision Variables:
Maximize:
Answer:
1. Branch-and-Bound:
o Systematically explores branches of the decision tree.
o Solves LP relaxations and prunes suboptimal or infeasible branches.
2. Cutting Plane Method:
o Starts with LP relaxation.
o Adds linear constraints (cuts) to eliminate fractional solutions.
3. Gomory Cuts:
o Specific type of cutting plane used for pure IP problems.
4. Branch-and-Cut:
oCombines Branch-and-Bound with Cutting Plane techniques.
5. Heuristic and Metaheuristic Methods:
o Includes Genetic Algorithms, Simulated Annealing, Tabu Search.
o Used for large, complex, or non-linear integer problems.
6. Dynamic Programming (for small cases):
o Breaks down problems into stages with decision rules.
Answer:
1. Computational Complexity:
IP problems are NP-Hard. Even small problems can have huge solution spaces.
Answer:
1. Network Design:
2. Project Scheduling:
3. Staff Scheduling:
4. Capital Budgeting:
Answer:
Importance of IP Formulation:
Answer:
Problem:
A company has $100,000 to invest in projects. There are 5 potential projects with different
costs and expected profits:
20. How can you model a facility location problem using Integer
Programming?
Answer:
Problem:
A company wants to decide whether to open warehouses in three cities (A, B, C) to serve four
markets. Each warehouse has a fixed cost, and serving markets from warehouses has variable
shipping costs. The goal is to minimize total cost while ensuring each market is served from one
open warehouse.
Formulation:
Let:
Problem:
A company needs a minimum number of workers each day. Full-time staff work 5 consecutive days.
Determine the number of staff starting each day (Monday to Sunday) to meet daily requirements at
the minimum cost.
Formulation:
3.9 The Cutting-Plane Algorithm:
22. What is the Cutting-Plane Algorithm in Integer Programming? Explain
the concept with an example.
Answer:
The Cutting-Plane Algorithm is an exact method for solving integer programming (IP)
problems. It begins by solving the linear programming (LP) relaxation of the problem
(ignoring integer constraints), then iteratively adds new constraints (called cuts) to
eliminate the non-integer solutions without removing any feasible integer points.
Core Idea:
Example:
Maximize:
Z=3x+2y
Subject to:
23a. How are cutting planes generated? What is the Gomory Cut?
Answer:
Cutting planes are derived from the tableau of the simplex method used to solve the LP relaxation.
They are constructed to cut off non-integer solutions by analyzing the fractional parts of the basic
variables in the final tableau.
The most common type of cut is the Gomory cut, introduced by Ralph Gomory. It is derived from a
constraint in the final simplex tableau that corresponds to a basic variable with a fractional value.
Answer:
Answer:
Working Principle:
1. Relaxation:
o Solve the linear programming (LP) relaxation of the original integer problem
(ignore integer constraints temporarily).
2. Branching:
o If the solution contains non-integer values, create two subproblems by placing
additional constraints (e.g., x≤⌊x∗⌋), where x∗ is the fractional solution.
3. Bounding:
o Solve the LP relaxation of each subproblem to determine the lower bound
(minimization) or upper bound (maximization).
o Compare these bounds with the current best (incumbent) solution.
4. Fathoming (Pruning):
o Eliminate (prune) branches that:
▪ Yield infeasible solutions.
▪ Have bounds worse than the incumbent solution.
▪ Produce an integer solution (potentially updating the incumbent).
5. Iteration:
o Repeat the branching and bounding process until all branches are explored or
pruned.
6. Termination:
o The best feasible integer solution found becomes the optimal solution.
Example:
25.aWhat are the key components of the Branch-and-Bound technique?
Answer:
1. Branching:
o Dividing the problem into smaller subproblems by adding constraints.
o Typically done using floor and ceiling functions on fractional values of
decision variables.
2. Bounding:
o Calculating lower bounds (for minimization) or upper bounds (for
maximization) for each subproblem using LP relaxation.
o Used to assess whether further exploration of a branch is necessary.
3. Incumbent Solution:
o The best feasible (integer) solution found so far.
o Used as a reference to prune branches with worse bounds.
4. Fathoming (Pruning):
o Eliminating subproblems that:
▪Are infeasible.
▪Have worse bounds than the incumbent solution.
▪Have achieved integer optimality.
5. Search Strategy:
o Methods like depth-first search, breadth-first search, or best-first search to
explore branches efficiently.
Answer:
Advantages:
1. Guaranteed optimality:
o Finds the optimal solution by systematically exploring feasible solutions.
2. Handles complex constraints:
o Suitable for problems with mixed-integer variables and additional logical
constraints.
3. Pruning improves efficiency:
o Eliminates unnecessary branches, reducing computational effort.
4. Flexibility:
o Can be applied to a wide range of combinatorial optimization problems (e.g.,
assignment, knapsack, traveling salesman).
Disadvantages:
1. Computationally expensive:
o The solution space can grow exponentially with more variables, increasing
computation time.
2. Memory intensive:
o Requires tracking and storing multiple subproblems simultaneously.
3. Inefficiency in large-scale problems:
o Even with pruning, solving very large or complex problems can be slow.
4. Depends on initial bounds:
o Weak initial bounds can result in less effective pruning.
Answer:
Assignment Problems typically involve assigning tasks to agents while minimizing costs or
maximizing profits. However, when additional constraints (e.g., specific tasks cannot be
assigned to certain agents) are introduced, the Hungarian Method may not be suitable,
making Branch-and-Bound a better option.
Steps for Assignment Problem with Additional Constraints:
Answer:
Answer:
Yes! These methods are commonly used together in modern solvers (Branch-and-Cut) to
leverage the advantages of both techniques, leading to faster convergence for large-scale
problems.
Answer:
The Zero-One Implicit Enumeration Algorithm is a specialized method for solving binary
(0-1) integer programming problems. These problems involve decision variables that can
take on only two values: 0 (no) or 1 (yes). The algorithm systematically explores all feasible
combinations of variable assignments, while implicitly eliminating large portions of the
solution space using bounding and feasibility checks.
Significance:
• Used when branch-and-bound or cutting-plane methods are not efficient due to the
problem structure.
• Focuses on logical variable fixing rather than solving LP relaxations.
• Helps solve problems like project selection, investment decisions, facility location,
and scheduling where decisions are binary.
b. Explain the steps involved in the Zero-One Implicit Enumeration
Algorithm.
Answer:
Step 2: Branching
• At each node, fix the next unfixed variable to 0 or 1, creating two branches.
• For example, if current variable x1x_1x1 is unfixed:
o Branch 1: x1=0x_1 = 0x1=0
o Branch 2: x1=1x_1 = 1x1=1
• At each node, check whether the partial assignment satisfies the problem constraints
(i.e., whether it's feasible).
Step 4: Bounding
Step 6: Terminate
• The algorithm terminates when all feasible nodes are either explored or pruned.
• The best feasible solution found is the optimal solution.
Answer:
Answer:
Advantages:
Limitations:
The algorithm is especially useful in problems where decisions are naturally binary and constraints
are easily evaluated. Key application areas include:
1. Project Selection:
o Selecting a subset of projects under budget or resource constraints.
2. Capital Budgeting:
o Choosing investments where each project is either accepted or rejected.
3. Facility Location:
o Deciding whether to open facilities (yes/no).
4. Knapsack Problems:
o Selecting items under weight and value constraints.
5. Task Assignment and Scheduling:
o Assigning tasks to resources with binary compatibility.
6. Network Design:
o Choosing which links to include in a network.
2. The main objective of the assignment problem is to minimize the total __________ or
maximize the total __________.
Answer: Cost
Answer: One
7. If the number of agents is not equal to the number of tasks, we add a _________ to
balance the matrix.
Answer: Dummy row or column
8. The assignment problem assumes that all assignments are made simultaneously and
_________.
Answer: Independently
9. The Hungarian method is one of the most widely used methods to solve the
_________ problem.
Answer: Assignment
10. The assignment problem is a special case of the transportation problem where all
supplies and demands are equal to _________.
Answer: One
11. The Hungarian Method starts by subtracting the _________ element from each row.
Answer: Minimum
12. After row reduction, the next step in the Hungarian Method is _________ reduction.
Answer: Column
13. The solution is optimal when the minimum number of lines covering all zeros is equal
to the number of _________.
14. If an optimal assignment cannot be made, we adjust the matrix by subtracting the
smallest _________ from all uncovered elements.
15. The Hungarian Method helps in achieving the _________ solution for the assignment
problem.
Answer: Optimal
16. The assignment problem is used when the resources are to be assigned in a ________
manner to tasks.
Answer: One-to-one
17. In the cost matrix of an assignment problem, each cell represents the ________ of
assigning one agent to one task.
19. When profits instead of costs are given, we convert the problem into a ________
problem by subtracting values from the highest profit.
Answer: Minimization
20. If there are more tasks than agents, a ________ agent is introduced with zero cost
values.
Answer: Dummy
A) Integer programming
B) Non-linear programming
C) Transportation problem
D) Simulation
A) Multiple agents
B) Only one agent
C) At least two agents
D) None of the above
A) Big M method
B) Simplex method
C) Hungarian method
D) Newton-Raphson method
A) Column reduction
B) Subtracting the largest value in each row
C) Row reduction
D) Adding dummy rows
5. If there are more agents than tasks, what is added to the matrix to balance
it?
A) New constraints
B) Dummy task (column)
C) Slack variable
D) Artificial variable
A) Maximum cost
B) Minimum cost
C) Zero
D) Random values
10. What type of cost values does the Hungarian Method operate on?
A) Non-linear programming
B) Linear programming with continuous variables
C) Linear programming with integer constraints
D) Dynamic programming
A) Nonlinear programming
B) Pure Integer Programming
C) Mixed Integer Programming
D) Binary Integer Programming
A) 0 to 9
B) Any positive integer
C) 0 or 1 only
D) Negative integers only
Correct Answer: C) 0 or 1 only
Correct Answer: B) Discrete nature of variables makes the solution space non-convex
A) Integer solution
B) Binary solution
C) Linear programming relaxation
D) Mixed integer values
Correct Answer: C) Linear programming relaxation