Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

1.What is dynamic programming?

Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive
solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming.
The idea is to simply store the results of subproblems, so that we do not have to re-compute them
when needed later. This simple optimization reduces time complexities from exponential to
polynomial.

2.What is optimization techniques?

In optimization of a design, the design objective could be simply to minimize the cost of production
or to maximize the efficiency of production. An optimization algorithm is a procedure which is
executed iteratively by comparing various solutions till an optimum or a satisfactory solution is
found. With the advent of computers, optimization has become a part of computer-aided design
activities. There are two distinct types of optimization algorithms widely used today.

(a) Deterministic Algorithms. (b) Stochastic Algorithms.

3.Write the drawbacks of dynamic programming?

1.No general formation of Dynamic Program is available; every problem has to be solving in its own
way.

2.Dividing problem in sub problem and storing inter mediate results consumes memory.

4.What are characteristic of dynamic programming?

• Builds on previous subproblems

• It only calculates enough subproblems to get to the next step

• Every subproblem you solve involves a decision

• Decisions in subproblems are not based on decisions in previous subproblems

• Optimal solutions to a subproblem is extended from previous optimal solutions

5.State the Applications of dynamic programming?

(i) Information theory.

(ii) Control theory.

(iii) Bioinformatics.

(iv) Operations research.

(v) Computer science - theory, graphics, Artificial Intelligence, etc.


6.Discuss the elements of dynamic programming?

The dynamic programming is among the most powerful for designing algorithms for optimization
problem. This is true for two reasons. Firstly, dynamic programming solutions are based on few
common elements. Secondly, dynamic programming problems are typical optimization problems
i.e., find the minimum or maximum cost solution, subject to various constraints.

In other words, this technique used for optimization problems:

• Find a solution to the problem with the optimal value.

• Then perform minimization or maximization.

7.What are the common steps to solve the dynamic programming?

Step 1 – Problem vs Subproblem

Step 2 – Breaking down formula

Step 3 – Memorization

Step 4 – Implementation

8.State the principle of optimally.

The principle of optimality is the basic principle of dynamic programming, which was developed by
Richard Bellman: that an optimal path has the property that whatever the initial conditions and
control variables (choices) over some initial period, the control (or decision variables) chosen over
the remaining period must be optimal for the remaining problem, with the state resulting from the
early decisions taken to be the initial condition.

9.What is single source shortest path technique?

The single-source shortest path problem, in which we have to find shortest paths from a source
vertex v to all other vertices in the graph. The single-destination shortest path problem, in which
we have to find shortest paths from all vertices in the directed graph to a single destination vertex
v.
10.Write the algorithm for single source shortest path?

1) Create a set sptSet (shortest path tree set) that keeps track of vertices included in shortest path

tree, i.e., whose minimum distance from source is calculated and finalized. Initially, this set is

empty.

2) 2) Assign a distance value to all vertices in the input graph. Initialize all distance values as

INFINITE. Assign distance value as 0 for the source vertex so that it is picked first.

3) While sptSet doesn’t include all vertices

….a) pick a vertex u which is not there in sptSet and has minimum distance value.

….b) Include u to sptSet.

….c) Update distance value of all adjacent vertices of u. To update the distance values, iterate

through all adjacent vertices. For every adjacent vertex v, if sum of distance value of u (from

source) and weight of edge u-v, is less than the distance value of v, then update the distance value

of v.

You might also like