DAA UNIT 4 - Final

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

List of Important Questions

UNIT 4

ITERATIVE IMPROVEMENT

PART A

1. What is state space tree? [M/J 2016]


2. State Extreme point theorem. [M/J 2016]
3. What do you mean by perfect matching in bipartite graphs? [A/M 15]
4. Define flow 'cut'. [A/M 15]
5. What is linear programming problem?
6. What is iterative improvement method?
7. Enlist various applications of iterative improvement method.
8. What is bipartite graph?
9. What is maximum cardinality matching?
10. What is augmenting path?
11. What is entering variable?
12. State the stable marriage problem.
13. What is pivot element in simplex method?
14. What is woman optimal?
15. What is man optimal?
16. What is blocking pair?
17. Write the properties of a digraph, which is called a flow network.

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)

3. Summarize the Simplex method. (8m) [M/J2016] [N/D 2016]

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

1. What is state space tree? [M/J 2016]


Backtracking and branch bound are based on the construction of a state space tree,
whose nodes reflect specific choices made for a solution's component its root represents
an initial state before the search for a solution begins. The nodes of the first level the tree
represent the made for the first component of solution, the nodes of the second evel
represent the Choices for the second components & so on
2. State Extreme point theorem. [M/J 2016]
Any linear programming problem with a nonempty bounded feasible region has an
optimal solution; moreover, an optimal solution can always be found at an extreme point of
the problem's feasible region. Extreme point theorem states that if S is convex and
compact in a locally convex space, then S is the closed convex hull of its extreme points:
In particular, such a set has extreme points. Convex set has its extreme points at the
boundary. Extreme points should be the end points of the line connecting any two points of
convex set.
3. What do you mean by perfect matching in bipartite graphs? [A/M 15]

In a bipartite graph, a perfect matching is a matching in which each node has


exactly one incident on it.

4. Define flow 'cut'. [A/M 15]

A cut is a collection of such that if thay are removed there is no path from s to t.
For example :

5. What is linear programming problem?

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

6. What is iterative improvement method?

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.

7. Enlist various applications of iterative improvement method.

Various applications of iterative improvement method are

 Simplex method
 Matching graph vertices
 Stable marriage problem
 Finding maximum network flow

8. What is bipartite graph?

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.

9. What is maximum cardinality matching?

It is a matching with largest number of matching edges.

10. What is augmenting path?

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.

11. What is entering variable?

The entering variable is the smallest negative entry in the bottommost row of
simplex table.

12. State the stable marriage problem.

The problem can be stated as follows-


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.

13. What is pivot element in simplex method?

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.

15. What is man optimal.

Man optimal is one, which assigns to each amn the highest ranked woman possible
under any stable marriage.

16. What is blocking pair.

A pair (m,w), where m contains Y, w contains X is said to be a blocking pair for a


marriage matching M if a man m and woman w are not matched in M but they prefer each
other to their mates in M.

17. Write the properties of a digraph, which is called a flow network.

 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)

Maximum matching in Bipartite Graphs:

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.

A maximal matching is a matching M of a graph G with the property that if any


edge not in M is added to M, it is no longer a matching, that is, M is maximal if it is not a
proper subset of any other matching in graph G. In other words, a matching M of a graph
G is maximal if every edge in G has a non-empty intersection with at least one edge in M.
The following figure shows examples of maximal matching (red) in three graphs.

An alternating path is a that begins with an unmatched vertex and is a [2]path in


which the edges belong alternatively to the matching and not to the matching.
An augmenting path is an alternating path that starts from and ends on free
(unmatched) vertices.
A maximum matching (also known as maximum-cardinality matching[1]) is a
matching that contains the largest possible number of edges. There may be many
maximum matching. The matching number V(G) of a graph G is the size of a maximum
matching. Note that every maximum matching is maximal, but not every maximal matching
is a maximum matching. The following figure shows examples of maximum matchings in
the same three graphs.

Algorithm:

initialize set M of edges


initialize queue Q with all the free vertices in V
while not Empty(Q) do
w<-Front(Q)
if w V then
for every vertex u adjacent to w do
if u is free then
M<-M union (w,u)
v<- w
while v is labeled do
u<-label of v
M<-M(v,u)
v<-label of u
M<- M union (v,u)
break
else
if(w,u)
label u with w
Enqueue(Q,u)
else
v<-w's mate
label v with w
enqueue(Q,v)
return M

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

Queue empty maximum matching


4 5 6

6
DAA UNIT IV SCE/IT
2. Briefly describe on the stable marriage problem. [A/M 15] (6) [N/D 2016]

The problem can be stated as follows-

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.

Solution : The preferences are as follows


Men's Preferences

1St 2nd 3rd 4th


A Y W X Z
B W X Y Z
C Y Z W X
D Y Z W X

Women's Preferences

1St 2nd 3rd 4th


X B C D A
Y C D B A
Z C B A D
W C B D A

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

Step 3: Now A look for his next preferences and that is W

X Y Z W
A ?
B ?
C

Now woman W has to decide between B and A.


As her priority is to b than (i.e B and W) get engaged.

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

The stable marriage solution can be

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.

5. Apply the shortest Augmenting Path algorithm to the network shown


below.[16][M/J2016]

11
DAA UNIT IV SCE/IT
12
DAA UNIT IV SCE/IT

You might also like