SlideShare a Scribd company logo
Graphs
Introduction to Graphs
Definition: A simple graph G = (V, E) consists of V, a
nonempty set of vertices, and E, a set of unordered
pairs of distinct elements of V called edges.
Definition: A directed graph G = (V, E) consists of a set
V of vertices and a set E of edges that are ordered
pairs of elements in V.
• A simple graph is just like a directed graph, but with
no specified direction of its edges.
Graph Models
•Example I: How can we represent a network of (bi-
directional) railways connecting a set of cities?
•We should use a simple graph with an edge {a, b}
indicating a direct train connection between cities a and b.
Faisalabad
Lahore
Islamabad
Multan
Karachi
Quetta
Graph Models
•Example II: In a round-robin tournament, each team plays
against each other team exactly once. How can we
represent the results of the tournament (which team beats
which other team)?
•We should use a directed graph with an edge (a, b)
indicating that team a beats team b.
Khi
ISB
FSD
Lhr
Graph Terminology
•Definition: Two vertices u and v in an undirected
graph G are called adjacent (or neighbors) in G if {u, v}
is an edge in G.
•If e = {u, v}, the edge e is called incident with the
vertices u and v. The edge e is also said to connect u
and v.
•The vertices u and v are called endpoints of the edge
{u, v}.
Graph Terminology
Definition: The degree of a vertex in an undirected graph
is the number of edges incident with it, except that a
loop at a vertex contributes twice to the degree of that
vertex.
•In other words, you can determine the degree of a
vertex in a displayed graph by counting the lines that
touch it.
•The degree of the vertex v is denoted by deg(v).
Graph Terminology
•A vertex of degree 0 is called isolated, since it is not
adjacent to any vertex.
•Note: A vertex with a loop at it has at least degree 2 and,
by definition, is not isolated, even if it is not adjacent to
any other vertex.
•A vertex of degree 1 is called pendant. It is adjacent to
exactly one other vertex.
Graph Terminology
Example: Which vertices in the following graph are
isolated, which are pendant, and what is the maximum
degree? What type of graph is it?
a
b
c
d
f h
g
jf
e
Solution: Vertex f is isolated, and vertices a, d and j are pendant.
The maximum degree is deg(g) = 5.
This graph is a pseudograph (undirected, loops).
Graph Terminology
•Let us look at the same graph again and determine the
number of its edges and the sum of the degrees of all its
vertices:
a
b
c
d
f h
g
jf
e
Result: There are 9 edges, and the sum of all degrees is 18. This
is easy to explain: Each new edge increases the sum of degrees
by exactly two.
Graph Terminology
•The Handshaking Theorem: Let G = (V, E) be an
undirected graph with e edges. Then
2e = vV deg(v)
•Example: How many edges are there in a graph with 10
vertices, each of degree 6?
•Solution: The sum of the degrees of the vertices is 610 =
60. According to the Handshaking Theorem, it follows
that 2e = 60, so there are 30 edges.
Graph Terminology
•Definition: When (u, v) is an edge of the graph G with
directed edges, u is said to be adjacent to v, and v is said
to be adjacent from u.
•The vertex u is called the initial vertex of (u, v), and
vertex v is called the terminal vertex of (u, v).
•The initial vertex and terminal vertex of a loop are the
same.
Graph Terminology
•Definition: In a graph with directed edges, the in-degree
of a vertex v, denoted by deg-(v), is the number of edges
with v as their terminal vertex.
•The out-degree of v, denoted by deg+(v), is the number
of edges with v as their initial vertex.
•Question: How does adding a loop to a vertex change
the in-degree and out-degree of that vertex?
•Answer: It increases both the in-degree and the out-
degree by one.
Graph Terminology
•Example: What are the in-degrees and out-degrees of the
vertices a, b, c, d in this graph:
a
b
cd
deg-(a) = 1
deg+(a) = 2
deg-(b) = 4
deg+(b) = 2
deg-(d) = 2
deg+(d) = 1
deg-(c) = 0
deg+(c) = 2
Representing Graphs
a
b
c
d
a
b
c
d
a, db
a, dc
a, b, cd
b, c, da
Adjacent VerticesVertex
ab
c
a, b, cd
ca
Terminal VerticesInitial Vertex
Representing Graphs
a
b
c
d
•Example: What is the adjacency
matrix AG for the following graph G
based on the order of vertices a, b, c,
d ?
Solution:













0111
1001
1001
1110
GA
Representing Graphs
•Example: What is the incidence
matrix M for the following graph G
based on the order of vertices a, b, c,
d and edges 1, 2, 3, 4, 5, 6?
Solution:
a
b
c
d
1
2
4
53
6













001110
111000
000101
010011
M

More Related Content

What's hot

Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
Abrish06
 
Connectivity of graphs
Connectivity of graphsConnectivity of graphs
Connectivity of graphs
sana younas
 
Planar graph
Planar graphPlanar graph
Planar graph
Shakil Ahmed
 
Interesting applications of graph theory
Interesting applications of graph theoryInteresting applications of graph theory
Interesting applications of graph theory
Tech_MX
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Hinal Lunagariya
 
Graphs in data structure
Graphs in data structureGraphs in data structure
Graphs in data structure
hamza javed
 
Hamilton path and euler path
Hamilton path and euler pathHamilton path and euler path
Hamilton path and euler path
Shakib Sarar Arnab
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
Ikhlas Rahman
 
Data structure computer graphs
Data structure computer graphsData structure computer graphs
Data structure computer graphs
Kumar
 
Graphs
GraphsGraphs
Graphs
amudha arul
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
Manikanta satyala
 
Graph theory and its applications
Graph theory and its applicationsGraph theory and its applications
Graph theory and its applications
Manikanta satyala
 
Floyd warshall-algorithm
Floyd warshall-algorithmFloyd warshall-algorithm
Floyd warshall-algorithm
Malinga Perera
 
Graph representation
Graph representationGraph representation
Graph representation
Tech_MX
 
Finite automata
Finite automataFinite automata
Finite automata
Bipul Roy Bpl
 
Graphs | Types of Graphs
Graphs | Types of GraphsGraphs | Types of Graphs
Graphs | Types of Graphs
Arafat Hossan
 
Spanning trees
Spanning treesSpanning trees
Spanning trees
Shareb Ismaeel
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
Ratnakar Mikkili
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
Protap Mondal
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theory
Chuckie Balbuena
 

What's hot (20)

Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Connectivity of graphs
Connectivity of graphsConnectivity of graphs
Connectivity of graphs
 
Planar graph
Planar graphPlanar graph
Planar graph
 
Interesting applications of graph theory
Interesting applications of graph theoryInteresting applications of graph theory
Interesting applications of graph theory
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Graphs in data structure
Graphs in data structureGraphs in data structure
Graphs in data structure
 
Hamilton path and euler path
Hamilton path and euler pathHamilton path and euler path
Hamilton path and euler path
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
 
Data structure computer graphs
Data structure computer graphsData structure computer graphs
Data structure computer graphs
 
Graphs
GraphsGraphs
Graphs
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
 
Graph theory and its applications
Graph theory and its applicationsGraph theory and its applications
Graph theory and its applications
 
Floyd warshall-algorithm
Floyd warshall-algorithmFloyd warshall-algorithm
Floyd warshall-algorithm
 
Graph representation
Graph representationGraph representation
Graph representation
 
Finite automata
Finite automataFinite automata
Finite automata
 
Graphs | Types of Graphs
Graphs | Types of GraphsGraphs | Types of Graphs
Graphs | Types of Graphs
 
Spanning trees
Spanning treesSpanning trees
Spanning trees
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theory
 

Similar to Graphs (Models & Terminology)

Graphs.pdf
Graphs.pdfGraphs.pdf
Graphs.pdf
pubggaming58982
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptx
ARVIND SARDAR
 
graph ASS (1).ppt
graph ASS (1).pptgraph ASS (1).ppt
graph ASS (1).ppt
ARVIND SARDAR
 
Lecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptxLecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptx
ChandanGiri21
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
Rashmi Bhat
 
1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx
swapnilbs2728
 
Unit 2: All
Unit 2: AllUnit 2: All
Unit 2: All
Hector Zenil
 
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
 
Ass. (3)graph d.m
Ass. (3)graph d.mAss. (3)graph d.m
Ass. (3)graph d.m
Syed Umair
 
LEC 1.pptx
LEC 1.pptxLEC 1.pptx
LEC 1.pptx
ssuserc1e786
 
Ppt of graph theory
Ppt of graph theoryPpt of graph theory
Ppt of graph theory
ArvindBorge
 
Graph 1
Graph 1Graph 1
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structures
Savit Chandra
 
Basics of graph
Basics of graphBasics of graph
Basics of graph
Khaled Sany
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
satvikkushwaha1
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
showslidedump
 
Graph theory
Graph theoryGraph theory
Graph theory
Jeane Paguio
 
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
miki304759
 
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
sumitbardhan
 
graph.ppt
graph.pptgraph.ppt
graph.ppt
yogeshbairagi126
 

Similar to Graphs (Models & Terminology) (20)

Graphs.pdf
Graphs.pdfGraphs.pdf
Graphs.pdf
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptx
 
graph ASS (1).ppt
graph ASS (1).pptgraph ASS (1).ppt
graph ASS (1).ppt
 
Lecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptxLecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptx
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx
 
Unit 2: All
Unit 2: AllUnit 2: All
Unit 2: All
 
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
 
Ass. (3)graph d.m
Ass. (3)graph d.mAss. (3)graph d.m
Ass. (3)graph d.m
 
LEC 1.pptx
LEC 1.pptxLEC 1.pptx
LEC 1.pptx
 
Ppt of graph theory
Ppt of graph theoryPpt of graph theory
Ppt of graph theory
 
Graph 1
Graph 1Graph 1
Graph 1
 
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structures
 
Basics of graph
Basics of graphBasics of graph
Basics of graph
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
Graph theory
Graph theoryGraph theory
Graph theory
 
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
 
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
 
graph.ppt
graph.pptgraph.ppt
graph.ppt
 

Recently uploaded

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 

Recently uploaded (20)

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 

Graphs (Models & Terminology)

  • 2. Introduction to Graphs Definition: A simple graph G = (V, E) consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges. Definition: A directed graph G = (V, E) consists of a set V of vertices and a set E of edges that are ordered pairs of elements in V. • A simple graph is just like a directed graph, but with no specified direction of its edges.
  • 3. Graph Models •Example I: How can we represent a network of (bi- directional) railways connecting a set of cities? •We should use a simple graph with an edge {a, b} indicating a direct train connection between cities a and b. Faisalabad Lahore Islamabad Multan Karachi Quetta
  • 4. Graph Models •Example II: In a round-robin tournament, each team plays against each other team exactly once. How can we represent the results of the tournament (which team beats which other team)? •We should use a directed graph with an edge (a, b) indicating that team a beats team b. Khi ISB FSD Lhr
  • 5. Graph Terminology •Definition: Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if {u, v} is an edge in G. •If e = {u, v}, the edge e is called incident with the vertices u and v. The edge e is also said to connect u and v. •The vertices u and v are called endpoints of the edge {u, v}.
  • 6. Graph Terminology Definition: The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop at a vertex contributes twice to the degree of that vertex. •In other words, you can determine the degree of a vertex in a displayed graph by counting the lines that touch it. •The degree of the vertex v is denoted by deg(v).
  • 7. Graph Terminology •A vertex of degree 0 is called isolated, since it is not adjacent to any vertex. •Note: A vertex with a loop at it has at least degree 2 and, by definition, is not isolated, even if it is not adjacent to any other vertex. •A vertex of degree 1 is called pendant. It is adjacent to exactly one other vertex.
  • 8. Graph Terminology Example: Which vertices in the following graph are isolated, which are pendant, and what is the maximum degree? What type of graph is it? a b c d f h g jf e Solution: Vertex f is isolated, and vertices a, d and j are pendant. The maximum degree is deg(g) = 5. This graph is a pseudograph (undirected, loops).
  • 9. Graph Terminology •Let us look at the same graph again and determine the number of its edges and the sum of the degrees of all its vertices: a b c d f h g jf e Result: There are 9 edges, and the sum of all degrees is 18. This is easy to explain: Each new edge increases the sum of degrees by exactly two.
  • 10. Graph Terminology •The Handshaking Theorem: Let G = (V, E) be an undirected graph with e edges. Then 2e = vV deg(v) •Example: How many edges are there in a graph with 10 vertices, each of degree 6? •Solution: The sum of the degrees of the vertices is 610 = 60. According to the Handshaking Theorem, it follows that 2e = 60, so there are 30 edges.
  • 11. Graph Terminology •Definition: When (u, v) is an edge of the graph G with directed edges, u is said to be adjacent to v, and v is said to be adjacent from u. •The vertex u is called the initial vertex of (u, v), and vertex v is called the terminal vertex of (u, v). •The initial vertex and terminal vertex of a loop are the same.
  • 12. Graph Terminology •Definition: In a graph with directed edges, the in-degree of a vertex v, denoted by deg-(v), is the number of edges with v as their terminal vertex. •The out-degree of v, denoted by deg+(v), is the number of edges with v as their initial vertex. •Question: How does adding a loop to a vertex change the in-degree and out-degree of that vertex? •Answer: It increases both the in-degree and the out- degree by one.
  • 13. Graph Terminology •Example: What are the in-degrees and out-degrees of the vertices a, b, c, d in this graph: a b cd deg-(a) = 1 deg+(a) = 2 deg-(b) = 4 deg+(b) = 2 deg-(d) = 2 deg+(d) = 1 deg-(c) = 0 deg+(c) = 2
  • 14. Representing Graphs a b c d a b c d a, db a, dc a, b, cd b, c, da Adjacent VerticesVertex ab c a, b, cd ca Terminal VerticesInitial Vertex
  • 15. Representing Graphs a b c d •Example: What is the adjacency matrix AG for the following graph G based on the order of vertices a, b, c, d ? Solution:              0111 1001 1001 1110 GA
  • 16. Representing Graphs •Example: What is the incidence matrix M for the following graph G based on the order of vertices a, b, c, d and edges 1, 2, 3, 4, 5, 6? Solution: a b c d 1 2 4 53 6              001110 111000 000101 010011 M