Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How to solve assignment problem with additional constraints?

The assignment problem is defined as:

Let there be n agents and m tasks. Any agent can be assigned to perform any task, incurring some costs that may vary depending on the agent-task assignment. We can assign at most one task for one person and at most one person for one task in such a way that the total cost of the assignment is maximized.

The Hungarian algorithm can solve this problem.

For example, I have a cost matrix as below:

T1 T2 T3 P1 2 2 2 P2 3 1 4

$T_{i}$ is the $i_{th}$ task, $P_{i}$ is the $i_{th}$ person.

The number in the row $P_{i}$ and col $T_{i}$ is the cost when assigning task $T_{i}$ to person $P_{i}$ .

One solution for the above problem is: $P_1 - T1, P_2 - T_3$ , the max cost is 2 + 4 = 6.

I want to add some constraints like:

Some people can do a task together (e.g: $P_1$ and $P_2$ can do task $T1$ together with a cost of 10)

Some people can do some tasks together (e.g: $P_1$ and $P_2$ can do task $T1$ and $T2$ together with a cost of 10)

A person can do some tasks (e.g: $P_1$ can do task $T1$ and $T2$ consequently with a cost of 10)

So, the new solution for the above problem is: $P1,P2-T1,T2$ , the max cost is 10

How to approach solving this problem?

  • optimization
  • assignment-problem
  • combinatorics

Linh OR's user avatar

  • 1 $\begingroup$ Welcome to ORSE. Would you please, is it a homework training? $\endgroup$ –  A.Omidi May 16, 2022 at 7:37
  • 3 $\begingroup$ The problem specifies that you are maximizing cost. Is this a government operation? $\endgroup$ –  prubin ♦ May 16, 2022 at 15:02
  • $\begingroup$ Actually, it will be minimized the cost but I have negated the cost, so it becomes maximized. $\endgroup$ –  Linh OR May 17, 2022 at 1:48

2 Answers 2

You can create additional "group agents" that represent combinations of actual agents (for instance, $P_{17}$ might be the pairing of $P_1$ and $P_2$ ) and/or additional "combo tasks" that are combinations of original tasks (for instance, $T_{9}$ might be $T_1$ and $T_3$ done together). You then assign "agents" to "tasks" using binary variables, and add constraints that preclude assigning a "group agent" to a task and also assigning one of the group's members (or another group sharing a member) to a different task, as well as constraints preventing an individual task and a "combo task" including that task (or two "combo tasks" that intersect) from being assigned simultaneously. This can be modeled as a binary integer program and solved by branch-and-bound/branch-and-cut.

prubin's user avatar

This sounds like a special case of the parallel assignment problem in which the preemption (this is a standard notation in the scheduling theory) would be allowed. I am not aware of how this problem can still be solved by the Hungarian algorithm in an efficient way, but there are some algorithms to tackle such a problem, like $\text{LRPT}$ , Longest Remaining Processing Time first. Also, another approach to solving this problem is Linear programming.

A.Omidi's user avatar

Your Answer

Sign up or log in, post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged optimization algorithms assignment-problem combinatorics or ask your own question .

Hot network questions.

  • How might a physicist define 'mind' using concepts of physics?
  • Which program is used in this shot of the movie "The Wrong Woman"
  • Almost everywhere-periodic functions with many periods
  • Is it true that engines built in Russia are still used to launch American spacecraft?
  • Can campaign promises be enforced by a contract, or has it ever happened they were?
  • What can I plant to retain a steep slope?
  • A phrase that means you are indifferent towards the things you are familiar with?
  • Why does White castle into Black's attack in the King's Indian, and then run away afterwards?
  • Can a Kerr black hole become super-extremal?
  • How much extra did a color RF modulator cost?
  • What should I get paid for if I can't work due to circumstances outside of my control?
  • How is this function's assembly implementing the conditional?
  • A story about a boy with a fever who falls in the creek and is saved by an angel and grows up to be Hitler
  • how do I constrain a shape key
  • Review not needed after review
  • Visual Studio Code crashes with [...ERROR:process_memory_range.cc(75)] read out of range
  • In Catholicism, is it OK to join a church in a different neighborhood if I don't like the local one?
  • Romans 3:22 – ‘of’ or ‘in’? Old translations differ from modern ones. Why?
  • What legal reason, if any, does my bank have to know if I am a dual-citizen of the US?
  • Accelerating Expansion of Universe - Why Not Caused by Radiation?
  • In Acts 10 why does Peter not know the gospel is not only for the Jewish people?
  • Prove that "max independent set is larger than max clique" is NP-Hard
  • Effects if a human was shot by a femtosecond laser
  • Does Japanese advertises selling something with full price?

how to solve assignment problem with group restrictions

Google OR-Tools

  • Google OR-Tools
  • Español – AmĂ©rica Latina
  • PortuguĂȘs – Brasil
  • TiĂȘ́ng ViĂȘÌŁt

One of the most well-known combinatorial optimization problems is the assignment problem . Here's an example: suppose a group of workers needs to perform a set of tasks, and for each worker and task, there is a cost for assigning the worker to the task. The problem is to assign each worker to at most one task, with no two workers performing the same task, while minimizing the total cost.

You can visualize this problem by the graph below, in which there are four workers and four tasks. The edges represent all possible ways to assign workers to tasks. The labels on the edges are the costs of assigning workers to tasks.

An assignment corresponds to a subset of the edges, in which each worker has at most one edge leading out, and no two workers have edges leading to the same task. One possible assignment is shown below.

The total cost of the assignment is 70 + 55 + 95 + 45 = 265 .

The next section shows how solve an assignment problem, using both the MIP solver and the CP-SAT solver.

Other tools for solving assignment problems

OR-Tools also provides a couple of other tools for solving assignment problems, which can be faster than the MIP or CP solvers:

  • Linear sum assignment solver
  • Minimum cost flow solver

However, these tools can only solve simple types of assignment problems. So for general solvers that can handle a wide variety of problems (and are fast enough for most applications), we recommend the MIP and CP-SAT solvers.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-01-02 UTC.

Assignment Problem: Maximization

There are problems where certain facilities have to be assigned to a number of jobs, so as to maximize the overall performance of the assignment.

The Hungarian Method can also solve such assignment problems , as it is easy to obtain an equivalent minimization problem by converting every number in the matrix to an opportunity loss.

The conversion is accomplished by subtracting all the elements of the given matrix from the highest element. It turns out that minimizing opportunity loss produces the same assignment solution as the original maximization problem.

  • Unbalanced Assignment Problem
  • Multiple Optimal Solutions

Example: Maximization In An Assignment Problem

At the head office of www.universalteacherpublications.com there are five registration counters. Five persons are available for service.

Person
Counter A B C D E
1 30 37 40 28 40
2 40 24 27 21 36
3 40 32 33 30 35
4 25 38 40 36 36
5 29 62 41 34 39

How should the counters be assigned to persons so as to maximize the profit ?

Here, the highest value is 62. So we subtract each value from 62. The conversion is shown in the following table.

On small screens, scroll horizontally to view full calculation

Person
Counter A B C D E
1 32 25 22 34 22
2 22 38 35 41 26
3 22 30 29 32 27
4 37 24 22 26 26
5 33 0 21 28 23

Now the above problem can be easily solved by Hungarian method . After applying steps 1 to 3 of the Hungarian method, we get the following matrix.

Person
Counter A B C D E
1 10 3 8
2 16 13 15 4
3 8 7 6 5
4 15 2 4
5 33 21 24 23

Draw the minimum number of vertical and horizontal lines necessary to cover all the zeros in the reduced matrix.

Select the smallest element from all the uncovered elements, i.e., 4. Subtract this element from all the uncovered elements and add it to the elements, which lie at the intersection of two lines. Thus, we obtain another reduced matrix for fresh assignment. Repeating step 3, we obtain a solution which is shown in the following table.

Final Table: Maximization Problem

Use Horizontal Scrollbar to View Full Table Calculation

Person
Counter A B C D E
1 14 3 8
2 12 9 11
3 4 3 2 1
4 19 2 4
5 37 21 24 23

The total cost of assignment = 1C + 2E + 3A + 4D + 5B

Substituting values from original table: 40 + 36 + 40 + 36 + 62 = 214.

Share This Article

Operations Research Simplified Back Next

Goal programming Linear programming Simplex Method Transportation Problem

  • MapReduce Algorithm
  • Linear Programming using Pyomo
  • Networking and Professional Development for Machine Learning Careers in the USA
  • Predicting Employee Churn in Python
  • Airflow Operators

Machine Learning Geek

Solving Assignment Problem using Linear Programming in Python

Learn how to use Python PuLP to solve Assignment problems using Linear Programming.

In earlier articles, we have seen various applications of Linear programming such as transportation, transshipment problem, Cargo Loading problem, and shift-scheduling problem. Now In this tutorial, we will focus on another model that comes under the class of linear programming model known as the Assignment problem. Its objective function is similar to transportation problems. Here we minimize the objective function time or cost of manufacturing the products by allocating one job to one machine.

If we want to solve the maximization problem assignment problem then we subtract all the elements of the matrix from the highest element in the matrix or multiply the entire matrix by –1 and continue with the procedure. For solving the assignment problem, we use the Assignment technique or Hungarian method, or Flood’s technique.

The transportation problem is a special case of the linear programming model and the assignment problem is a special case of transportation problem, therefore it is also a special case of the linear programming problem.

In this tutorial, we are going to cover the following topics:

Assignment Problem

A problem that requires pairing two sets of items given a set of paired costs or profit in such a way that the total cost of the pairings is minimized or maximized. The assignment problem is a special case of linear programming.

For example, an operation manager needs to assign four jobs to four machines. The project manager needs to assign four projects to four staff members. Similarly, the marketing manager needs to assign the 4 salespersons to 4 territories. The manager’s goal is to minimize the total time or cost.

Problem Formulation

A manager has prepared a table that shows the cost of performing each of four jobs by each of four employees. The manager has stated his goal is to develop a set of job assignments that will minimize the total cost of getting all 4 jobs.  

Assignment Problem

Initialize LP Model

In this step, we will import all the classes and functions of pulp module and create a Minimization LP problem using LpProblem class.

Define Decision Variable

In this step, we will define the decision variables. In our problem, we have two variable lists: workers and jobs. Let’s create them using  LpVariable.dicts()  class.  LpVariable.dicts()  used with Python’s list comprehension.  LpVariable.dicts()  will take the following four values:

  • First, prefix name of what this variable represents.
  • Second is the list of all the variables.
  • Third is the lower bound on this variable.
  • Fourth variable is the upper bound.
  • Fourth is essentially the type of data (discrete or continuous). The options for the fourth parameter are  LpContinuous  or  LpInteger .

Let’s first create a list route for the route between warehouse and project site and create the decision variables using LpVariable.dicts() the method.

Define Objective Function

In this step, we will define the minimum objective function by adding it to the LpProblem  object. lpSum(vector)is used here to define multiple linear expressions. It also used list comprehension to add multiple variables.

Define the Constraints

Here, we are adding two types of constraints: Each job can be assigned to only one employee constraint and Each employee can be assigned to only one job. We have added the 2 constraints defined in the problem by adding them to the LpProblem  object.

Solve Model

In this step, we will solve the LP problem by calling solve() method. We can print the final value by using the following for loop.

From the above results, we can infer that Worker-1 will be assigned to Job-1, Worker-2 will be assigned to job-3, Worker-3 will be assigned to Job-2, and Worker-4 will assign with job-4.

In this article, we have learned about Assignment problems, Problem Formulation, and implementation using the python PuLp library. We have solved the Assignment problem using a Linear programming problem in Python. Of course, this is just a simple case study, we can add more constraints to it and make it more complicated. You can also run other case studies on Cargo Loading problems , Staff scheduling problems . In upcoming articles, we will write more on different optimization problems such as transshipment problem, balanced diet problem. You can revise the basics of mathematical concepts in  this article  and learn about Linear Programming  in this article .

  • Solving Blending Problem in Python using Gurobi

Transshipment Problem in Python Using PuLP

You may also like.

how to solve assignment problem with group restrictions

Data Visualization using Pandas

how to solve assignment problem with group restrictions

KNN Classification using Scikit-learn

  • Stack Overflow Public questions & answers
  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Talent Build your employer brand
  • Advertising Reach developers & technologists worldwide
  • Labs The future of collective knowledge sharing
  • About the company

Collectivesℱ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

Optimize event seat assignments with Corona restrictions

Problem: Given a set of group registrations, each for a varying number of people (1-7), and a set of seating groups (immutable, at least 2m apart) varying from 1-4 seats, I'd like to find the optimal assignment of people groups to seating groups:

  • People groups may be split among several seating groups (though preferably not)
  • Seating groups may not be shared by different people groups
  • (optional) the assignment should minimize the number of 'wasted' seats, i.e. maximize the number of seats in empty seating groups
  • (ideally it should run from within a Google Apps script, so memory and computational complexity should be as small as possible)

First attempt: I'm interested in the decision problem (is it feasible?) as well as the optimization problem (see optional optimization function). I've modeled it as a SAT problem, but this does not find an optimal solution.

For this reason, I've tried to model it as an optimization problem. I'm thinking along the lines of a (remote) variation of multiple-knapsack, but I haven't been able to name it yet:

  • items: seating groups (size -> weight)
  • knapsacks: people groups (size -> container size)
  • constraint: combined item weight >= container size
  • optimization: minimize the number of items

As you can see, the constraint and optimization are inverted compared to the standard problem. So my question is: Am I on the right track here or would you go about it another way? If it's correct, does this optimization problem have a name?

  • optimization
  • linear-programming
  • knapsack-problem

Josta's user avatar

  • Related: stackoverflow.com/q/8025931/572670 –  amit Oct 12, 2020 at 20:35
  • As you have already put work into modeling your problem as a SAT problem, you could use Weighted MaxSAT for solving your optimization problems. –  tphilipp Oct 13, 2020 at 18:33
  • @tphilipp good suggestion, I will look into it. I think my SAT solution may not be the best possible in that it requires quite a lot of clauses: about sp² clauses and sp variables, p being the number of people, s the number of seats. In comparison, Ruben's ILP solution below doesn't model individual people or seats, reducing the problem size by a factor of ~20 and even more so the number of constraints (#groups * #tables). I'm wondering whether Weighted MaxSAT with this SAT solution or any ILP solver for the solution proposed by Ruben would likely run more memory and time efficiently. –  Josta Oct 13, 2020 at 19:04
  • @Josta There are many ways to improve SAT encodings. Sometimes, it is not even necessary to improve it despite quadratic blowup on clauses or variables. Dependeing on the use case, SAT / MaxSAT can significantly outperform ILP or can solve instances ILP solvers cannot solve at all. The other direction holds as well –  tphilipp Oct 14, 2020 at 10:21

You could approach this as an Integer Linear Programming Problem, defined as follows:

Although this minimises the number of empty seats, it does not minimise the number of tables used or maximise the number of groups admitted. If you'd like to do that, you could expand the objective function by adding a penalty for every group turned away.

ILPs are NP-hard, so without the right solvers, it might not be possible to make this run with Google Apps. I have no experience with that, so I'm afraid I can't help you. But there are some methods to reduce your search space.

One would be through something called column generation . Here, the problem is split into two parts. The complex master problem is your main research question, but instead of the entire solution space, it tries to find the optimum from different candidate assignments (or columns).

The goal is then to define a subproblem that recommends these new potential solutions that are then incorporated in the master problem. The power of a good subproblem is that it should be reducable to a simpler model, like Knapsack or Dijkstra.

Ruben Helsloot's user avatar

  • I like the conciseness and expandability of this solution, but I share your concerns that an ILP solver may not be runnable in Google Apps even for small problem sizes (i have no LP experience, however). If I see it correctly, M * [SUM_j(t_j) - SUM_i(p_i)] is an invariant. You maybe meant to write something like M * [SUM_j[(1 - MULT_i(1 - x_ij)) * t_j] - SUM_i(p_i)] ? I also assume it should be SUM_j in the second to last line of the pseudo code. –  Josta Oct 12, 2020 at 21:31
  • You were right about SUM_j . M * [SUM_j(t_j) - SUM_i(p_i)] indeed an invariant, but I changed SUM_j(t_j) to SUM_j(SUM_i[x_ij] * t_j) to make sure free tables are not counted. Because of the other constraint, SUM_i[x_ij] is either 0 or 1 for every table –  Ruben Helsloot Oct 13, 2020 at 6:50

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged algorithm optimization linear-programming knapsack-problem sat or ask your own question .

  • The Overflow Blog
  • Introducing Staging Ground: The private space to get feedback on questions...
  • How to prevent your new chatbot from giving away company secrets
  • Featured on Meta
  • The [tax] tag is being burninated
  • The return of Staging Ground to Stack Overflow
  • The 2024 Developer Survey Is Live
  • Policy: Generative AI (e.g., ChatGPT) is banned

Hot Network Questions

  • is it correct to say "push the table by its far edge"?
  • What does the expression "Mignon country" refer to in Elsschot's "Cheese"?
  • how do I constrain a shape key
  • A man is kidnapped by his future descendants and isolated his whole life to prevent a bad thing; they accidentally undo their own births
  • Which ability checks are rolled for a shove attack?
  • What is the U.N. list of shame and how does it affect Israel which was recently added?
  • Is it legal to deposit a check that says pay to the order of cash
  • Can a Kerr black hole become super-extremal?
  • Can LLMs have intention?
  • Filter by partition number when the table is partitioned by computed column
  • Review not needed after review
  • Why do airplanes sometimes turn more than 180 degrees after takeoff?
  • Nagel line of a tetrahedron?
  • What can I plant to retain a steep slope?
  • Why didn't CPUs multiplex address pins like DRAM?
  • On a planet with 6 moons, how often would all 6 be full at the same time?
  • How does Death Ward interact with Band of Loyalty?
  • In Acts 10 why does Peter not know the gospel is not only for the Jewish people?
  • Accelerating Expansion of Universe - Why Not Caused by Radiation?
  • What’s the history behind Rogue’s ability to touch others directly without harmful effects in the comics?
  • Verifying if "Hinge Vehicle Roof Holder 1 x 4 x 2 (4214)" in blue and white is LEGO
  • Test for multicollinearity with binary and continuous independent variables
  • Handling cases of "potential" ChatGPT-generated reviews in non-anonymous program committees (as a PC member)
  • Why does White castle into Black's attack in the King's Indian, and then run away afterwards?

how to solve assignment problem with group restrictions

  

how to solve assignment problem with group restrictions



> > Assignment Problem example (Using Hungarian method)
( ) )



5. Maximization case in Assignment Problem

\ IIIIIIIV
A42352821
B30252015
C30252015
D24201612
   `I`  `II`  `III`  `IV`    
 `A` 
 `B` 
 `C` 
 `D` 
   
   `I`  `II`  `III`  `IV`    
 `A`   `0=42-42`  `7=42-35`  `14=42-28`  `21=42-21`
 `B`   `12=42-30`  `17=42-25`  `22=42-20`  `27=42-15`
 `C`   `12=42-30`  `17=42-25`  `22=42-20`  `27=42-15`
 `D`   `18=42-24`  `22=42-20`  `26=42-16`  `30=42-12`
   
   `I`  `II`  `III`  `IV`    
 `A`   `0=0-0`  `7=7-0`  `14=14-0`  `21=21-0`  Minimum element of `1^(st)` row
 `B`   `0=12-12`  `5=17-12`  `10=22-12`  `15=27-12`  Minimum element of `2^(nd)` row
 `C`   `0=12-12`  `5=17-12`  `10=22-12`  `15=27-12`  Minimum element of `3^(rd)` row
 `D`   `0=18-18`  `4=22-18`  `8=26-18`  `12=30-18`  Minimum element of `4^(th)` row
   
   `I`  `II`  `III`  `IV`    
 `A`   `0=0-0`  `3=7-4`  `6=14-8`  `9=21-12`
 `B`   `0=0-0`  `1=5-4`  `2=10-8`  `3=15-12`
 `C`   `0=0-0`  `1=5-4`  `2=10-8`  `3=15-12`
 `D`   `0=0-0`  `0=4-4`  `0=8-8`  `0=12-12`
     Minimum element of `1^(st)` column  Minimum element of `2^(nd)` column  Minimum element of `3^(rd)` column  Minimum element of `4^(th)` column
   `I`  `II`  `III`  `IV`    
 `A`   (1) Rowwise cell `(A,I)` is assigned
so columnwise cell `(B,I)`,`(C,I)`,`(D,I)` crossed off.
 `B`   Columnwise `(B,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 `C`   Columnwise `(C,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 `D`   Columnwise `(D,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 (2) Columnwise cell `(D,II)` is assigned
so rowwise cell `(D,III)`,`(D,IV)` crossed off.
 Rowwise `(D,III)` crossed off because
(2) Columnwise cell `(D,II)` is assigned
 Rowwise `(D,IV)` crossed off because
(2) Columnwise cell `(D,II)` is assigned
   
   `I`  `II`  `III`  `IV`    
 `A`   (4) Mark(✓) row `A` since column `I` has an assignment in this row `A`.
 `B`   (1) Mark(✓) row `B` since it has no assignment
 `C`   (2) Mark(✓) row `C` since it has no assignment
 `D` 
     (3) Mark(✓) column `I` since row `B` has 0 in this column
   `I`  `II`  `III`  `IV`    
 `A`   cell covered by a line  `2=3-1`
cell not covered by a line
 `5=6-1`
cell not covered by a line
 `8=9-1`
cell not covered by a line
 `B`   cell covered by a line  `0=1-1`
cell not covered by a line
 `1=2-1`
cell not covered by a line
 `2=3-1`
cell not covered by a line
 `C`   cell covered by a line  `0=1-1`
cell not covered by a line
 `1=2-1`
cell not covered by a line
 `2=3-1`
cell not covered by a line
 `D`   `1=0+1`
intersection cell of two lines
 cell covered by a line  cell covered by a line  cell covered by a line
   
   `I`  `II`  `III`  `IV`    
 `A`   (1) Rowwise cell `(A,I)` is assigned
so columnwise cell `(B,I)`,`(C,I)` crossed off.
 `B`   Columnwise `(B,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 (2) Rowwise cell `(B,II)` is assigned
so columnwise cell `(C,II)`,`(D,II)` crossed off.
 `C`   Columnwise `(C,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 Columnwise `(C,II)` crossed off because
(2) Rowwise cell `(B,II)` is assigned
 `D`   Columnwise `(D,II)` crossed off because
(2) Rowwise cell `(B,II)` is assigned
 (3) Columnwise cell `(D,III)` is assigned
so rowwise cell `(D,IV)` crossed off.
 Rowwise `(D,IV)` crossed off because
(3) Columnwise cell `(D,III)` is assigned
   
   `I`  `II`  `III`  `IV`    
 `A`   (4) Mark(✓) row `A` since column `I` has an assignment in this row `A`.
 `B`   (5) Mark(✓) row `B` since column `II` has an assignment in this row `B`.
 `C`   (1) Mark(✓) row `C` since it has no assignment
 `D` 
     (2) Mark(✓) column `I` since row `C` has 0 in this column  (3) Mark(✓) column `II` since row `C` has 0 in this column
   `I`  `II`  `III`  `IV`    
 `A`   cell covered by a line  cell covered by a line  `4=5-1`
cell not covered by a line
 `7=8-1`
cell not covered by a line
 `B`   cell covered by a line  cell covered by a line  `0=1-1`
cell not covered by a line
 `1=2-1`
cell not covered by a line
 `C`   cell covered by a line  cell covered by a line  `0=1-1`
cell not covered by a line
 `1=2-1`
cell not covered by a line
 `D`   `2=1+1`
intersection cell of two lines
 `1=0+1`
intersection cell of two lines
 cell covered by a line  cell covered by a line
   
   `I`  `II`  `III`  `IV`    
 `A`   (1) Rowwise cell `(A,I)` is assigned
so columnwise cell `(B,I)`,`(C,I)` crossed off.
 `B`   Columnwise `(B,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 (3) Rowwise cell `(B,II)` is assigned
so columnwise cell `(C,II)` crossed off.
so rowwise cell `(B,III)` crossed off.
 Rowwise `(B,III)` crossed off because
(3) Rowwise cell `(B,II)` is assigned, so columnwise cell `(C,II)` crossed off.
 `C`   Columnwise `(C,I)` crossed off because
(1) Rowwise cell `(A,I)` is assigned
 Columnwise `(C,II)` crossed off because
(3) Rowwise cell `(B,II)` is assigned
 (4) Rowwise cell `(C,III)` is assigned
 `D`   Rowwise `(D,III)` crossed off because
(2) Columnwise cell `(D,IV)` is assigned
 (2) Columnwise cell `(D,IV)` is assigned
so rowwise cell `(D,III)` crossed off.
   
   `I`  `II`  `III`  `IV`    
 `A`   Original cost 42  Original cost 35  Original cost 28  Original cost 21
 `B`   Original cost 30  Original cost 25  Original cost 20  Original cost 15
 `C`   Original cost 30  Original cost 25  Original cost 20  Original cost 15
 `D`   Original cost 24  Original cost 20  Original cost 16  Original cost 12
   
WorkJobCost
`A``I`
`B``II`
`C``III`
`D``IV`
Total99

how to solve assignment problem with group restrictions

how to solve assignment problem with group restrictions

MBA Notes

Maximisation in an Assignment Problem: Optimizing Assignments for Maximum Benefit

Table of Contents

This blog will explain how to solve assignment problems using optimization techniques to achieve maximum results. Learn the basics, step-by-step approach, and real-world applications of maximizing assignment problems.

In an assignment problem, the goal is to assign n tasks to n agents in such a way that the overall cost or benefit is minimized or maximized. The maximization problem arises when the objective is to maximize the overall benefit rather than minimize the cost.

Understanding Maximisation in an Assignment Problem

The maximization problem can be solved using the Hungarian algorithm, which is a special case of the transportation problem. The algorithm involves converting the assignment problem into a matrix, finding the minimum value in each row, and subtracting it from all the elements in that row. Similarly, we find the minimum value in each column and subtract it from all the elements in that column. This is known as matrix reduction.

Next, we cover all zeros in the matrix using the minimum number of lines. A line covers a row or column that contains a zero. If the minimum number of lines is n, an optimal solution has been found. Otherwise, we continue with the next step.

In step three, we add the minimum uncovered value to each element covered by two lines, and subtract it from each uncovered element. Then, we return to step two and repeat until an optimal solution is found.

Solving Maximisation in an Assignment Problem

The above approach provides a step-by-step process to maximize an assignment problem. Here are the steps in summary:

  • Convert the assignment problem into a matrix.
  • Reduce the matrix by subtracting the minimum value in each row and column.
  • Cover all zeros in the matrix with the minimum number of lines.
  • Add the minimum uncovered value to each element covered by two lines and subtract it from each uncovered element.
  • Repeat from step two until an optimal solution is found.

Real-World Applications

Maximization in an Assignment Problem has numerous real-world applications. For example, it can be used to optimize employee allocation to projects, to allocate tasks in a manufacturing process, or to assign jobs to machines for maximum productivity. By using optimization techniques to maximize the benefits of an assignment problem, businesses can save time, money, and resources.

This blog has provided an overview of Maximisation in an Assignment Problem, explained how to solve it using the Hungarian algorithm, and discussed real-world applications. By following the step-by-step approach, you can optimize your assignments for maximum benefit.

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you! 😔

Let us improve this post!

Tell us how we can improve this post?

Operations Research

1 Operations Research-An Overview

  • History of O.R.
  • Approach, Techniques and Tools
  • Phases and Processes of O.R. Study
  • Typical Applications of O.R
  • Limitations of Operations Research
  • Models in Operations Research
  • O.R. in real world

2 Linear Programming: Formulation and Graphical Method

  • General formulation of Linear Programming Problem
  • Optimisation Models
  • Basics of Graphic Method
  • Important steps to draw graph
  • Multiple, Unbounded Solution and Infeasible Problems
  • Solving Linear Programming Graphically Using Computer
  • Application of Linear Programming in Business and Industry

3 Linear Programming-Simplex Method

  • Principle of Simplex Method
  • Computational aspect of Simplex Method
  • Simplex Method with several Decision Variables
  • Two Phase and M-method
  • Multiple Solution, Unbounded Solution and Infeasible Problem
  • Sensitivity Analysis
  • Dual Linear Programming Problem

4 Transportation Problem

  • Basic Feasible Solution of a Transportation Problem
  • Modified Distribution Method
  • Stepping Stone Method
  • Unbalanced Transportation Problem
  • Degenerate Transportation Problem
  • Transhipment Problem
  • Maximisation in a Transportation Problem

5 Assignment Problem

  • Solution of the Assignment Problem
  • Unbalanced Assignment Problem
  • Problem with some Infeasible Assignments
  • Maximisation in an Assignment Problem
  • Crew Assignment Problem

6 Application of Excel Solver to Solve LPP

  • Building Excel model for solving LP: An Illustrative Example

7 Goal Programming

  • Concepts of goal programming
  • Goal programming model formulation
  • Graphical method of goal programming
  • The simplex method of goal programming
  • Using Excel Solver to Solve Goal Programming Models
  • Application areas of goal programming

8 Integer Programming

  • Some Integer Programming Formulation Techniques
  • Binary Representation of General Integer Variables
  • Unimodularity
  • Cutting Plane Method
  • Branch and Bound Method
  • Solver Solution

9 Dynamic Programming

  • Dynamic Programming Methodology: An Example
  • Definitions and Notations
  • Dynamic Programming Applications

10 Non-Linear Programming

  • Solution of a Non-linear Programming Problem
  • Convex and Concave Functions
  • Kuhn-Tucker Conditions for Constrained Optimisation
  • Quadratic Programming
  • Separable Programming
  • NLP Models with Solver

11 Introduction to game theory and its Applications

  • Important terms in Game Theory
  • Saddle points
  • Mixed strategies: Games without saddle points
  • 2 x n games
  • Exploiting an opponent’s mistakes

12 Monte Carlo Simulation

  • Reasons for using simulation
  • Monte Carlo simulation
  • Limitations of simulation
  • Steps in the simulation process
  • Some practical applications of simulation
  • Two typical examples of hand-computed simulation
  • Computer simulation

13 Queueing Models

  • Characteristics of a queueing model
  • Notations and Symbols
  • Statistical methods in queueing
  • The M/M/I System
  • The M/M/C System
  • The M/Ek/I System
  • Decision problems in queueing

Analysing the restricted assignment problem of the group draw in sports tournaments - arXiv

  • Download HTML
  • Download PDF

INTERIM REPORT 2019/20 - K Group Holdings

  • Food & Drink

NON-FINANCIAL INFORMATION - Appendices

  • Current Events

IBM SAN Volume Controller and Storwize Family Native IP Replication

  • IT & Technique

Ranking the biggest franchise owners in the U.S - Townnews

  • Home & Garden

Schedules Advisories - NZ Greyhound Racing

  • Cars & Machinery

2021 COMPETITION REGULATIONS - Suomen Rugbyliitto

  • Uncategorized

COMPETITION OPERATING REGULATIONS - Specific to all Senior Women and Junior Competitions including the Women's National Premier League and ...

  • World Around

BTYC GYMNASTICS 2018 Squad Athlete Handbook - Men's Artistic Gymnastics (MAG) Women's Artistic Gymnastics (WAG)

  • Style & Fashion

IRELAND SQUAD INFO PACK - GENERAL STATS FOR IRELAND -V- POOL A OPPONENTS

  • Arts & Entertainment

Cedar Park Heights Pool Parent Handbook - Piscine Cedar Park Heights - Cedar Park Pool

  • Health & Fitness

2020 Policy and Procedures For Baseball

  • Government & Politics

Fatigue and Team Performance in Soccer: Evidence from the FIFA World Cup and the UEFA European Championship - IZA DP No. 7519 Vincenzo Scoppa July ...

IMAGES

  1. Group Assignments vs Group Restrictions on an Assignment

    how to solve assignment problem with group restrictions

  2. Group Assignments vs Group Restrictions on an Assignment

    how to solve assignment problem with group restrictions

  3. Restriction Assigned in the Assignment Problem with Solved Examples

    how to solve assignment problem with group restrictions

  4. Unit 1 Lesson 20 :Solving Assignment problem

    how to solve assignment problem with group restrictions

  5. Using Group Restrictions

    how to solve assignment problem with group restrictions

  6. solve assignment problems

    how to solve assignment problem with group restrictions

VIDEO

  1. Group Anagrams

  2. SOCIAL PROBLEM GROUP 4 ENGLISH FOR GENERAL COMMUNICATION

  3. Week 15 Combined Spectral Problem Group 3

  4. Combined Spectral Problem Group 1- Camden Angell

  5. telegram sorry you are restricted currently from posting in this group

  6. RESTRICTIONS ON ASSIGNMENT PROBLEM|| OPERATIONS RESEARCH|| Lecture

COMMENTS

  1. Restriction Assigned in the Assignment Problem with Solved ...

    This lecture will give you an idea about how to solve the assignment problem when there is some additional restriction assigned to solve the problems. Other ...

  2. How to solve assignment problem with group restrictions?

    The problem could be modeled using linear programming. You can find the LP model for assignment and try to modify it. Try for some small instances to state it by hand and type it into some LP ...

  3. Assignment with Allowed Groups

    Assignment with Allowed Groups. This section describes an assignment problem in which only certain allowed groups of workers can be assigned to the tasks. In the example there are twelve workers, numbered 0 - 11. The allowed groups are combinations of the following pairs of workers. An allowed group can be any combination of three pairs of ...

  4. Restricted Assignment Problem| Assignment Problem

    In this video explains how to solve assignment problem when restrictions on assignment are given.A restricted assignment problem is the one in which one or m...

  5. Operations Research (OR) Tutorial #8: Restricted Assignment Problem

    Playlist of all my Operations Research videos-http://goo.gl/zAtbi4Today I'll tell how to solve a Restricted Assignment Problem in just 6 Easy Steps! Assignme...

  6. How to solve assignment problem with additional constraints?

    The assignment problem is defined as: Let there be n agents and m tasks. Any agent can be assigned to perform any task, incurring some costs that may vary depending on the agent-task assignment. We can assign at most one task for one person and at most one person for one task in such a way that the total cost of the assignment is maximized.

  7. PDF Unit 4 Lecturer notes of Assignment Problem of OR by Dr. G.R

    Problem 5 A typical assignment problem, presented in the classic manner, is shown in Fig. Here there are five machines to be assigned to five jobs. The numbers in the matrix indicate the cost of doing each job with each machine. Jobs with costs of M are disallowed assignments. The problem is to find the minimum cost matching of machines to jobs.

  8. Solving an Assignment Problem

    The problem is to assign each worker to at most one task, with no two workers performing the same task, while minimizing the total cost. Since there are more workers than tasks, one worker will not be assigned a task. MIP solution. The following sections describe how to solve the problem using the MPSolver wrapper. Import the libraries

  9. Assignment

    The next section shows how solve an assignment problem, using both the MIP solver and the CP-SAT solver. Other tools for solving assignment problems. OR-Tools also provides a couple of other tools for solving assignment problems, which can be faster than the MIP or CP solvers: Linear sum assignment solver; Minimum cost flow solver; However ...

  10. Assignment Problem, Maximization Example, Hungarian Method

    The Hungarian Method can also solve such assignment problems, as it is easy to obtain an equivalent minimization problem by converting every number in the matrix to an opportunity loss. The conversion is accomplished by subtracting all the elements of the given matrix from the highest element. It turns out that minimizing opportunity loss ...

  11. Assignment problem

    Worked example of assigning tasks to an unequal number of workers using the Hungarian method. The assignment problem is a fundamental combinatorial optimization problem. In its most general form, the problem is as follows: The problem instance has a number of agents and a number of tasks.Any agent can be assigned to perform any task, incurring some cost that may vary depending on the agent ...

  12. Solving Assignment Problem using Linear Programming in Python

    In this step, we will solve the LP problem by calling solve () method. We can print the final value by using the following for loop. From the above results, we can infer that Worker-1 will be assigned to Job-1, Worker-2 will be assigned to job-3, Worker-3 will be assigned to Job-2, and Worker-4 will assign with job-4.

  13. How to Solve the Assignment Problem: A Complete Guide

    Step 1: Set up the cost matrix. The first step in solving the assignment problem is to set up the cost matrix, which represents the cost of assigning a task to an agent. The matrix should be square and have the same number of rows and columns as the number of tasks and agents, respectively.

  14. Solving Assignment Problem with conditional minimum group sizes using CVXPY

    I'm using cvxpy within python to solve a particular type of assignment problem. I'd like to assign M people to N groups in a way that minimizes cost, with the following constraints on groups: Groups cannot have more than J members; If a group is populated, it has to have at least K members, otherwise a group can have zero members. Of cousre, K ...

  15. ES-3: Lesson 9. SOLUTION OF ASSIGNMENT PROBLEM

    The assignment problem can be solved by the following four methods: a) Complete enumeration method. b) Simplex Method. c) Transportation method. d) Hungarian method. 9.2.1 Complete enumeration method. In this method, a list of all possible assignments among the given resources and activities is prepared.

  16. Optimize event seat assignments with Corona restrictions

    Problem: Given a set of group registrations, each for a varying number of people (1-7), and a set of seating groups (immutable, at least 2m apart) varying from 1-4 seats, I'd like to find the optimal assignment of people groups to seating groups: People groups may be split among several seating groups (though preferably not) Seating groups may not be shared by different people groups

  17. Analysing the restricted assignment problem of the group draw in sports

    The present paper offers such an analysis of a mechanism used to solve a complex assignment problem. Several sports tournaments are organised with a group stage where the teams are assigned to groups subject to some rules. This is implemented by a draw system that satisfies the established criteria.

  18. 2 #AssignmentProblem

    How to solve an assignment problem with restrictions? (Balanced & minimization type)đŸ™đŸ»Edited & uploaded by Aditya MadhavanđŸ™đŸ»#or #operationsresearch #opti...

  19. 5. Maximization case in Assignment Problem

    Such problem can be solved by converting the given maximization problem into minimization problem by substracting all the elements of the given matrix from the highest element. ExampleFind Solution of Assignment problem using Hungarian method (MAX case) 0 `0=42-42`. 7 `7=42-35`. 14 `14=42-28`.

  20. PDF 7.13 Assignment Problem

    Enhance accuracy of solving linear systems of equations. 4 Bipartite matching. Can solve via reduction to max flow. Flow. During Ford-Fulkerson, all capacities and flows are 0/1. Flow corresponds to edges in a matching M. Residual graph G M simplifies to:! If (x, y) " M, then (x, y) is in GM.! If (x, y) # M, the (y, x) is in GM. Augmenting path ...

  21. Maximisation in an Assignment Problem: Optimizing Assignments for

    Solving Maximisation in an Assignment Problem. The above approach provides a step-by-step process to maximize an assignment problem. Here are the steps in summary: Convert the assignment problem into a matrix. Reduce the matrix by subtracting the minimum value in each row and column. Cover all zeros in the matrix with the minimum number of lines.

  22. Analysing the restricted assignment problem of the group draw in sports

    Analysing the restricted assignment problem of the group draw in sports tournaments LĂĄszlĂł Csató∗ Institute for Computer Science and Control (SZTAKI) Eötvös LorĂĄnd Research Network (ELKH) Laboratory on Engineering and Management Intelligence arXiv:2103.11353v1 [physics.soc-ph] 21 Mar 2021 Research Group of Operations Research and Decision Systems Corvinus University of Budapest (BCE ...

  23. PDF max = 1

    Q: How to solve assignment problem with group restrictions? There are N tasks and M workers. orFevery tuple task-worker the e ciency is known; orFevery task one worker