Maximum Bipartite Matching: Maxflow Solution
Given the bipartite graph(Figure 1) shown below that we used in class, solve the problem of finding a maximum matching by reducing the problem to a maximum flow finding problem. Specifically, show the resulting flow network and residual graph after finding the maximum flow (using the basic Ford-Fulkerson algorithm). The flow network should show on every edge the flow value assigned and the capacity (e.g., f/c) and the residual graph should show on every edge the residual capacity. Additionally, write the maximum flow value and the minimum cut (e.g., () resulting from the algorithm. Note the flow values on the individual edges of the flow network may vary a bit depending on the augmenting paths found randomly during the execution of the algorithm, but the maximum flow value is certainly the same and the minimum cut found is observably the same, too.

Initial Bipartite Graph Edges
Construction of Flow Network
We add the source connected to all the leftside vertices with a capacity of 1. Then add a sink connected from all the rightside vertices with a capacity of 1. Thus all bipartite graph edges have a capacity of 1.
Execution of Ford-Fulkerson for Augmenting Paths
Thus there exists no other augmenting pairs.
Final Resulting Network Flow
Source edges:
Bipartite Edges:
Sink edges:
Residual Graph with only Residual Capacities
Forward Residual Edges:
Backward Residual Edges:
Results:
Max flow: 5
Max matching for : (with a perfect match)
Min Cut:
Thus, the cut with max capacity of 5 confirms the max flow flow/min cut theorem, where
Software Porting
Do the textbook exercise 29 in Chapter 7. Show how to solve this problem by reformulating it to the problem of finding a minimum cut from a flow network built from the set of applications and in a manner similar to the approach used in the image segmentation problem (see Section 7.10). State clearly how a flow network is constructed for a given instance of the software porting problem.
Hint. One plausible way to construct a flow network from a software porting problem can be to let the source node s represent the new system and let the sink node represent the application 1 which cannot move to the new system. Then, there’s a parallel between the software porting problem and the image segmentation problem:
- The porting benefit of an application in the software porting problem parallels the foreground likelihood of a pixel in the image segmentation problem.
- The separation expense between two applications and in the software porting problem (when only one of them is ported to the new system) parallels the separation penalty pij between two neighboring pixels and in the image segmentation problem (when one is in the foreground and the other is in the background).
Chapter 7 Exercise 29:
Some of your friends have recently graduated and started a small com- pany, which they are currently running out of their parents’ garages in Santa Clara. They’re in the process of porting all their software from an old system to a new, revved-up system; and they’re facing the following problem.
They have a collection of soft, rare applications, , running on their old system; and they’d like to port some of these to the new system. If they move application to the new system, they expect a net (monetary) benefit of . The different software applications interact with one another; if applications and have extensive interaction, then the company, will incur an expense if they move one of or to the new system but not both; let’s denote this expense by .
So, if the situation were really this simple, your friends would just port all applications, achieving a total benefit of . Unfortunately, there’s a problem …
Due to small but fundamental incompatibilities between the two systems, there’s no way to port application 1 to the new system; it will have to remain on the old system. Nevertheless, it might still pay off to port some of the other applications, accruing the associated benefit and Incurring the expense of the interaction between applications on different systems.
So this is the question they pose to you: Which of the remaining applications, ff any, should be moved? Give a polynomial-time algorithm to find a set for which the sum of the benefits minus the expenses of moving the applications in to the new system is maximized.
Min Cut Solution
We know that applications , that application 1 cannot be ported as must stay on the old system, the benefits for any porting application , and seperation expenses if and are on different systems.
We first seek to find to maximize:
We then define a new flow network construction where:
- : source representing new system
- sink representing app 1 and old system
- : note for each application
The edges and capacities can then be defined as:
For the type 3 edges, we have to use undirected edges with a capacity of , which can be implemented as two directed edges: witha capacity of and with capacity .
We can then define a cut as a separation of from , where:
- :
- :
We then let be the product set of ported apps.
Calculating cut capacity with edges crossing to :
We then connect the cut to objective by letting be the total benefit for all movable applications , writing this as:
Yielding a final alogorithm of:
With a time complexity of ( or depending on maxflow algorithm), where m is num edges in the network.