SlideShare a Scribd company logo
1 of 22
GRAPH
What is a Graph?
•
•
•
A graph G = (V,E) is composed of:
V: set of vertices
E: set of edges connecting the vertices in V
An edge e = (u,v) is a pair of vertices
Example:
a b
c
d e
V= {a,b,c,d,e}
E= {(a,b),(a,c),
(a,d),
(b,e),(c,d),(c,e),
(d,e)}
Applications
• electronic circuits
• networks (roads, flights, communications)
CS16
JFK
LAX STL
HNL
DFW
FTL
Terminology
Adjacency
Adjacent Vertices : if
there is an edge
between two vertices.
Adjacent edges : If the
is a common vertex
between two edges
Terminology
Degree
Is a Undirected
Graph number of
Vertices adjacent
To the vertex is
Known as degree
Terminology
Path
The path is a
Sequence of distinct
Vertices such that
Two consecutive
Vertices are adjacent
a b e d c
a b
c
d e
a b
c
d e
b e d c
Terminology
Cycle
A path that has
Only one repeated
Vertices are the first
and last vertices
a b
c
d e
a c d a
More…
•
•
tree - connected graph without cycles
forest - collection of trees
tree
forest
tree
tree
tree
Types of graph
finite Graph
A graph is said to
be finite where the
number of vertices
and edges are finite
in number
A
C D
B
E
Types of graph
Infinite Graph
In an infinite graph
the number of
vertices and
numbers of edges is
infinite
A B
C
E
D
F
Types of graph
Trivial Graph
The graph is said
to be trivial if there
is only a single
vertex without any
edges
A
Types of graph
Simple Graph
A graph is said to
be simple if there is
only one and one
edge between each
vertex
A
C D
B
Types of graph
Null Graph
The graph is said
to be a null graph If
there are only
vertices exits, not
edges
A B
C D
Types of graph
Complete Graph
The graph is a complete
graph where each vertex
must be connected with
other vertices using the
edges
A
C D
B
Types of graph
Directed Graph
The directed graph is a
graph where each edge
has a direction
associated with it
A
C D
B
Types of graph
Dis connected
Graph
A graph is said to be
disconnected where
each pair in the graph is
not connected
A
C
B
D
E
F
Graph representaion in data structure
There are two types of graph representation
1). Adjacency matrix representation
2). Adjacency list representation
1). Adjacency matrix representation
An adjacency matrix is used to represent adjacent
nodes in the graph. Two nodes are said to be adjacent
if there is an edge connecting them. We represent
graph in the form of matrix in Adjacency matrix
representation. For a graph G, if there is an edge
between two vertices a and b then we denote it 1 in
matrix. If there is no edge then denote it with 0 in
Continue
For Un-Directed graph
Mi,j = 1 if there is an edge between vertex i and j.
The direction does not matter here.
and Mi,j = 0 if there is no edge between vertex i and
j.
Mi,j not equal to Mj,i
Matrix Representation of Above Graph
Direct graph
Directed graph
Directed graph
Matrix representation of direct graph
Adjacency list representation
An adjacency list is another way to represented a
graph in the computer’s memory. This structure
consists of a list of all nodes in G. Every node is in
turn linked to its own list that contains the names of
all other nodes that are adjacent to it.

More Related Content

Similar to graphs presentation .pptx

graph.pptx
graph.pptxgraph.pptx
graph.pptxhijigaf
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2showslidedump
 
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 nabatinabati
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptxARVIND SARDAR
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashingVictor Palmar
 
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
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
Data structure graphs
Data structure  graphsData structure  graphs
Data structure graphsUma mohan
 
Lecture 16 graph introduction
Lecture 16 graph introductionLecture 16 graph introduction
Lecture 16 graph introductionAbirami A
 
Graphs (Models & Terminology)
Graphs (Models & Terminology)Graphs (Models & Terminology)
Graphs (Models & Terminology)zunaira saleem
 
Graphs in datastructures
Graphs in datastructuresGraphs in datastructures
Graphs in datastructuresLikhithaGunturi
 
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structuresSavit Chandra
 
358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13sumitbardhan
 

Similar to graphs presentation .pptx (20)

graph.pptx
graph.pptxgraph.pptx
graph.pptx
 
graph ASS (1).ppt
graph ASS (1).pptgraph ASS (1).ppt
graph ASS (1).ppt
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
Graph
GraphGraph
Graph
 
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 therory
Graph theroryGraph therory
Graph therory
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptx
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
 
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
 
Spanningtreesppt
SpanningtreespptSpanningtreesppt
Spanningtreesppt
 
Chapter 1
Chapter   1Chapter   1
Chapter 1
 
Graph representation
Graph representationGraph representation
Graph representation
 
ch8.3-8.4.ppt
ch8.3-8.4.pptch8.3-8.4.ppt
ch8.3-8.4.ppt
 
Data structure graphs
Data structure  graphsData structure  graphs
Data structure graphs
 
Lecture 16 graph introduction
Lecture 16 graph introductionLecture 16 graph introduction
Lecture 16 graph introduction
 
Graphs (Models & Terminology)
Graphs (Models & Terminology)Graphs (Models & Terminology)
Graphs (Models & Terminology)
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
Graphs in datastructures
Graphs in datastructuresGraphs in datastructures
Graphs in datastructures
 
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structures
 
358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

graphs presentation .pptx

  • 2.
  • 3. What is a Graph? • • • A graph G = (V,E) is composed of: V: set of vertices E: set of edges connecting the vertices in V An edge e = (u,v) is a pair of vertices Example: a b c d e V= {a,b,c,d,e} E= {(a,b),(a,c), (a,d), (b,e),(c,d),(c,e), (d,e)}
  • 4. Applications • electronic circuits • networks (roads, flights, communications) CS16 JFK LAX STL HNL DFW FTL
  • 5. Terminology Adjacency Adjacent Vertices : if there is an edge between two vertices. Adjacent edges : If the is a common vertex between two edges
  • 6. Terminology Degree Is a Undirected Graph number of Vertices adjacent To the vertex is Known as degree
  • 7. Terminology Path The path is a Sequence of distinct Vertices such that Two consecutive Vertices are adjacent a b e d c a b c d e a b c d e b e d c
  • 8. Terminology Cycle A path that has Only one repeated Vertices are the first and last vertices a b c d e a c d a
  • 9. More… • • tree - connected graph without cycles forest - collection of trees tree forest tree tree tree
  • 10. Types of graph finite Graph A graph is said to be finite where the number of vertices and edges are finite in number A C D B E
  • 11. Types of graph Infinite Graph In an infinite graph the number of vertices and numbers of edges is infinite A B C E D F
  • 12. Types of graph Trivial Graph The graph is said to be trivial if there is only a single vertex without any edges A
  • 13. Types of graph Simple Graph A graph is said to be simple if there is only one and one edge between each vertex A C D B
  • 14. Types of graph Null Graph The graph is said to be a null graph If there are only vertices exits, not edges A B C D
  • 15. Types of graph Complete Graph The graph is a complete graph where each vertex must be connected with other vertices using the edges A C D B
  • 16. Types of graph Directed Graph The directed graph is a graph where each edge has a direction associated with it A C D B
  • 17. Types of graph Dis connected Graph A graph is said to be disconnected where each pair in the graph is not connected A C B D E F
  • 18. Graph representaion in data structure There are two types of graph representation 1). Adjacency matrix representation 2). Adjacency list representation 1). Adjacency matrix representation An adjacency matrix is used to represent adjacent nodes in the graph. Two nodes are said to be adjacent if there is an edge connecting them. We represent graph in the form of matrix in Adjacency matrix representation. For a graph G, if there is an edge between two vertices a and b then we denote it 1 in matrix. If there is no edge then denote it with 0 in
  • 19. Continue For Un-Directed graph Mi,j = 1 if there is an edge between vertex i and j. The direction does not matter here. and Mi,j = 0 if there is no edge between vertex i and j. Mi,j not equal to Mj,i Matrix Representation of Above Graph
  • 22. Adjacency list representation An adjacency list is another way to represented a graph in the computer’s memory. This structure consists of a list of all nodes in G. Every node is in turn linked to its own list that contains the names of all other nodes that are adjacent to it.