Posts

Showing posts with the label Greedy Algorithm

Dijkstra Algorithm

Image
 Explanation Video It works on both directed or non directed graph. Works only for +ve values of edge. This algorithm may or may not work when edges have -ve values. For example it fails in below case.

Prims and Kruskals Algorithms

Image
 Explanation Video  : We can find spanning trees for connected graphs only. Prims Algorithm : Select smallest weight edge and always select connected smallest one. Kruskals Algorithms : Select all (connected or not connected) minimum cost edges that don't form a circle and form a tree. It may find minimum weight tree from the given unconnected graph but that may not be spanning tree. Find missing edge In a given graph there can be more than one spanning trees that gives optimum result but there can be only one optimum result for spanning tree in a given graph.

Huffman Coding

Image
 Explanation  Video Compression Technic to reduce the size of the data or message.

Optimal Merge Pattern

Image
 Example Video

Job Sequencing with Deadlines

Image
 Explanation Video

Knapsack Problem

Image
Explanation Video

Greedy Algorithm

Image
Intro Video   Used to solve optimisation problems that demand either minimum or maximum result. Below are some problems : 1.  Knapsack Problem 2.  Job Sequencing with Deadlines 3.  Optimal Merge Pattern 4.  Huffman Coding 5.  Prims and Kruskals Algorithms 6.  Dijkstra Algorithm - Single Source Shortest Path Some more problems from intro ,  Greeksforgreeks