Giter Club home page Giter Club logo

e0-225_design_and_analysis_of_algorithms's Introduction

E0-225_Design_and_Analysis_of_Algorithms

This is my personal repository for E0225: Design and Analysis of Algorithms. It is a foundational course at the Computer Science department, IISc Bengaluru. It aims to develop algorithmic thinking in students. You can find my codes and assignment solution along with class notes. Feel free to fork and use. Don't hesitate to report mistakes if you find them in the documents.

Books

Algorithm Design by Jon Kleinberg and Eva Tardos.

Introduction to Algorithms by Thomas Cormen, Charles Leiserson, Ronald Rivest, and Clifford Stein.

:accessibility: Highlights of important algorithmic paradigms and their real-world applications:

Part-I: Greedy, Divide & Conquer and Dynamic Programming

Paradigm-I: Greedy Algorithm

$\bullet$ Stable Matching Problem: Galey-Shapley Algorithms and its connection to Boston-Pool algorithm

$\bullet$ Interval Scheduling: Where Greedy approach fits like a champ(!)

$\bullet$ Minimum Spanning Tree (Weighted Graph): $\bullet$ Boruvka algorithm $\bullet$ Prin-Jarnik algorithm and $\bullet$ Krushkal Algorithms

โญ (Graphic) Metroid Scheme: Power and limitations of Greedy approach

Paradigm-II: Divide and Conquer

๐ŸŽฏ $\bullet$ Breaking $\mathcal{O}(n^2)$ barrier for Multiplication: Karastuba $\mathcal{O}(n\cdot log(n))$ algorithm

๐ŸŽฏ $\bullet$ Breaking $\mathcal{O}(n^2)$ barrier for Discrete Fourier Transform: Cooley-Tuckey $\mathcal{O}(n\cdot log(n))$ algorithm a.k.a Fast Fourier Transform

$\bullet$ Recurrence Relation and Master Theorem for Divide & Conquer runtime analysis

Paradigm-III: Dynamic Programming

$\bullet$ Weighted Interval scheduling problem

โญ Shortest path in a weighted graph G(V,E):

$\bullet$ Bellman-Ford $\mathcal{O}(|E| \cdot |V|)$ algorithm

$\bullet$ Dijkstra $\mathcal{O}(|E| + |V|log|V|)$ algorithms

โญ All pair shortest path problem (APSP): Floyd-Warshall $\mathcal{O}(|V|^3)$ algorithm

โญ Knapsack problem using dynamic programming

Part-II: Maximum Flow and Minimum Cut (MFmC) Theorem

$\textbf{Maximum Flow Problem in a Graph(V,E)}:$

$\textbf{Relation of Max-Flow with Min-Cut using MFmC algorithm}:$

๐ŸŒŸ Ford-Fulkerson $\mathcal{O}(E\cdot 2^{[log(f)]})$ Algorithm, where 'f' is the maximum edge flow.

๐ŸŒŸ Improvement in Ford-Fulkerson algo. by Edmond-Karp $\mathcal{O}(V\cdot |E|^2)$ algorithm via Breath first search

โญ Orlin's Algorithm: $\mathcal{O}(V\cdot |E|)$ [Without Proof]

Applications in $\bullet$ Densest Subgraph Problem $\bullet$ Baseball elimination estimation $\bullet$ Project-resource selection problem $\bullet$ Maximum bipartile matching

Part-III: Linear Programming and Dual Problem

$Standard\ LP\ Template:$

Find a vector: $\vec{x}$

that maximize: $c^T \vec{x}$

subjected to: $A\vec{x} \le b$

and: $\vec{x}> 0$

$\textbf{Casting problems as Linear programming problem}:$

๐ŸŒŸ Maximum Flow problem in Linear programming template

๐ŸŒŸ Linear Regression with absolute error loss function

โญ Linear Classification via Support vector machine (Hinge Loss)

โญ Maximum weight bipartile matching

โญ Shortest path in a weighted graph

$\textbf{Duality in Linear Programming}:$

Primal Form:

Find a vector: $\vec{x}$

that maximize: $c^T \vec{x}$

subjected to: $A\vec{x} \le b$

and: $\vec{x}> 0$

Dual Form:

Find a vector: $\vec{y}$

that minimize: $b^T \vec{y}$

subjected to: $A^{T}\vec{y} \ge c$

and: $\vec{y}> 0$

$\textbf{Max-Flow and Min Cut as Primal-Dual LP problem}:$

$\bullet$ Primal problem: Maximum Flow in a network

$\bullet$ Dual problem: Minimum Cut in a graph

๐ŸŽฏ Interpretation of Primal and Dual problem

๐ŸŽฏ $\textbf{Weak and Strong Duality Theorem}$ for Linear Programming [Proof Omitted]

Part-IV: Skyline Problem

2-D and 3-D skyline using $\mathcal{O}(n\cdot log(n))$ algorithms

Sweep line technique with sorted points.

Binary tree data structure (BST) with the doubly linked list; Successor and Predecessor Query in BST

Chan Algorithms: $\mathcal{O}(n\cdot log(k))$; $k$ is number of skyline point

High dimensional generalization: More elaborate Data structures to solve these problems

Part-V: Approximate Algorithms

Polynomial time approximation algorithms for NP-completes problems

โญ Minimum set cover via Greedy algorithms

Greedy is the optimal approach if P is not NP: log(n)-approximate algorithms

โญ Optimal Machine-Job scheduling problem:

Naive greedy algorithms: 2-approximate algorithms

Greedy on the sorted dataset: 3/2-approximate algorithm

โญ Vertex cover via linear programming with rounding: 2-approximate algorithms

Vertex cover and set cover interconversion

Part-VI: NP-Completeness

P and NP classes

Polytime primality test (Lucas test)

Karp Reduction

3-SAT reduction to IND-SET

IND-SET reduction to vertex cover

Randomized Algorithms

Monte Carlo and Las vegas algorithms

Probabilistic techniques: Markov, Chebyshev, Chernoff bound

Application:

Hash function

Randamized median finding algotithms

Randamised SAT-solver

certain Database algorithms

Course website:

https://www.csa.iisc.ac.in/~barman/daa23/E0225.html

e0-225_design_and_analysis_of_algorithms's People

Contributors

108mk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.