DAGs, SCC, Square root decomposition,.pptx

DeekshaM35 7 views 11 slides May 20, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Analysis and Design of Algorithms, Directed Acyclic Graph, SCC, Square root decomposition


Slide Content

DAGs, SCC, Square root decomposition, Asymptotiv analysis, Greedy algorithms. By Deeksha M Sr. Asst. Professor Dept of CSE AIET

Graph Terminology Graphs Multigraphs Adjacent nodes Isolated node Path Cycle Complete graph Labeled graph Weights Multiple edges Loops

Directed graph Arc Outdegree Indegree Source Sink Path matrix Directed Acyclic graph

Representation of graphs Adjacency matrix Adjacency list

Implement a program to create a graph of n vertices using adjacency matrix. Also write the code to read and print the information. Implement a program to create a graph of n vertices using adjacency list. Also write the code to read and print the information and delete the graph.

Detect a cycle in the directed graph. Detect a cycle in the undirected graph

Strongly Connected Components A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component ( SCC ) of a directed graph is a maximal strongly connected subgraph.

Square root decomposition Square root decomposition is the process of separating a structure of size O(N) into O(SQRT(N)) blocks. Square Root Decomposition Technique is one of the most common query optimization techniques used by competitive programmers. This technique helps us to reduce Time Complexity by a factor of sqrt(N) Queries of calculating sum in the range [ l,r ] Brute force->O(N) SDD->O(SQRT(N))

Asymptotic Analysis Efficiency Time complexity Space Complexity

Greedy technique Prim’s Algorithm Kruskal’s Algorithm Dijkstra’s Algorithm Huffman’s coding