UNIT3
UNIT3
Dynamic Programming: General Method, All pairs shortest paths, Single Source Shortest Paths –
General Weights (Bellman Ford Algorithm), Optimal Binary Search Trees, 0/1 Knapsack, String Editing,
Travelling Salesperson problem
Greedy method: It is most straight forward method. It is popular for obtaining the optimized solutions.
Optimization Problem: An optimization problem is the problem of finding the best solution (optimal
solution) from all the feasible solutions (practicable of possible solutions). In an optimization problem
we are given a set of constraints and an optimization functions. Solutions that satisfy the constraints are
called feasible solutions. A feasible solution for which the optimization function has the best possible
value is called optimal solution. Ex: Problem: Finding a minimum spanning tree from a weighted
connected directed graph G.
Constraints: Every time a minimum edge is added to the tree and adding of an edge does not form a
simple circuit.
Feasible solutions: The feasible solutions are the spanning trees of the given graph G.
Optimal solution: An optimal solution is a spanning tree with minimum cost i.e. minimum spanning tree.