Divide & Conquer Algorithms

202401160914
Status: #idea
Tags: DAA

Divide & Conquer Algorithms

Main Steps

  1. Dividing the problem into smaller sub-problems
  2. Solving these sub-problems
  3. Combining the solutions for those smaller sub-problems to solve the original problem
Note

Recursive algorithms are good candidates for distributed algorithms

Analysing D&C Algorithms

Longest Path Problem

Complete Graph
A graph where every node is connected to every other node by a unique edge.

Coin Change Problem

c[i][0]=0c[i][j]={1+c[i][jd[i]]if ith coin is usedc[i1][j]if ith coin is NOT usedc[i][j]=min(c[i1][j],1+c[i][jd[i]])

Optimal Substructure Property

If C is a point on the shortest path from AB, then the path from AC is the shortest path for this sub-problem

This does NOT apply to longest path

Proof of Optimal Substruvture Property


References