SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Types Of Graph
Tanvir Ahmed Shuvo 182-15-11576
shamiur rahman 172-15-10165
Rifat Mahmud Turag 162-15-8059
Md Abdur Rakib 182-15-11526
Sorwar Hossain 182-15-11672
Group Member List
3
We will
discuss 3
types of
graphs
BASIC
TERMINOLOGIES
REPRESENTATION
OF GRAPH
OPERATIONS
ON GRAPH
4
A directed graph G is defined as an ordered pair (V, E) where,
V is a set of vertices and the ordered pairs in E are called
edges on V. A directed graph can be represented
geometrically as a set of marked points (called vertices) V
with a set of arrows (called edges) E between pairs of points
(or vertex or nodes) so that there is at most one arrow from
one vertex to another vertex.
BASIC TERMINOLOGIES
BASIC
TERMINOLOGIES
For example, Figure shows a directed
graph, where G = {a, b, c, d }, {(a, b),
(a, d), (d, b), (d, d), (c, c)}
5
which shows the distance in km between four metropolitan cities in India.
Here V = {N, K, M, C,} E = {(N, K), (N,M,), (M,K), (M,C), (K,C)} We
= {55,47, 39, 27, 113} and Wv = {N, K, M, C} The weight at the vertices is not
necessary to maintain have become the set Wv and V are same.
An undirected graph is said to be connected if there
exist a path from any vertex to any other vertex.
Otherwise it is said to be disconnected
BASIC
TERMINOLOGIS
shows the disconnected graph,
where the vertex c is not
connected to the graph 7
BASIC
TERMINOLOGIES
REPRESENTATION OF GRAPH
The graph is a mathematical structure and finds its
application in many areas, where the problem is to be
solved by computers. The problems related to graph
G must be represented in computer memory using
any suitable data structure to solve the same. There
are two standard ways of maintaining a graph G in
the memory of a computer.
TYPES OF REPRESENTATION
OF GRAPH
Sequential representation of a graph using
adjacent
Linked representation of a graph using linked
list
10
LINKED LIST
REPRESENTATION
In this representation (also called
adjacency list representation), we store
a graph as a linked structure. First we
store all the vertices of the graph in a list
and then each adjacent vertices will be
represented using linked list node. Here terminal
vertex of an edge is stored in a structure node and
linked to a corresponding initial vertex in the list
11
The weighted graph can be represented
using a linked list by storing the
corresponding weight along with the terminal
vertex of the edge. Consider a weighted
graph in Figure, it can be represented using a
linked list as in Figure
LINKED LIST
REPRESENTATION
OPERATIONS ON GRAPH
12
01
03
02
04
05
CREATING A GRAPH
Input the total number of vertices in the graph, say n
Allocate the memory dynamically for the vertices to store in list array
Input the first vertex and the vertices through which it has edge(s) by
linking the node from list array through nodes.
Repeat the process by incrementing the list array to add other vertices
and edges.
Exit.
OPERATIONS ON GRAPH
13
01
03
02
04
05
SEARCHING AND DELETING FROM A
GRAPH
Input an edge to be searched
Search for an initial vertex of edge in list arrays by incrementing the array
index.
Once it is found, search through the link list for the terminal vertex of
the edge.
If found display “the edge is present in the graph”.
Then delete the node where the terminal vertex is found and rearrange
the link list.
06 Exit
Thank You
😊

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structures
 
Data structure
Data structureData structure
Data structure
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
Graph Data Structure
Graph Data StructureGraph Data Structure
Graph Data Structure
 
Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]
 
Data structure computer graphs
Data structure computer graphsData structure computer graphs
Data structure computer graphs
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graph
 
Graph Theory: Matrix representation of graphs
Graph Theory: Matrix representation of graphsGraph Theory: Matrix representation of graphs
Graph Theory: Matrix representation of graphs
 
Graphs in c language
Graphs in c languageGraphs in c language
Graphs in c language
 
Graphss
GraphssGraphss
Graphss
 
Graph
GraphGraph
Graph
 
Problem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - GraphsProblem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - Graphs
 
Graph
GraphGraph
Graph
 
Lecture8 data structure(graph)
Lecture8 data structure(graph)Lecture8 data structure(graph)
Lecture8 data structure(graph)
 
Graphs
GraphsGraphs
Graphs
 
Graph in Data Structure
Graph in Data StructureGraph in Data Structure
Graph in Data Structure
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Graph terminologies & special type graphs
Graph terminologies & special type graphsGraph terminologies & special type graphs
Graph terminologies & special type graphs
 

Ähnlich wie Graph (Data structure)

Ähnlich wie Graph (Data structure) (20)

Types of graphs
Types of graphsTypes of graphs
Types of graphs
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 
Graph
GraphGraph
Graph
 
Ch18
Ch18Ch18
Ch18
 
Unit-6 Graph.ppsx ppt
Unit-6 Graph.ppsx                                       pptUnit-6 Graph.ppsx                                       ppt
Unit-6 Graph.ppsx ppt
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.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
 
Magtibay buk bind#2
Magtibay buk bind#2Magtibay buk bind#2
Magtibay buk bind#2
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
 
Breadth first search
Breadth first searchBreadth first search
Breadth first search
 
Graph theory
Graph theoryGraph theory
Graph theory
 
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
 
Graphs
GraphsGraphs
Graphs
 
Graph Introduction.ppt
Graph Introduction.pptGraph Introduction.ppt
Graph Introduction.ppt
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Research
ResearchResearch
Research
 
Discrete2
Discrete2Discrete2
Discrete2
 
Discrete ad
Discrete adDiscrete ad
Discrete ad
 
Spanningtreesppt
SpanningtreespptSpanningtreesppt
Spanningtreesppt
 

Kürzlich hochgeladen

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 

Kürzlich hochgeladen (20)

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 

Graph (Data structure)

  • 2. Tanvir Ahmed Shuvo 182-15-11576 shamiur rahman 172-15-10165 Rifat Mahmud Turag 162-15-8059 Md Abdur Rakib 182-15-11526 Sorwar Hossain 182-15-11672 Group Member List
  • 3. 3 We will discuss 3 types of graphs BASIC TERMINOLOGIES REPRESENTATION OF GRAPH OPERATIONS ON GRAPH
  • 4. 4 A directed graph G is defined as an ordered pair (V, E) where, V is a set of vertices and the ordered pairs in E are called edges on V. A directed graph can be represented geometrically as a set of marked points (called vertices) V with a set of arrows (called edges) E between pairs of points (or vertex or nodes) so that there is at most one arrow from one vertex to another vertex. BASIC TERMINOLOGIES
  • 5. BASIC TERMINOLOGIES For example, Figure shows a directed graph, where G = {a, b, c, d }, {(a, b), (a, d), (d, b), (d, d), (c, c)} 5
  • 6. which shows the distance in km between four metropolitan cities in India. Here V = {N, K, M, C,} E = {(N, K), (N,M,), (M,K), (M,C), (K,C)} We = {55,47, 39, 27, 113} and Wv = {N, K, M, C} The weight at the vertices is not necessary to maintain have become the set Wv and V are same. An undirected graph is said to be connected if there exist a path from any vertex to any other vertex. Otherwise it is said to be disconnected BASIC TERMINOLOGIS
  • 7. shows the disconnected graph, where the vertex c is not connected to the graph 7 BASIC TERMINOLOGIES
  • 8. REPRESENTATION OF GRAPH The graph is a mathematical structure and finds its application in many areas, where the problem is to be solved by computers. The problems related to graph G must be represented in computer memory using any suitable data structure to solve the same. There are two standard ways of maintaining a graph G in the memory of a computer.
  • 9. TYPES OF REPRESENTATION OF GRAPH Sequential representation of a graph using adjacent Linked representation of a graph using linked list
  • 10. 10 LINKED LIST REPRESENTATION In this representation (also called adjacency list representation), we store a graph as a linked structure. First we store all the vertices of the graph in a list and then each adjacent vertices will be represented using linked list node. Here terminal vertex of an edge is stored in a structure node and linked to a corresponding initial vertex in the list
  • 11. 11 The weighted graph can be represented using a linked list by storing the corresponding weight along with the terminal vertex of the edge. Consider a weighted graph in Figure, it can be represented using a linked list as in Figure LINKED LIST REPRESENTATION
  • 12. OPERATIONS ON GRAPH 12 01 03 02 04 05 CREATING A GRAPH Input the total number of vertices in the graph, say n Allocate the memory dynamically for the vertices to store in list array Input the first vertex and the vertices through which it has edge(s) by linking the node from list array through nodes. Repeat the process by incrementing the list array to add other vertices and edges. Exit.
  • 13. OPERATIONS ON GRAPH 13 01 03 02 04 05 SEARCHING AND DELETING FROM A GRAPH Input an edge to be searched Search for an initial vertex of edge in list arrays by incrementing the array index. Once it is found, search through the link list for the terminal vertex of the edge. If found display “the edge is present in the graph”. Then delete the node where the terminal vertex is found and rearrange the link list. 06 Exit