Cs6402-Design and Analysis of Algorithm Two Mark Question With Answers Unit-I
Cs6402-Design and Analysis of Algorithm Two Mark Question With Answers Unit-I
Cs6402-Design and Analysis of Algorithm Two Mark Question With Answers Unit-I
Introduction
The study of algorithms is called algorithmic. It is more than a branch of computer science. It is the
core of computer science and is said to be relevant to most of science, business and technology.
3. What is an algorithm?
An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a
required output for any legitimate input in finite amount of time. An algorithm is step by step
procedure to solve a problem.
4. Give the diagram representation of Notion of algorithm.
5. What is the formula used in Euclid’s algorithm for finding the greatest common divisor of
two numbers?
Euclid‘s algorithm is based on repeatedly applying the equality Gcd(m,n)=gcd(n,m mod n) until m
mod n is equal to 0, since gcd(m,0)=m.
6. What are the three different algorithms used to find the gcd of two numbers?
The three algorithms used to find the gcd of two numbers are
UNIT – 3
PART - A
Let X be a set of vertices in a network that includes its source but does not include its sink, and
let X, the complement of X, be the rest of the vertices including the sink. The cut induced by this
partition of the vertices is the set of all the edges with a tail in X and a head in X.
Capacity of a cut is defined as the sum of capacities of the edges that compose the cut.
We‘ll denote a cut and its capacity by C(X,X) and c(X,X)
Note that if all the edges of a cut were deleted from the
network, there would be no directed path from source to sink
Minimum cut is a cut of the smallest capacity in a given network
5. State max – flow – min – cut theorem.
The value of maximum flow in a network is equal to the capacity of its minimum cut
6.Define Bipartite Graphs.
Bipartite graph: a graph whose vertices can be partitioned into two disjoint sets V and U, not
necessarily of the same size, so that every edge connects a vertex in V to a vertex in U. A graph
is bipartite if and only if it does not have a cycle of an odd length
7. What is augmentation and augmentation path?
An augmenting path for a matching M is a path from a free vertex in V to a free vertex in U whose
edges alternate between edges not in M and edges in M
The length of an augmenting path is always odd
Adding to M the odd numbered path edges and deleting from it the even numbered path
edges increases the matching size by 1 (augmentation)
One-edge path between two free vertices is special case of augmenting path.
UNIT V
COPING WITH THE LIMITATIONS OF A LGORITHM POWER
PART - A
20. What are the tricks used to reduce the size of the state-space tree?
The various tricks are
Exploit the symmetry often present in combinatorial problems. So some solutions can be
obtained by
the reflection of others. This cuts the size of the tree by about half.
Pre assign values to one or more components of a solution
Rearranging the data of a given instance.
21. What are the additional features required in branch-and-bound when
compared to
backtracking?
Compared to backtracking, branch-and-bound requires:
A way to provide, for every node of a state space tree, a bound on the best value of the
objective function on any solution that can be obtained by adding further components to the
partial solution represented by the node.
The value of the best solution seen so far
22. What is a feasible solution and what is an optimal solution?
In optimization problems, a feasible solution is a point in the problem‘s search space that satisfies all
the problem‘s constraints, while an optimal solution is a feasible solution with the best value of the
objective function.
23. When can a search path be terminated in a branch-and-bound algorithm?
A search path at the current node in a state-space tree of a branch and- bound algorithm can be
terminated if o The value of the node‘s bound is not better than the value of the best
solution seen so far
o The node represents no feasible solution because the constraints of the problem are
already violated.
o The subset of feasible solutions represented by the node consists of a single point in this
case compare the value of the objective function for this feasible solution with that of the
best solution seen so far and update the latter with the former if the new solution is better.