SlideShare a Scribd company logo
1 of 19
Strongly Connected Components
Course: CSE
Course Teacher:
Masud Rabbani
Lecturer
Department of CSE
Daffodil International University
Presented by:
Maksudur Rahman (162-15-7955)
MD. Nazmul Hossain Mir (163-15-8386)
Abir Abdullah (162-15-7773)
MD. Raisul Islam Masum (162-15-
Connectivity
A graph is connected when there is a path between every pair of vertices. In a
connected graph, there are no unreachable vertices. A graph that is not
connected is disconnected. A graph G is said to be disconnected if there exist
two nodes in G such that no path in G has those nodes as endpoints.
A graph with just one vertex is connected. An edgeless graph with two or more
vertices is disconnected.
Connectivity
• Connected Graph
In an undirected graph G, two vertices u and v are called connected if G
contains a path from u to v. Otherwise, they are called disconnected.
A directed graph is called connected if every pair of distinct vertices in
the graph is connected
• Connected Components
A connected component is a maximal connected subgraph of G. Each
vertex belongs to exactly one connected component, as does each
edge.
Connectivity
Connected Directed GraphConnected 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. For example, there are 3 SCCs in the following graph:
Weakly Connected Components
A directed graph is called weakly connected if replacing
all of its directed edges with undirected edges produces
a connected (undirected) graph.
Connected Components
In graph theory, a connected component (or just component) of an
undirected graph is a subgraph in which any two vertices are connected
to each other by paths, and which is connected to no additional
vertices in the supergraph. For example, the graph shown in the
illustration has three connected components. A vertex with no incident
edges is itself a connected component. A graph that is itself connected
has exactly one connected component, consisting of the whole graph.
Component Graph
• GSCC = (VSCC, ESCC).
• VSCC has one vertex for each SCC in G.
• ESCC has an edge if there’s an edge between the corresponding SCC’s in G.
• GSCC for the example considered:
C1 C2
C3
C4
C1 C2
C3
C4
Transpose of a directed graph
The transpose MT of an NxN matrix M is the matrix obtained
when the rows become columns and the column become rows:
Strongly Connected Components
The transpose MT of an NxN matrix M is the matrix obtained
when the rows become columns and the column become rows:
a b c d
a
b
c
d
a b c d
a
b
c
d
a
b c
d da
b c
M MT
GT
G
Edges
have reverse
direction!
1
1 1
1
1
1
11
Algorithm to determine SCC
• Call DFS(G) to compute finishing times f[u] for each
vertex u
• Compute Transpose(G)
• Call DFS(Transpose(G)), but in the main loop of DFS,
consider the vertices in order of decreasing f[u] (as
computed in step 1)
• Output the vertices of each tree in the depth-first
forest of step 3 as a separate strong connected
component
Algorithm to determine SCC
• Step 1: Call DFS(G) to compute finishing times f[u] for each vertex u
• Running DFS starting on vertex A:
Step-2:
Step-3:Call DFS(Transpose(G)), but in the main loop of DFS, consider the vertices in
order of decreasing f[u] (as computed in step 1).
• Okay, so vertices in order of decreasing post-visit(finishing times) values:
• {E, B, A, H, G, I , C, D, F ,J}
• So at this step, we run DFS on G^T but start with each vertex from above list:
• DFS(E): {E}
• DFS(B): {B}
• DFS(A): {A}
• DFS(H): {H, I, G}
• DFS(G): remove from list since it is already visited
• DFS(I): remove from list since it is already visited
• DFS(C): {C, J, F, D}
• DFS(J): remove from list since it is already visited
• DFS(F): remove from list since it is already visited
• DFS(D): remove from list since it is already visited
Step 4: Output the vertices of each tree in the depth-first forest
of step 3 as a separate strong connected component.
So we have five strongly connected components: {E}, {B}, {A},
{H, I, G}, {C, J, F, D}
Thank you

More Related Content

What's hot

What's hot (20)

Application Of Graph Data Structure
Application Of Graph Data StructureApplication Of Graph Data Structure
Application Of Graph Data Structure
 
Heaps
HeapsHeaps
Heaps
 
Chapter 12 ds
Chapter 12 dsChapter 12 ds
Chapter 12 ds
 
Graph coloring problem
Graph coloring problemGraph coloring problem
Graph coloring problem
 
Hash tables
Hash tablesHash tables
Hash tables
 
10.m way search tree
10.m way search tree10.m way search tree
10.m way search tree
 
Graphs in Data Structure
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
 
Extensible hashing
Extensible hashingExtensible hashing
Extensible hashing
 
Graph traversals in Data Structures
Graph traversals in Data StructuresGraph traversals in Data Structures
Graph traversals in Data Structures
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Hash table
Hash tableHash table
Hash table
 
finding Min and max element from given array using divide & conquer
finding Min and max element from given array using  divide & conquer finding Min and max element from given array using  divide & conquer
finding Min and max element from given array using divide & conquer
 
Heap sort
Heap sortHeap sort
Heap sort
 
Compiler Design Unit 4
Compiler Design Unit 4Compiler Design Unit 4
Compiler Design Unit 4
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Optimal binary search tree dynamic programming
 
Hamiltonian path
Hamiltonian pathHamiltonian path
Hamiltonian path
 
Graph colouring
Graph colouringGraph colouring
Graph colouring
 
Binary Heap Tree, Data Structure
Binary Heap Tree, Data Structure Binary Heap Tree, Data Structure
Binary Heap Tree, Data Structure
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 

Similar to Strongly connected components

Analysis & design of algorithm
Analysis & design of algorithmAnalysis & design of algorithm
Analysis & design of algorithmrahela bham
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxRajitha Reddy Alugati
 
Graph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxGraph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxasimshahzad8611
 
DATA STRUCTURES.pptx
DATA STRUCTURES.pptxDATA STRUCTURES.pptx
DATA STRUCTURES.pptxKENNEDY GITHAIGA
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptxSwarndeviKm
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjtepournima055
 
FCS (graphs).pptx
FCS (graphs).pptxFCS (graphs).pptx
FCS (graphs).pptxShubhamBatwani
 
Graph Data Structure
Graph Data StructureGraph Data Structure
Graph Data StructureKeno benti
 
Connectivity of graphs
Connectivity of graphsConnectivity of graphs
Connectivity of graphssana younas
 
topological_sort_strongly Connected Components
topological_sort_strongly Connected Componentstopological_sort_strongly Connected Components
topological_sort_strongly Connected ComponentsJahidulIslam47153
 
Elements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxElements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxmiki304759
 
VANU no sql ppt.pptx
VANU no sql ppt.pptxVANU no sql ppt.pptx
VANU no sql ppt.pptxMJeyavarthini
 

Similar to Strongly connected components (20)

Analysis & design of algorithm
Analysis & design of algorithmAnalysis & design of algorithm
Analysis & design of algorithm
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptx
 
logic.pptx
logic.pptxlogic.pptx
logic.pptx
 
Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
Unit V - ppt.pptx
 
Graph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxGraph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptx
 
DATA STRUCTURES.pptx
DATA STRUCTURES.pptxDATA STRUCTURES.pptx
DATA STRUCTURES.pptx
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
Unit 9 graph
Unit   9 graphUnit   9 graph
Unit 9 graph
 
Graphs
GraphsGraphs
Graphs
 
Graphs
GraphsGraphs
Graphs
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
 
Unit ix graph
Unit   ix    graph Unit   ix    graph
Unit ix graph
 
FCS (graphs).pptx
FCS (graphs).pptxFCS (graphs).pptx
FCS (graphs).pptx
 
Graph Data Structure
Graph Data StructureGraph Data Structure
Graph Data Structure
 
Connectivity of graphs
Connectivity of graphsConnectivity of graphs
Connectivity of graphs
 
topological_sort_strongly Connected Components
topological_sort_strongly Connected Componentstopological_sort_strongly Connected Components
topological_sort_strongly Connected Components
 
Elements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxElements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptx
 
Vanmathy no sql
Vanmathy no sql Vanmathy no sql
Vanmathy no sql
 
VANU no sql ppt.pptx
VANU no sql ppt.pptxVANU no sql ppt.pptx
VANU no sql ppt.pptx
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 

More from Md Nazmul Hossain Mir

More from Md Nazmul Hossain Mir (11)

Freedom of speech
Freedom of speechFreedom of speech
Freedom of speech
 
Cyber crime-in-bangladesh
Cyber crime-in-bangladesh Cyber crime-in-bangladesh
Cyber crime-in-bangladesh
 
Bio medical image processing
Bio medical image processingBio medical image processing
Bio medical image processing
 
Challenges in-web-crawling
Challenges in-web-crawlingChallenges in-web-crawling
Challenges in-web-crawling
 
Cyclic redundancy check
Cyclic redundancy checkCyclic redundancy check
Cyclic redundancy check
 
Computer vision
Computer visionComputer vision
Computer vision
 
Artificial intelligence for diabetes case management the intersection of phys...
Artificial intelligence for diabetes case management the intersection of phys...Artificial intelligence for diabetes case management the intersection of phys...
Artificial intelligence for diabetes case management the intersection of phys...
 
Segmentation
SegmentationSegmentation
Segmentation
 
Error correction-and-type-of-error-in-c
Error correction-and-type-of-error-in-cError correction-and-type-of-error-in-c
Error correction-and-type-of-error-in-c
 
Datapath design
Datapath designDatapath design
Datapath design
 
Distributed systems
Distributed systemsDistributed systems
Distributed systems
 

Recently uploaded

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 

Recently uploaded (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 

Strongly connected components

  • 2. Course: CSE Course Teacher: Masud Rabbani Lecturer Department of CSE Daffodil International University Presented by: Maksudur Rahman (162-15-7955) MD. Nazmul Hossain Mir (163-15-8386) Abir Abdullah (162-15-7773) MD. Raisul Islam Masum (162-15-
  • 3. Connectivity A graph is connected when there is a path between every pair of vertices. In a connected graph, there are no unreachable vertices. A graph that is not connected is disconnected. A graph G is said to be disconnected if there exist two nodes in G such that no path in G has those nodes as endpoints. A graph with just one vertex is connected. An edgeless graph with two or more vertices is disconnected.
  • 4. Connectivity • Connected Graph In an undirected graph G, two vertices u and v are called connected if G contains a path from u to v. Otherwise, they are called disconnected. A directed graph is called connected if every pair of distinct vertices in the graph is connected • Connected Components A connected component is a maximal connected subgraph of G. Each vertex belongs to exactly one connected component, as does each edge.
  • 6. 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. For example, there are 3 SCCs in the following graph:
  • 7. Weakly Connected Components A directed graph is called weakly connected if replacing all of its directed edges with undirected edges produces a connected (undirected) graph.
  • 8. Connected Components In graph theory, a connected component (or just component) of an undirected graph is a subgraph in which any two vertices are connected to each other by paths, and which is connected to no additional vertices in the supergraph. For example, the graph shown in the illustration has three connected components. A vertex with no incident edges is itself a connected component. A graph that is itself connected has exactly one connected component, consisting of the whole graph.
  • 9. Component Graph • GSCC = (VSCC, ESCC). • VSCC has one vertex for each SCC in G. • ESCC has an edge if there’s an edge between the corresponding SCC’s in G. • GSCC for the example considered: C1 C2 C3 C4 C1 C2 C3 C4
  • 10. Transpose of a directed graph The transpose MT of an NxN matrix M is the matrix obtained when the rows become columns and the column become rows:
  • 11. Strongly Connected Components The transpose MT of an NxN matrix M is the matrix obtained when the rows become columns and the column become rows: a b c d a b c d a b c d a b c d a b c d da b c M MT GT G Edges have reverse direction! 1 1 1 1 1 1 11
  • 12.
  • 13. Algorithm to determine SCC • Call DFS(G) to compute finishing times f[u] for each vertex u • Compute Transpose(G) • Call DFS(Transpose(G)), but in the main loop of DFS, consider the vertices in order of decreasing f[u] (as computed in step 1) • Output the vertices of each tree in the depth-first forest of step 3 as a separate strong connected component
  • 15. • Step 1: Call DFS(G) to compute finishing times f[u] for each vertex u • Running DFS starting on vertex A:
  • 17. Step-3:Call DFS(Transpose(G)), but in the main loop of DFS, consider the vertices in order of decreasing f[u] (as computed in step 1). • Okay, so vertices in order of decreasing post-visit(finishing times) values: • {E, B, A, H, G, I , C, D, F ,J} • So at this step, we run DFS on G^T but start with each vertex from above list: • DFS(E): {E} • DFS(B): {B} • DFS(A): {A} • DFS(H): {H, I, G} • DFS(G): remove from list since it is already visited • DFS(I): remove from list since it is already visited • DFS(C): {C, J, F, D} • DFS(J): remove from list since it is already visited • DFS(F): remove from list since it is already visited • DFS(D): remove from list since it is already visited
  • 18. Step 4: Output the vertices of each tree in the depth-first forest of step 3 as a separate strong connected component. So we have five strongly connected components: {E}, {B}, {A}, {H, I, G}, {C, J, F, D}