DAA UNIT 4 - Final
DAA UNIT 4 - Final
DAA UNIT 4 - Final
UNIT 4
ITERATIVE IMPROVEMENT
PART A
PART B
1. Write down the optimality condition and algorithmic implementation for finding M
augmenting paths in bipartite graphs. [A/M 15] (8)
2. Briefly describe on the stable marriage problem. [A/M 15] (6m) [N/D 2016] (8m)
4. State and Prove Maximum Flow Min cut Theorem. (8) [M/J2016] [N/D 2016]
5. Apply the shortest Augmenting Path algorithm to the network shown below. [16]
[M/J2016]
1
DAA UNIT IV SCE/IT
NOTES
UNIT 4
ITERATIVE IMPROVEMENT
PART A
A cut is a collection of such that if thay are removed there is no path from s to t.
For example :
A linear programming (LP) problem is a problem in which we are asked to find the
maximum (or minimum) value of a linear objective function.
2
DAA UNIT IV SCE/IT
p = ax + by + cz + ...
Example: p = 3x - 2y + z
This is a computational technique in which with the help of initial feasible solution
the optimal solution is obtained iteratively until no improvement is found.
Simplex method
Matching graph vertices
Stable marriage problem
Finding maximum network flow
The two colorable graph is a graph that can be colord with only two colors in such a
way that no edge connects the same color.The bipartite graph is two colorable graph.
The augmenting path P is a path in graph G, such that it is an alternating path with
special property that its start and end vertices are free unmatched.
The entering variable is the smallest negative entry in the bottommost row of
simplex table.
The intersection of entering variables colomn and departing variables row is called
pivot.
3
DAA UNIT IV SCE/IT
14. What is woman optimal.
Woman optimal is one,which assigns to each woman the highest ranked amn
possible under any stable marriage.
Man optimal is one, which assigns to each amn the highest ranked woman possible
under any stable marriage.
It contains exactly one vertex with no entering edges, this vertex is called the
source.
It contains exactly one vertex with no leaving edges this vertex is called the sink.
The weight wij of each directed edge(i,j) is a positive integer, called the edge
capacity.
PART B
1. Write down the optimality condition and algorithmic implementation for finding M
augmenting paths in bipartite graphs. [A/M 15] (8)
A Bipartite Graph is a graph whose vertices can be divided into two independent
sets, U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
from V to U. In other words, for every edge (u, v), either u belongs to U and v to V, or u
belongs to V and v to U. We can also say that there is no edge that connects vertices of
same set.
4
DAA UNIT IV SCE/IT
Given a graph G = (V,E), a matching M in G is a set of pairwise non-adjacent edges; that
is, no two edges share a common vertex.
Algorithm:
5
DAA UNIT IV SCE/IT
Example:
Apply the maximum matching algorithm to following bi partite graph.
Step 1: Step 2:
1 2 3
1 2 3
4 5 6
4 5 6
Queue = 1 2 3 Queue = 1 2 3
Augment from 5
Step 3: Step 4:
1 1 2 3
2 3
4 5 6 4 5 6
Queue = 2 3 Queue = 2 3 5
Augment from 4
Step 5: Step 6:
1 2 3
1 2 3
4 5 6
4 5 6
Queue = 2 Queue = 2 5 1
Augment from 6
Step 7:
1 2 3
6
DAA UNIT IV SCE/IT
2. Briefly describe on the stable marriage problem. [A/M 15] (6) [N/D 2016]
Consider two sets M={m1,m2,.......mn) of n men and W={ w1,w2,....wn) of n women. Each man
has a preference list ordering the women as potential marriage partners with no ties
allowed. Similarly,each womwn has a preferance list of the men,also with no ties. Then we
have to find out the marriage matching paur(m.w) whose members are selected from
these two sets based on their preferences.
Example:
Consider that there are 4 men amd 4 women. The men are named as A,B,C,D and the
women are named as X,Y,Z,W.
Women's Preferences
Step 1: Initially each men will propose a women of his first choice.
A proposes Y , B proposes W
M X Y Z W
e A ?
n
B ?
C
7
DAA UNIT IV SCE/IT
D
Step 2: When C proposes Y,Y has to decide between A and C, She redily accepts C
and they get married.
X Y Z W
A
B ?
C
X Y Z W
A ?
B ?
C
X Y Z W
A
B
C
Step 4:
X Y Z W
A
B
C
8
DAA UNIT IV SCE/IT
D
Now man A proposes his next choice that is X. Since X is not engaged, she accepts
his proposal. And A gets married with X
Step 5:
X Y Z W
A
B
C
D
Now man D has the only choice left is Z. The woman Z being free, happily accepts
D's proposal
X Y Z W
A
B
C
Algorithm:
Step 1:
Initially all the men and all the women are free, but having their own preference list
with them.
Step 2:
Propose: One of the free man m proposes the woman w. This woman is normally
the highest preferred one from his preference list.
Response: If the woman w is free then she accepts the proposal of matched m. If
she is not free, she compares the m with her current mate. If she prefers m than the
current mate then she accepts his proposal making former mate free otherwise
simply rejects m's proposal.
Step 3:
Finally, returns the matching pairs of (m,w)
9
DAA UNIT IV SCE/IT
3. Summarize the Simplex method. (8) [M/J2016] [N/D 2016]
4. State and Prove Maximum Flow Min cut Theorem. (8) [M/J2016] [N/D 2016]
Maximum Flow Problem
Problem of maximizing the flow of a material through a transportation network (e.g..
pipeline system, communications or transportation networks)
Formally represented by a connected weighted digraph with n vertices numbered from 1 to
n with the following properties:
Contains exactly one vertex with no entering edges, called the source (numbered 1)
Contains exactly one vertex with no leaving edges, called the sink (numbered n)
10
DAA UNIT IV SCE/IT
Has positive integer weight tr,) on each directed edge (i j), called the edge capacity,
indicating the upper bound on the amount of the material that can be sent from i toj
through this edge. A digraph satisfying these properties is called a flow network or
simply a network
Flow value and Maximum Flow Problem Since no material can be lost or added to by
going through intermediate vertices of the network, the total amount of the material leaving
the source must end up at the sink: E xi; = E xi. j: E j: (j,n) c E The value of the flow is
defined as the total outflow from the source (= the total inflow into the sink). The max flow
problem is to find a flow of the largest value (maximum flow) for a given network.
Max-Flow Min-Cut Theorem 1. The value of maximum flow in a network is equal to the
capacity of its minimum cut 2. The shortest augmenting path algorithm yields both a
maximum flow and a minimum cut: • Maximum flow is the final flow produced by the
algorithm • Minimum cut is formed by all the edges from the labelled vertices to unlabeled
vertices on the last iteration of the algorithm. • MI the edges from the labelled to unlabeled
vertices are full, i.e., their flow amounts are equal to the edge capacities, while all the
edges from the unlabeled to labelled vertices, if any, have zero flow amounts on them.
11
DAA UNIT IV SCE/IT
12
DAA UNIT IV SCE/IT