What do these networks have in common?
For each network, we have split the vertices into two groups, blue and orange. Notice that the orange vertices are only connected to blue vertices, and the blue vertices are only connected to orange vertices - there are no edges between blue vertices, and no edges between orange ones either.
Whenever we can divide the vertices up like this, we call the network a bipartite network.
We are going to study these kinds of networks, with one group of vertices representing tasks, and the other representing agents - people, companies, countries, and so on. These are called allocation problems (sometimes assignment problems).
Let's consider the following situation:
Paula, Rohan and Erin are working together on a group project over the weekend. There are a number of tasks that need to get done, but each student is better at some things and worse at others. This table shows how many hours it would take for them to do each part of the project:
Making the poster | Writing the report | Writing the speech | |
---|---|---|---|
\text{Paula} | 10 | 5 | 8 |
\text{Rohan} | 6 | 7 | 12 |
\text{Erin} | 9 | 8 | 5 |
Once every task is completed, they get to go home. Who should do what part to make sure they can go home the earliest?
There are two ways we can represent this same information - one is by using a matrix:
\begin{pmatrix} 10 & 5 & 8\\ 6 & 7 & 12 \\ 9 & 8 & 5 \end{pmatrix}
The matrix is just a more condensed version of the table. A more interesting way is to represent the information using a bipartite network:
We use a bipartite network since every person is connected to every task, but a person isn’t connected to a person, or a task to a task.
We want to pick out three edges so that each person and task has exactly one edge coming out of it, forming an allocation. Here are two ways we could do it:
In the first allocation, the group has to stay for 12 hours, since Rohan takes 12 hours to do the speech while Paula and Erin wait around. The second allocation is a little better since the group stays for 8 hours and, in this allocation, it’s Rohan who does the waiting. What is the best allocation possible?
With some further investigation, we would find that this is the best allocation possible:
This allocation has the group only taking 6 hours to complete the project, half the time of the first allocation we tried. It is the optimum allocation.
We may have spotted this allocation straight away just by looking at the table. It allocates everyone the task that they’re best at. But this isn’t always the case, so be sure to check thoroughly.
Consider the following bipartite graph.
Which of the following allocations agree with the bipartite graph?
Which of the following bipartite graphs represent the given reduced table?
A | B | C | D | |
---|---|---|---|---|
M | 0 | 4 | 0 | 3 |
N | 8 | 9 | 1 | 0 |
O | 5 | 0 | 3 | 7 |
P | 0 | 4 | 0 | 0 |
Bipartite networks are networks to represent allocation problems.
Allocation problems require connecting agents to one or more tasks, preferably with the lowest weights.
Now we can investigate a procedure that guarantees the best allocation possible. We will learn to find the optimal allocation using the Hungarian Algorithm with its network version.
Here’s a summary of the Hungarian algorithm (network version):
Subtract the lowest weight of edges coming out of each vertex on the left from the others.
Subtract the lowest weight of edges coming out of each vertex on the right from the others.
Identify if there are any paths of three 0-edges. If so, mark the middle edge of those paths. Subtract the lowest nonzero weight from all other nonzero weightings in the network, but add this weight to the marked 0-edge(s).
Harvey, Kiara, and Dao are on the medical support team for a company that runs events. There are events at three major cities this weekend, and the cost for each of them to travel to each city is given in the table below:
Sydney | Melbourne | Perth | |
---|---|---|---|
\text{Harvey} | \$200 | \$250 | \$320 |
\text{Kiara} | \$280 | \$300 | \$250 |
\text{Dao} | \$300 | \$470 | \$510 |
Which allocation costs the least money overall?
Here’s a summary of the Hungarian algorithm (network version):
Subtract the lowest weight of edges coming out of each vertex on the left from the others.
Subtract the lowest weight of edges coming out of each vertex on the right from the others.
Identify if there are any paths of three 0-edges. If so, mark the middle edge of those paths. Subtract the lowest nonzero weight from all other nonzero weightings in the network, but add this weight to the marked 0-edge(s).
There is a second way to find the optimum allocation from within the table itself, without ever drawing a bipartite network. This can be very useful when there would be a lot of vertices and edges, since the network can get very crowded.
Here’s a summary of the Hungarian algorithm (matrix version):
Subtract the lowest number in each row from every number in that row.
Subtract the lowest number in each column from every number in that column.
Cover the 0’s with the minimum number of lines. If the number of lines required is less than the total number of rows (or columns), subtract the smallest nonzero value in the matrix from all other nonzero values, and add this value to any number covered by two lines. Then read off the optimum allocation.
The matrix version saves space, is easier to enter into a computer, and makes the tricky cases a lot easier to spot and deal with. But the network version inspired this one, and is easiest for smaller allocations. Use the one you like the best.
A limousine company has to dispatch 3 cars to 3 different locations. The following table displays the traveling cost (in dollars) of each limousine to each area.
\text{Locations and Cars} | A_1 | A_2 | A_3 |
---|---|---|---|
L_1 | 29 | 37 | 22 |
L_2 | 32 | 27 | 26 |
L_3 | 33 | 34 | 25 |
Use the Hungarian algorithm to find the allocation which uses the minimum cost.
What is the minimum cost of travel?
Here’s a summary of the Hungarian algorithm (matrix version):
Subtract the lowest number in each row from every number in that row.
Subtract the lowest number in each column from every number in that column.
Cover the 0’s with the minimum number of lines. If the number of lines required is less than the total number of rows (or columns), subtract the smallest nonzero value in the matrix from all other nonzero values, and add this value to any number covered by two lines. Then read off the optimum allocation.