SlideShare a Scribd company logo
M.PREETHA
M.Sc(information technology)
NADAR SARASWATHI COLLEGE OF ARTS
&SCIENCEech)
 A graph is an non-linear data
structure consisting of nodes and
edges.
 The nodes are sometime vertices and
edges are lines or arcs connect any
two nodes in the graph.
 A graph consists of a finite set of
vertices and set of edges which
connect pair of nodes.
 Adjacency lists are the standard way to
represent graphs.
 Edge (u,v) in appears in two list, the space
essentially doubles.
 The vertices have name which are unknown at
compile time.
 To create a new vertex object and insert the
name and vertex object into hash table.
1
3 4
6
2
7
5
 A topological sort is an ordering of vertices in
directed acyclic graph.
 A directed edge ( v,w) indicates that course v
must be completed .
 Topological ordering is not possible if the
graph has a cyclic for two vertices v & w on
the cycle.
 V precedes w and w precedes v.
1
2
3
4
5
6
7
2
4
6
6
4
6
4
5
7
7
3
3
CAP37
00
MAD31
04
COP34
00
COP32
12
COP45
55
MAD33
05
MAD35
12
COP35
30
CDA41
01
CDA44
00
COP45
40
COP56
21
CIS461
0
COP[46
10
COP42
25
DP110
V4
V1 V2
V8 V5
V6 V7
void graph::topsort()
{
Vertex v, w;
For (int counter=0;counter<NUM_VERTICES;counter++)
{
V=findNewVertexOfDegreeZero();
If (v==NOT_A_VERTEX)
Throw cyclefound()
v.topnum=counter;
For each w adjacent to v
w.indegree--;
}
}
Graphs

More Related Content

What's hot

Teaching notes slope 2015
Teaching notes slope 2015Teaching notes slope 2015
Teaching notes slope 2015
pabloelsoldado
 
Math vocabulary of eighth grade 2
Math vocabulary of eighth grade 2Math vocabulary of eighth grade 2
Math vocabulary of eighth grade 2DaisyListening
 
Abstract (English) Amalia Indrawati Gunawan 90112007
Abstract (English) Amalia Indrawati Gunawan 90112007Abstract (English) Amalia Indrawati Gunawan 90112007
Abstract (English) Amalia Indrawati Gunawan 90112007
Amalia Indrawati Gunawan
 
Graph (Data structure)
Graph (Data structure) Graph (Data structure)
Graph (Data structure)
shamiur rahman
 
6161103 2.5 cartesian vectors
6161103 2.5 cartesian vectors6161103 2.5 cartesian vectors
6161103 2.5 cartesian vectorsetcenterrbru
 
2.8 a absolute value functions
2.8 a absolute value functions2.8 a absolute value functions
2.8 a absolute value functionsfthrower
 
Graphs
GraphsGraphs
Line graphs, slope, and interpreting line graphs
Line graphs, slope, and interpreting line graphs Line graphs, slope, and interpreting line graphs
Line graphs, slope, and interpreting line graphs
Charalee
 
Lecture 16 graph introduction
Lecture 16 graph introductionLecture 16 graph introduction
Lecture 16 graph introduction
Abirami A
 
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and treeWelcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
Dyuti Islam
 
4.1coordinates
4.1coordinates4.1coordinates
4.1coordinates
vhiggins1
 
Graphing Absolute Value Functions
Graphing Absolute Value FunctionsGraphing Absolute Value Functions
Graphing Absolute Value Functions
ms.stedman
 
Geometric and Topological Data Analysis
Geometric and Topological Data AnalysisGeometric and Topological Data Analysis
Geometric and Topological Data Analysis
Don Sheehy
 
Euler’s formula
Euler’s formulaEuler’s formula
Euler’s formula
Rahul Sharma
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
Kazi Md. Saidul
 
Graph of quadratic function
Graph of quadratic functionGraph of quadratic function
Graph of quadratic function
MartinGeraldine
 
Co ordinate system
Co ordinate systemCo ordinate system
Co ordinate system
A.I.K.C. COLLEGE OF EDUCATION
 

What's hot (20)

Teaching notes slope 2015
Teaching notes slope 2015Teaching notes slope 2015
Teaching notes slope 2015
 
Math vocabulary of eighth grade 2
Math vocabulary of eighth grade 2Math vocabulary of eighth grade 2
Math vocabulary of eighth grade 2
 
Abstract (English) Amalia Indrawati Gunawan 90112007
Abstract (English) Amalia Indrawati Gunawan 90112007Abstract (English) Amalia Indrawati Gunawan 90112007
Abstract (English) Amalia Indrawati Gunawan 90112007
 
Graph (Data structure)
Graph (Data structure) Graph (Data structure)
Graph (Data structure)
 
Wew
WewWew
Wew
 
6161103 2.5 cartesian vectors
6161103 2.5 cartesian vectors6161103 2.5 cartesian vectors
6161103 2.5 cartesian vectors
 
2.8 a absolute value functions
2.8 a absolute value functions2.8 a absolute value functions
2.8 a absolute value functions
 
Graphs
GraphsGraphs
Graphs
 
Line graphs, slope, and interpreting line graphs
Line graphs, slope, and interpreting line graphs Line graphs, slope, and interpreting line graphs
Line graphs, slope, and interpreting line graphs
 
Coordinate plane ppt
Coordinate plane pptCoordinate plane ppt
Coordinate plane ppt
 
Lecture 16 graph introduction
Lecture 16 graph introductionLecture 16 graph introduction
Lecture 16 graph introduction
 
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and treeWelcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
 
4.1coordinates
4.1coordinates4.1coordinates
4.1coordinates
 
Graphing Absolute Value Functions
Graphing Absolute Value FunctionsGraphing Absolute Value Functions
Graphing Absolute Value Functions
 
Geometric and Topological Data Analysis
Geometric and Topological Data AnalysisGeometric and Topological Data Analysis
Geometric and Topological Data Analysis
 
Power functions
Power functionsPower functions
Power functions
 
Euler’s formula
Euler’s formulaEuler’s formula
Euler’s formula
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Graph of quadratic function
Graph of quadratic functionGraph of quadratic function
Graph of quadratic function
 
Co ordinate system
Co ordinate systemCo ordinate system
Co ordinate system
 

Similar to Graphs

Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashingVictor Palmar
 
Graphs.ppt
Graphs.pptGraphs.ppt
Graphs.ppt
lakshmi26355
 
Graphs.ppt of mathemaics we have to clar all doubts
Graphs.ppt of mathemaics  we have to clar all doubtsGraphs.ppt of mathemaics  we have to clar all doubts
Graphs.ppt of mathemaics we have to clar all doubts
nc3186331
 
Graph
GraphGraph
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptxBRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx
CHIRANTANMONDAL2
 
Graphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ programGraphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ program
Muhammad Danish Badar
 
Graph theory
Graph theoryGraph theory
Graph theory
AparnaKumari31
 
Graph therory
Graph theroryGraph therory
Graph therory
mohanrathod18
 
Data Structures and Agorithm: DS 21 Graph Theory.pptx
Data Structures and Agorithm: DS 21 Graph Theory.pptxData Structures and Agorithm: DS 21 Graph Theory.pptx
Data Structures and Agorithm: DS 21 Graph Theory.pptx
RashidFaridChishti
 
Graphs
GraphsGraphs
Graphs
amudha arul
 
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATIONFREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
cscpconf
 
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringGraph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Saurabh Kaushik
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabati
nabati
 
Graph
GraphGraph
data structures and algorithms Unit 2
data structures and algorithms Unit 2data structures and algorithms Unit 2
data structures and algorithms Unit 2
infanciaj
 
Topoloical sort
Topoloical sortTopoloical sort
Topoloical sort
sahilnarvekar
 
Graph Introduction.ppt
Graph Introduction.pptGraph Introduction.ppt
Graph Introduction.ppt
Faruk Hossen
 
Graphs in Data Structure
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
hafsa komal
 

Similar to Graphs (20)

Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
 
Graphs.ppt
Graphs.pptGraphs.ppt
Graphs.ppt
 
Graphs.ppt of mathemaics we have to clar all doubts
Graphs.ppt of mathemaics  we have to clar all doubtsGraphs.ppt of mathemaics  we have to clar all doubts
Graphs.ppt of mathemaics we have to clar all doubts
 
Graph
GraphGraph
Graph
 
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptxBRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx
 
Graphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ programGraphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ program
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Graph therory
Graph theroryGraph therory
Graph therory
 
Data Structures and Agorithm: DS 21 Graph Theory.pptx
Data Structures and Agorithm: DS 21 Graph Theory.pptxData Structures and Agorithm: DS 21 Graph Theory.pptx
Data Structures and Agorithm: DS 21 Graph Theory.pptx
 
Graphs
GraphsGraphs
Graphs
 
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATIONFREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
 
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringGraph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabati
 
Graph
GraphGraph
Graph
 
Graph
GraphGraph
Graph
 
data structures and algorithms Unit 2
data structures and algorithms Unit 2data structures and algorithms Unit 2
data structures and algorithms Unit 2
 
Topoloical sort
Topoloical sortTopoloical sort
Topoloical sort
 
Graph Introduction.ppt
Graph Introduction.pptGraph Introduction.ppt
Graph Introduction.ppt
 
Graphs in Data Structure
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
 
Graphs
GraphsGraphs
Graphs
 

Recently uploaded

678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 

Graphs