SlideShare a Scribd company logo
1 of 9
GIVEN BY
PROJECT - 4
Topic : Find a Topological Sort of a Poset
Name : Bikash Behera
Regd No.: 220301120148
Section : C
Branch : B.tech (CSE)
BUSINESS PLAN
INDEX
(I) Definition, Application, Example
(II) Algorithm
(III) problems
BUSINESS PLAN
TOPOLOGICAL SORT
Topological Sort is a linear ordering of the vertices in such a way that, if there is an
edge in the DAG going from vertex ‘u’ to vertex ‘v’,
then ‘u’ comes before ‘v’ in the ordering.
•Topological Sorting is possible if and only if the graph is a directed acyclic graph.
•There may exist multiple different topological orderings for a given directed
acyclic graph.
A directed acyclic graph (DAG) is a conceptuational series of representation of a
series of activities. The order of the activities is depicted by a graph, which is
visually presented as a set of circles, each one representing an activity, some of
which are connected by lines, which represent the flow from one activity to
another
BUSINESS PLAN
APPLICATION OF TOPOLGICAL SORT
Few important applications of topological sort are :
•Scheduling jobs from the given dependencies among jobs
•Instruction Scheduling
•Determining the order of compilation tasks to perform in make files
•Data Serialization
Example - TOPOLOGICAL SORT
Consider the following directed acyclic graph –
• For this graph, following 4 different topological ordering are possible
• 1 2 3 4 5 6
• 1 2 3 4 6 5
• 1 3 2 4 5 6
• 1 3 2 4 6 5
Alogorithm:
• Topological Sorting or Kahn's algorithm is an algorithm that orders a directed
acylic graph in a way such that each node appears before all the nodes it
points to in the returned order, i.e. if we have a --> b, a must appear
before b in the topological order.
It's main usage is to detect cycles in directed graphs, since no topological order
is possible for a graph that contains a cycle. Some of it's uses are: deadlock
detection in OS, Course schedule problem etc.
Problem :
Find the number of different topological orderings possible for the given graph-
Step-1:
• Write in-degree of each vertex-
Step-2:
• Vertex-1 has the least in-degree.
• So, remove vertex-1 and its associated edges.
• Now, update the in-degree of other vertices.
Step-03:
• There are two vertices with the least in-degree. So, following 2 cases are possible-
• In case-01,
• Remove vertex-2 and its associated edges.
• Then, update the in-degree of other vertices.
• In case-02,
• Remove vertex-3 and its associated edges.
• Then, update the in-degree of other vertices.
Step-4:
• In case-01,
• Remove vertex-3 since it has the least in-
degree.
• Then, update the in-degree of other vertices.
In case-02,
• Remove vertex-2 since it has the least in-
degree.
• Then, update the in-degree of other vertices
THANKYOU

More Related Content

Similar to Discrete_4.pptx

Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)
Shiang-Yun Yang
 
Queue- 8 Queen
Queue- 8 QueenQueue- 8 Queen
Queue- 8 Queen
Ha Ninh
 

Similar to Discrete_4.pptx (20)

Queue (1)(1).ppt
Queue (1)(1).pptQueue (1)(1).ppt
Queue (1)(1).ppt
 
II B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptxII B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptx
 
Topological sorting
Topological sortingTopological sorting
Topological sorting
 
Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)
 
Lecture24
Lecture24Lecture24
Lecture24
 
Topological Sort and Shortest Path in Directed Acyclic Graph with Single Source
Topological Sort and Shortest Path in Directed Acyclic Graph with Single SourceTopological Sort and Shortest Path in Directed Acyclic Graph with Single Source
Topological Sort and Shortest Path in Directed Acyclic Graph with Single Source
 
Data Structures and Algorithms Fundamentals
Data Structures and Algorithms FundamentalsData Structures and Algorithms Fundamentals
Data Structures and Algorithms Fundamentals
 
k10790 nilesh prajapati control me 6th sem
k10790 nilesh prajapati control me 6th semk10790 nilesh prajapati control me 6th sem
k10790 nilesh prajapati control me 6th sem
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
 
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
Modern Control - Lec 04 - Analysis and Design of Control Systems using Root L...
 
WEEK 4- DLD-GateLvelMinimization.pptx
WEEK 4- DLD-GateLvelMinimization.pptxWEEK 4- DLD-GateLvelMinimization.pptx
WEEK 4- DLD-GateLvelMinimization.pptx
 
Block Diagram Algebra
Block Diagram AlgebraBlock Diagram Algebra
Block Diagram Algebra
 
DSJ_Unit I & II.pdf
DSJ_Unit I & II.pdfDSJ_Unit I & II.pdf
DSJ_Unit I & II.pdf
 
Unit ii divide and conquer -3
Unit ii divide and conquer -3Unit ii divide and conquer -3
Unit ii divide and conquer -3
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graph
 
DAA Notes.pdf
DAA Notes.pdfDAA Notes.pdf
DAA Notes.pdf
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpga
 
141205 graphulo ingraphblas
141205 graphulo ingraphblas141205 graphulo ingraphblas
141205 graphulo ingraphblas
 
141222 graphulo ingraphblas
141222 graphulo ingraphblas141222 graphulo ingraphblas
141222 graphulo ingraphblas
 
Queue- 8 Queen
Queue- 8 QueenQueue- 8 Queen
Queue- 8 Queen
 

Recently uploaded

Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...
Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...
Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...
HyderabadDolls
 
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
eqaqen
 
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
yulianti213969
 
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Angela Justice, PhD
 
Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 

Recently uploaded (20)

Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
 
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
Low Cost Coimbatore Call Girls Service 👉📞 6378878445 👉📞 Just📲 Call Ruhi Call ...
 
We’re looking for a junior patent engineer to join our Team!
We’re looking for a junior patent engineer to join our Team!We’re looking for a junior patent engineer to join our Team!
We’re looking for a junior patent engineer to join our Team!
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWN
 
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
 
Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...
Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...
Baranagar ) High Class Call Girls Kolkata - Phone 8005736733 Escorts Service ...
 
We’re looking for a Technology consultant to join our Team!
We’re looking for a Technology consultant to join our Team!We’re looking for a Technology consultant to join our Team!
We’re looking for a Technology consultant to join our Team!
 
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdfUXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
 
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
 
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
 
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
 
Call Girls Service Meerut Call Girls (Adult Only) 💯Call Us 🔝 6378878445 🔝 💃 E...
Call Girls Service Meerut Call Girls (Adult Only) 💯Call Us 🔝 6378878445 🔝 💃 E...Call Girls Service Meerut Call Girls (Adult Only) 💯Call Us 🔝 6378878445 🔝 💃 E...
Call Girls Service Meerut Call Girls (Adult Only) 💯Call Us 🔝 6378878445 🔝 💃 E...
 
Only Cash On Delivery Call Girls Service In Amritsar 📞6378878445📞 Just📲 Call ...
Only Cash On Delivery Call Girls Service In Amritsar 📞6378878445📞 Just📲 Call ...Only Cash On Delivery Call Girls Service In Amritsar 📞6378878445📞 Just📲 Call ...
Only Cash On Delivery Call Girls Service In Amritsar 📞6378878445📞 Just📲 Call ...
 
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
 
Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Anantapur [ 7014168258 ] Call Me For Genuine Models...
 
TEST BANK For Growth and Development Across the Lifespan, 3rd Edition By Glor...
TEST BANK For Growth and Development Across the Lifespan, 3rd Edition By Glor...TEST BANK For Growth and Development Across the Lifespan, 3rd Edition By Glor...
TEST BANK For Growth and Development Across the Lifespan, 3rd Edition By Glor...
 
👉 Tirunelveli Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gir...
👉 Tirunelveli Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gir...👉 Tirunelveli Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gir...
👉 Tirunelveli Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gir...
 
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
 
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
 
9352852248 Call Girls Sanand Escort Service Available 24×7 In Sanand
9352852248 Call Girls  Sanand Escort Service Available 24×7 In Sanand9352852248 Call Girls  Sanand Escort Service Available 24×7 In Sanand
9352852248 Call Girls Sanand Escort Service Available 24×7 In Sanand
 

Discrete_4.pptx

  • 1. GIVEN BY PROJECT - 4 Topic : Find a Topological Sort of a Poset Name : Bikash Behera Regd No.: 220301120148 Section : C Branch : B.tech (CSE)
  • 2. BUSINESS PLAN INDEX (I) Definition, Application, Example (II) Algorithm (III) problems
  • 3. BUSINESS PLAN TOPOLOGICAL SORT Topological Sort is a linear ordering of the vertices in such a way that, if there is an edge in the DAG going from vertex ‘u’ to vertex ‘v’, then ‘u’ comes before ‘v’ in the ordering. •Topological Sorting is possible if and only if the graph is a directed acyclic graph. •There may exist multiple different topological orderings for a given directed acyclic graph. A directed acyclic graph (DAG) is a conceptuational series of representation of a series of activities. The order of the activities is depicted by a graph, which is visually presented as a set of circles, each one representing an activity, some of which are connected by lines, which represent the flow from one activity to another
  • 4. BUSINESS PLAN APPLICATION OF TOPOLGICAL SORT Few important applications of topological sort are : •Scheduling jobs from the given dependencies among jobs •Instruction Scheduling •Determining the order of compilation tasks to perform in make files •Data Serialization
  • 5. Example - TOPOLOGICAL SORT Consider the following directed acyclic graph – • For this graph, following 4 different topological ordering are possible • 1 2 3 4 5 6 • 1 2 3 4 6 5 • 1 3 2 4 5 6 • 1 3 2 4 6 5
  • 6. Alogorithm: • Topological Sorting or Kahn's algorithm is an algorithm that orders a directed acylic graph in a way such that each node appears before all the nodes it points to in the returned order, i.e. if we have a --> b, a must appear before b in the topological order. It's main usage is to detect cycles in directed graphs, since no topological order is possible for a graph that contains a cycle. Some of it's uses are: deadlock detection in OS, Course schedule problem etc.
  • 7. Problem : Find the number of different topological orderings possible for the given graph- Step-1: • Write in-degree of each vertex- Step-2: • Vertex-1 has the least in-degree. • So, remove vertex-1 and its associated edges. • Now, update the in-degree of other vertices.
  • 8. Step-03: • There are two vertices with the least in-degree. So, following 2 cases are possible- • In case-01, • Remove vertex-2 and its associated edges. • Then, update the in-degree of other vertices. • In case-02, • Remove vertex-3 and its associated edges. • Then, update the in-degree of other vertices. Step-4: • In case-01, • Remove vertex-3 since it has the least in- degree. • Then, update the in-degree of other vertices. In case-02, • Remove vertex-2 since it has the least in- degree. • Then, update the in-degree of other vertices