SlideShare a Scribd company logo
Data structure
Topological Sort ?
-it   is ordering of vertices in a directed acyclic group .

If its path vi to vj then vj appears after vi in the ordering

 Topological ordering is not possible if the graph has acyclic ?.


      E.g:         v1                    v2



         v3                   v4
                                                       v5



                    v6                        v7
Algorithm for topologies :

    •    Create an array of length equal to the number of vertices.

• While the number of vertices is greater than 0, repeat:
.



    :•   Find a vertex with no incoming edges (“no prerequisites”).
    .


    • Put this vertex in the array.

    .•Note that this destructively updates a graph; often this is a
    bad idea, so make a copy of the graph first and do
    topological sort on the copy.
Topological Sort Algorithm
    The Topological sort algorithm is:
int topologicalOrderTraversal( ){
    int numVisitedVertices = 0;
    while(there are more vertices to be visited){
         if(there is no vertex with in-degree 0)
               break;
         else{
         select a vertex v that has in-degree 0;
         visit v;
         numVisitedVertices++;
         delete v and all its emanating edges;
       }
    }

     return numVisitedVertices;
}
Just we take this example 4 solve topological graph




      Here a=0 because in degree is 4 ‘a’
Graph 1
vertex   A   B   C   D   E   F   G   H

A        0   1   1   0   1   0   0   0

B        0   0   0   0   0   1   0   0

C        0   0   0   1   0   1   1   0

D        0   1   0   0   1   0   0   1

E        0   0   0   0   0   1   0   0

F        0   0   0   0   0   0   0   1

G        0   0   0   0   1   0   0   1

h        0   0   0   0   0   0   0   0

Sum      0   2   1   1   3   3   1   3
of
colum
Data structure
Data structure
• Overview
– Terms
• Topics
– Ethernet-Standard
– Network topologies
• Bus topology
• Ring topology
• Star topology
• Fully connected topology
• Mesh topology
– IPv4 & IPv6
• Prototype of the Ethernet Standard
• Characteristics:
– A central cable (coaxial cable)
– Lines to the attached stations
– Decentralized structure (stations with equal standing)
– All attached stations are affected by disturbance at the central
cable
RING Topology
• One token "moves" in the circle (Ring
structure of the network)
• If the token is "free", then the station
can attach a network package



                  RING TYPE
Data structure

More Related Content

PDF
Skiena algorithm 2007 lecture12 topological sort connectivity
PDF
Algorithms of graph
PDF
Topological Sort
PPT
Directed Acyclic Graph
PPT
Prim's Algorithm on minimum spanning tree
PPT
Single source stortest path bellman ford and dijkstra
PPT
Topological sort
PPT
bode_plot By DEV
Skiena algorithm 2007 lecture12 topological sort connectivity
Algorithms of graph
Topological Sort
Directed Acyclic Graph
Prim's Algorithm on minimum spanning tree
Single source stortest path bellman ford and dijkstra
Topological sort
bode_plot By DEV

What's hot (20)

PPTX
Algorithm Design and Complexity - Course 7
PPT
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
PPT
Biconnected components (13024116056)
PPTX
Graph Algorithms: Breadth-First Search (BFS)
PPT
Bellman Ford's Algorithm
DOC
BFS, Breadth first search | Search Traversal Algorithm
PDF
All pairs shortest path algorithm
PPT
Dijksatra
PPT
SINGLE-SOURCE SHORTEST PATHS
PPTX
Shortest path algorithm
PPT
The Floyd–Warshall algorithm
PPT
Spanning trees
PPTX
Spanning trees & applications
PPT
2.5 graph dfs
PPTX
PPTX
Bellman ford Algorithm
PPTX
Minimal spanning tree class 15
PDF
21 All Pairs Shortest Path
PDF
Network flow problems
PDF
18 Basic Graph Algorithms
Algorithm Design and Complexity - Course 7
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Biconnected components (13024116056)
Graph Algorithms: Breadth-First Search (BFS)
Bellman Ford's Algorithm
BFS, Breadth first search | Search Traversal Algorithm
All pairs shortest path algorithm
Dijksatra
SINGLE-SOURCE SHORTEST PATHS
Shortest path algorithm
The Floyd–Warshall algorithm
Spanning trees
Spanning trees & applications
2.5 graph dfs
Bellman ford Algorithm
Minimal spanning tree class 15
21 All Pairs Shortest Path
Network flow problems
18 Basic Graph Algorithms
Ad

Viewers also liked (20)

PPT
Graphical Tool Kit 2
PPT
Economic development
PPT
Interactively Evolving User Interfaces
PPTX
IP fundamentals
PPTX
UXD – What is User Experience Design?
PPTX
Mobile Mondays @ BASIS - welcoming GBG
PPTX
Usability and UXd for apps - by Bonolota UXd at Microsoft Bangladesh
PDF
Jadu pc by bonolota glimpse for public
PPTX
GDG Dhaka - UX quick talk - Masrur Hannan
PPTX
Renewable Energy
PPTX
Website visitor’s experience ‘don’t make them think' - masur hannan - 3 nov...
PPT
Usability Tips And Tricks For Beginners Experience Dynamics Web Seminar
PPTX
Teaching UXD - Camp digital 2014
PPTX
UX for Apps - GDG at BUET 9 Nov 2013 Masrur Hannan and Shadman Rahman
PPTX
UX session by Bonolota UXd at BICC - Digital World and BASIS Soft Expo 2014
PDF
UXD HK Info Session
PPT
Designing For Interaction
PDF
IxD & UX Design - Personifying Digital Interactions
PPT
User Experience Design Introduction
PDF
UX & RIAs: UI Design Challenges (ERGOSIGN)
Graphical Tool Kit 2
Economic development
Interactively Evolving User Interfaces
IP fundamentals
UXD – What is User Experience Design?
Mobile Mondays @ BASIS - welcoming GBG
Usability and UXd for apps - by Bonolota UXd at Microsoft Bangladesh
Jadu pc by bonolota glimpse for public
GDG Dhaka - UX quick talk - Masrur Hannan
Renewable Energy
Website visitor’s experience ‘don’t make them think' - masur hannan - 3 nov...
Usability Tips And Tricks For Beginners Experience Dynamics Web Seminar
Teaching UXD - Camp digital 2014
UX for Apps - GDG at BUET 9 Nov 2013 Masrur Hannan and Shadman Rahman
UX session by Bonolota UXd at BICC - Digital World and BASIS Soft Expo 2014
UXD HK Info Session
Designing For Interaction
IxD & UX Design - Personifying Digital Interactions
User Experience Design Introduction
UX & RIAs: UI Design Challenges (ERGOSIGN)
Ad

Similar to Data structure (20)

PPT
Unit24_TopologicalSort (2).ppt
PPT
Unit24_TopologicalSort.ppt data structures
PPTX
kjugyfdtryuytrdtfyugtfdxghjgfdial algorithm.pptx
PPTX
Internet Download Manager Crack Patch Latest IDM Free
PPTX
Topological Sort Algorithm.pptx
PPTX
Topological Sorting
PPT
25-graphs4-topological-sort.ppt data structures
PPTX
an EN Mean Value Theorem by Slidesgo.pptx
PPTX
an introduction to Topological Sort.pptx
PDF
Graph applications chapter
PPTX
Graph.pptxGraph.pptxGraph.pptxGraph.pptxGraph.pptxGraph.pptxGraph.pptx
PPTX
Topological sorting
PPTX
Topoloical sort
PPTX
Topological sort
PPTX
topologicalsort-using c++ as development language.pptx
PPTX
Introduction to graphs
PPTX
Topological sort
PPTX
Lecture-12-CS345A-2023 of Design and Analysis
PDF
Unit ii divide and conquer -3
Unit24_TopologicalSort (2).ppt
Unit24_TopologicalSort.ppt data structures
kjugyfdtryuytrdtfyugtfdxghjgfdial algorithm.pptx
Internet Download Manager Crack Patch Latest IDM Free
Topological Sort Algorithm.pptx
Topological Sorting
25-graphs4-topological-sort.ppt data structures
an EN Mean Value Theorem by Slidesgo.pptx
an introduction to Topological Sort.pptx
Graph applications chapter
Graph.pptxGraph.pptxGraph.pptxGraph.pptxGraph.pptxGraph.pptxGraph.pptx
Topological sorting
Topoloical sort
Topological sort
topologicalsort-using c++ as development language.pptx
Introduction to graphs
Topological sort
Lecture-12-CS345A-2023 of Design and Analysis
Unit ii divide and conquer -3

More from sumit singh (7)

PPTX
Growth hacking
PPTX
UI/UX Design
PPTX
microprocessor
PPTX
Gsm architecture
PPTX
Gprs persentation
PPTX
System software
PPTX
3G communication
Growth hacking
UI/UX Design
microprocessor
Gsm architecture
Gprs persentation
System software
3G communication

Recently uploaded (20)

PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Pharma ospi slides which help in ospi learning
PDF
RMMM.pdf make it easy to upload and study
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Cell Structure & Organelles in detailed.
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Basic Mud Logging Guide for educational purpose
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Types and Its function , kingdom of life
Microbial diseases, their pathogenesis and prophylaxis
TR - Agricultural Crops Production NC III.pdf
Sports Quiz easy sports quiz sports quiz
Pharma ospi slides which help in ospi learning
RMMM.pdf make it easy to upload and study
VCE English Exam - Section C Student Revision Booklet
Cell Structure & Organelles in detailed.
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Institutional Correction lecture only . . .
Basic Mud Logging Guide for educational purpose
PPH.pptx obstetrics and gynecology in nursing
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Final Presentation General Medicine 03-08-2024.pptx

Data structure

  • 2. Topological Sort ? -it is ordering of vertices in a directed acyclic group . If its path vi to vj then vj appears after vi in the ordering Topological ordering is not possible if the graph has acyclic ?. E.g: v1 v2 v3 v4 v5 v6 v7
  • 3. Algorithm for topologies : • Create an array of length equal to the number of vertices. • While the number of vertices is greater than 0, repeat: . :• Find a vertex with no incoming edges (“no prerequisites”). . • Put this vertex in the array. .•Note that this destructively updates a graph; often this is a bad idea, so make a copy of the graph first and do topological sort on the copy.
  • 4. Topological Sort Algorithm The Topological sort algorithm is: int topologicalOrderTraversal( ){ int numVisitedVertices = 0; while(there are more vertices to be visited){ if(there is no vertex with in-degree 0) break; else{ select a vertex v that has in-degree 0; visit v; numVisitedVertices++; delete v and all its emanating edges; } } return numVisitedVertices; }
  • 5. Just we take this example 4 solve topological graph Here a=0 because in degree is 4 ‘a’
  • 6. Graph 1 vertex A B C D E F G H A 0 1 1 0 1 0 0 0 B 0 0 0 0 0 1 0 0 C 0 0 0 1 0 1 1 0 D 0 1 0 0 1 0 0 1 E 0 0 0 0 0 1 0 0 F 0 0 0 0 0 0 0 1 G 0 0 0 0 1 0 0 1 h 0 0 0 0 0 0 0 0 Sum 0 2 1 1 3 3 1 3 of colum
  • 9. • Overview – Terms • Topics – Ethernet-Standard – Network topologies • Bus topology • Ring topology • Star topology • Fully connected topology • Mesh topology – IPv4 & IPv6
  • 10. • Prototype of the Ethernet Standard • Characteristics: – A central cable (coaxial cable) – Lines to the attached stations – Decentralized structure (stations with equal standing) – All attached stations are affected by disturbance at the central cable
  • 11. RING Topology • One token "moves" in the circle (Ring structure of the network) • If the token is "free", then the station can attach a network package RING TYPE