This is a correction docuement, due to a week of holiday from 2nd to 6 oct the numbering of notes was decremented by 1,
#FLOYD-WARSHALL Algorithm
- This is similar to dijistra algorithm but the difference is that dijistra algorithm is single source where as in this we calculate for all the vertices.
- In this problem we tend to first fill the matrix 0 with the immediate path value/cost which we get.
- then in the next step we fill the first matrix and in this we keep the intermediate point to be 1 and then find the shortest path and if the path is short we keep it otherwise we take it from the previous matrix.
- and then we complete the matrix to end and resulting end matrix will be our final solution.
- We can do this in O(n^3) time complexity.
#Independent Set in Trees
- A subset of nodes S of V is an independent set of graph G = (V,E) if there are no edges between them.
- this can be done using dynamic programming via dividing the problem in two cases in which we will calculate the maximum of independent children of w and in the other the grand children of w + 1 and then taking maximum of it and keep on doing it till we get the solution.