Invalid
Invalid
ASSIGNMENT PROBLEM
4.1 INTRODUCTION
An assignment problem is a fundamental concept in operations research and
optimization. It involves assigning a set of resources (such as workers, machines, or delivery
drivers) to a set of tasks (such as jobs, projects, or delivery orders) in the most efficient way
possible. The main objective is to maximize the overall benefit (such as profit or efficiency)
or minimize the overall cost (such as time, distance, or expense) of the assignments.
An assignment problem in the Food Delivery System (FDS) refers to the
challenge of optimally matching available delivery executives (drivers) to customer orders so
that key objectives like minimizing delivery time, cost, or maximizing efficiency are
achieved. In this context, the system must consider real-time factors such as the location of
drivers and customers, food preparation times, traffic, and order priorities. The assignment is
typically one-to-one: each order is assigned to one delivery executive, and each executive
gets one order at a time. Efficient assignment is crucial because it directly affects delivery
speed, customer satisfaction, and operational costs. Algorithms like the Hungarian Method
are commonly used to solve these assignment problems, ensuring the best possible pairing of
orders and drivers in real time.
30
4.3 MATRIX FORM OF ASSIGNMENT PROBLEM
The assignment problem can be stated in the form of m×n matrix (𝐶𝑖𝑗 ) called a
cost matrix or efficient matrix, where 𝐶𝑖𝑗 is the cost of assigning the ith task to the jth agent.
Agent
1 2 3 ................................. n
1 𝐶11 𝐶12 𝐶13 ................................. 𝐶1𝑛
Subject to constraints
∑𝑛𝑖=1 𝑋𝑖𝑗 = 1, j = 1,2, .... , n
and 𝑋𝑖𝑗 = 0 or 1.
31
Step 3: (Assigning the zeros)
(a) Examine the rows successively until a row with exactly one unmarked zero is found.
Make an assignment to this single unmarked zero by encircling it. Cross out all other zeros in
the column of this encircled zero, as these will not be considered for any future assignment.
Continue in this way until all the rows have been examined.
(b) Examine the columns successively until a column with exactly one unmarked zero is
found. Make an assignment to this single unmarked zero by encircling it and crossing out any
other zero in its row. Continue until all the columns have been examined.
Step 4: (Apply Optimal Test)
(a) If each row and each column contains exactly one encircled zero, then the current
assignment is optimal.
(b) If at least one row or column is without an assignment (i.e., if there is at least one row or
column without an encircled zero), then the current assignment is not optimal. Go to step 5.
Subtract the smallest cost element of each column from all the elements in the column of the
resulting cost matrix obtained by step 1, and make sure each column contains at least one
zero.
Step 5: Cover all the zeros by drawing a minimum number of straight lines as follows:
(a) Mark the rows that do not have an assignment.
(b) Mark the columns (not already marked) with zeros in marked rows.
(c) Mark the rows (not already marked) that have assignments in marked columns.
(d) Repeat (b) and (c) until no more marking is required.
(e) Draw lines through all unmarked rows and marked columns. If the number of these lines
is equal to the order of the matrix, then it is an optimum solution; otherwise not.
Step 6: Determine the smallest cost element not covered by the straight lines. Subtract this
smallest cost element from all the uncovered elements and add this to all those elements
which are lying in the intersection of these straight lines, and do not change the remaining
elements which lie on the straight lines.
Step 7: Repeat steps (1) to (6) until an optimum assignment is obtained.
32
4.6.2 Maximization Assignment Problem
In an assignment problem, we may have to deal with the maximization of an
objective function. For example, we may have to assign persons to jobs in such a way that the
total profit is maximized. The maximization problem has to be converted into an equivalent
minimization problem and then solved by the usual Hungarian method.
The conversion of the maximization problem into an equivalent minimization
problem can be done by any one of the following methods:
(a) Since max Z = - min (-Z), multiply all the cost elements 𝐶𝑖𝑗 of the cost matrix by -1.
(b) Subtract all the cost elements 𝐶𝑖𝑗 of the cost matrix from the highest cost element in
that cost matrix.
Example: A company center has four expert programmers and needs to develop application
programs. The head of the computer center estimates the computer time (in times) required
by the respective experts to develop the application programs as follows:
Programs
A B C D
1
120 100 80 90
2 80 90 110 70
Programmers
3 110 140 120 100
4 90 90 80 90
33
A B C D
1
40 20 0 10
2 10 20 40 0
3 10 40 20 0
4 10 10 0 10
Step 2: Now, Let us subtract the minimum element of each column from every element of
that column.
A B C D
1
30 10 0 10
2
0 10 40 0
3 0 30 20 0
4 0 0 0 10
Step 3: Now, starting from the first row onward, we draw a rectangle around the 0 in each
row having a single zero and cross all other zeros in the corresponding column.
A B C D
1
30 10 0 10
2
0 10 40 0
3 0 30 20 0
4 0 0
×
0 10
34
Step 4: Similarly, starting from the first column onward, we draw a rectangle around the 0 in
each column having a single zero and cross out all other zeros in the corresponding row.
A B C D
1
30 10 0 10
2
0 10 40 0
3 0 30 20 0
4
× 0 0
×
0 10
Step 5: In the above matrix, no row or column has a single zero. Therefore, we first move
row-wise to locate the row having more than one zero. The second row has two zeroes. So,
we draw a rectangle arbitrarily around one of these zeroes and cross the other.
A B C D
1
30 10 0 10
2
0 10 40
×0
3
× 0 30 20 0
4
× 0 0
×
0 10
Step 6: The assignment of the task should be made on the basis of the cells corresponding to
the zeros around the rectangles that have been drawn. This means that the programmer 1 is
assigned to C, the programmer 2 to A, and so on.
The minimum time taken to develop the programs is
= 80 + 80 + 100 + 90
= 350.
35
4.7 HUNGARIAN METHOD IN FOOD DELIVERY SYSTEM
The Hungarian Method is a combinatorial optimization algorithm designed to
solve assignment problems efficiently, such as assigning delivery drivers to customer orders
in a way that minimizes total delivery time or cost.
In the Food Delivery System (FDS), the Hungarian method can be used to
optimally match available delivery personnel to incoming food orders. Each possible
assignment (driver to order) is given a cost, typically based on factors like distance, estimated
delivery time, or traffic conditions. The algorithm then systematically finds the assignment
that results in the lowest total cost for all deliveries.
This approach ensures that resources are utilized efficiently, reducing delivery
times and operational costs, and improving customer satisfaction. The Hungarian method is
especially valuable in real-time, high-volume environments where quick and optimal
decision-making is crucial.
Example:
1) A food delivery company has 4 delivery executives and 4 delivery orders. The cost
matrix below shows the estimated delivery cost (in rupees) for each executive to
deliver each order, is given in the table below. Find the optimal assignment of delivery
executives to orders to minimize the total delivery cost.
O1 O2 O3 O4
D1 60 75 80 55
D2 70 65 85 60
D3 80 70 75 65
D4 75 85 60 70
36
O1 O2 O3 O4
D1
5 20 25 0
D2 10 5 15 0
D3 15 5 10 0
D4 15 25 0 10
Step 2: Now, let us subtract the minimum element of each column from every element of that
column.
O1 O2 O3 O4
D1
0 5 25 0
D2
5 0 15 0
D3 10 0 10 0
D4 10 20 0 10
Step 3: Now, starting from the first row onward, we draw a rectangle around the 0 in each
row having a single zero and cross all other zeros in the corresponding column.
O1 O2 O3 O4
D1
0 5 25 0
D2
5 0 15 0
D3 10 0 10 0
D4 10 20 0 10
37
Step 4: Similarly, starting from the first column onward, we draw a rectangle around the 0 in
each column having a single zero and cross out all other zeros in the corresponding row.
O1 O2 O3 O4
×
D1
0 5 25 0
D2
5 0 15 0
D3 10 0 10 0
D4 10 20 0 10
Step 5: In the above matrix, no row or column has a single zero. Therefore, we first move
row-wise to locate the row having more than one zero. The second row has two zeroes. So,
we draw a rectangle arbitrarily around one of these zeroes and cross the other.
O1 O2 O3 O4
×
D1
0 5 25 0
D2
5
×0 15 0
D3 10 0 10
×0
D4 10 20 0 10
Step 6: The assignment of the task should be made on the basis of the cells corresponding to
the zeros around the rectangles that have been drawn. This means that the delivery executive
D1 is assigned to O1, the delivery executive D2 to O4, and so on.
The minimum delivery cost taken to deliver the orders is
= 60 + 60 + 70 + 60
= 250.
38
4.8 Exercise
1. A company has 4 delivery executives and 4 delivery zones. The profit (in rupees) for
each executive in each zone is given. Assign each executive to one zone to maximize the
profit.
Z1 Z2 Z3 Z4
(The above problem is the type of maximization assignment problem, so first subtract the
largest profit from each profit, then use the Hungarian method.)
2. There are 4 drivers (D1, D2, D3, D4) and 4 restaurants (R1, R2, R3, R4). The cost
matrix below shows the distance (in km) each driver would have to travel to pick up
an order from each restaurant. Assign each driver to one restaurant so that the total
distance traveled is minimized.
R1 R2 R3 R4
D1 10 12 19 11
D2 15 13 16 12
D3 18 17 14 10
D4 12 14 13 15
39
5. CONCLUSION
In this project, we studied the methods to improve the Food Delivery System
(FDS). Some issues faced by consumers are that they don’t get food on time, cost problems,
and multiple pick-up issues, so using operational research, we have solved these problems
using four methods, so to minimize the time, we have minimized the distance, which we have
done through transportation problem which gives a proper way to deliver food on time.
Second comes the problem of achieving the minimum cost, for this we have used the
Assignment problem, which helps us to have the minimum cost of the order, and the last is
the multiple pick-up problem, to pick up food from multiple restaurants at the same time so
for this we have used Dijkstra’s Algorithm and Floyd’s Algorithm to find short route and
gives multiple routes. Thus, Operations Research plays an important role in the food delivery
system, and it helps to solve issues that arise in FDS, like time management, picking up food
from multiple restaurants in a short time, and helps in finding a short route to deliver food on
the right time and it also help to reduce the delivery cost.
40