Graphs in data structure

hamza javed
hamza javedStudent at Preston University
Data Structure
Graphs
Preston University Kohat
Hamza Javed
BCS 4th
2121-115001
Graphs
Introduction
• Graphs are a generalization of trees
• Nodes or vertices
• Edges or arcs
• Two kinds of graphs
• Directed
• Undirected
3
Introduction: Formal Definition
• A graph G = (V,E) consists of a finite set of vertices, V, and a finite set
of edges E.
• Each edge is a pair (v,w) where v, w  V
4
Introduction: Formal Definition
• A directed graph, or digraph, is a graph in which the edges are
ordered pairs
• (v, w) ≠ (w, v)
• An undirected graph is a graph in which the edges are unordered
pairs
• (v, w) == (w, v)
5
Introduction: Directed Graphs
• In a directed graph, the edges are arrows.
• Directed graphs show the flow from one node to another and not vise
versa.
6
Introduction: Undirected Graphs
• In a Undirected graph, the edges are lines.
• UnDirected graphs show a relationship between two nodes.
7
Terminology
• In the directed graph above, b is adjacent to a
because (a, b)  E. Note that a is not adjacent to b.
• A is a predecessor of node B
• B is a successor of node A
• The source of the edge is node A, the target is node B
8
Terminology
• In the undirected graph above, a and b are adjacent
because (a,b)  E. a and b are called neighbors.
9
Terminology
• A path is a sequence of vertices w1, w2,…wn such that
(wi, wi+1)  E, 1 <= i < n, and each vertex is unique
except that the path may start and end on the same
vertex
• The length of the path is the number of edges along
the path
10
Terminology
• An acyclic path is a path which does not follow a
sequence.
• A cyclic path is a path such that
• There are at least two vertices on the path
• w1 = wn (path starts and ends at same vertex)
• And also maintains the sequence
11
Test Your Knowledge
Cyclic or Acyclic?
12
Terminology
• A directed graph that has no cyclic paths is called a
DAG (a Directed Acyclic Graph).
• An undirected graph that has an edge between every
pair of vertices is called a complete graph.
Note: A directed graph can also be
a complete graph; in that case, there
must be an edge from every vertex
to every other vertex.
13
Test Your Knowledge
Complete, or “Acomplete” (Not Complete)
14
Test Your Knowledge
Complete, or “Acomplete” (Not Complete)
15
Terminology
• An undirected graph is connected if a path exists from
every vertex to every other vertex
• A directed graph is strongly connected if a path exists
from every vertex to every other vertex
• A directed graph is weakly connected if a path exists
from every vertex to every other vertex, disregarding
the direction of the edge
16
Terminology
• A graph is known as a weighted graph if a weight or
metric is associated with each edge.
17
Representation of Graph
18
Following are the representation of a graph
• Adjacency Matrix
• Adjacency List
There are other representations also like, Incidence Matrix and
Incidence List. The choice of the graph representation is situation
specific. It totally depends on the type of operations to be performed
and ease of use.
19
Adjacency Matrix
• Adjacency Matrix is a 2D array of size V x V where V is the number of
vertices in a graph. Let the 2D array be adj[][], a slot adj[i][j] = 1
indicates that there is an edge from vertex i to vertex j. Adjacency
matrix for undirected graph is always symmetric. Adjacency Matrix is
also used to represent weighted graphs. If adj[i][j] = w, then there is
an edge from vertex i to vertex j with weight w.
20
Adjacency Matrix
21
Adjacency List
• An array of linked lists is used. Size of the array is equal to number of
vertices. Let the array be array[]. An entry array[i] represents the
linked list of vertices adjacent to the ith vertex. This representation
can also be used to represent a weighted graph. The weights of edges
can be stored in nodes of linked lists. Following is adjacency list
representation of the above graph.
22
Adjacency List
23
No
de
Adjacency List
A
B
C
D
E
B,C,D
C
C,E
C
a) Graphs G
b) Adjacency lists of G
24
25
Uses For Graphs
26
Uses for Graphs
• Computer network: The set of vertices V represents the set of
computers in the network. There is an edge (u, v) if and only if there
is a direct communication link between the computers corresponding
to u and v.
27
Uses for Graphs
• Two-Player Game Tree: All of the possibilities in a board game like
chess can be represented in a graph. Each vertex stands for one
possible board position. (For chess, this is a very big graph!)
28
Social Media (Facebook)
29
Websites
30
Intercity Road Network
31
32
1 de 32

Recomendados

Data structure - Graph por
Data structure - GraphData structure - Graph
Data structure - GraphMadhu Bala
6.4K vistas28 diapositivas
Graph in data structure por
Graph in data structureGraph in data structure
Graph in data structureAbrish06
43.2K vistas24 diapositivas
Graph Data Structure por
Graph Data StructureGraph Data Structure
Graph Data StructureAfaq Mansoor Khan
300 vistas32 diapositivas
Graphs In Data Structure por
Graphs In Data StructureGraphs In Data Structure
Graphs In Data StructureAnuj Modi
45.6K vistas32 diapositivas
Graph representation por
Graph representationGraph representation
Graph representationTech_MX
37.3K vistas34 diapositivas
Graph data structure and algorithms por
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithmsAnandhasilambarasan D
2.2K vistas10 diapositivas

Más contenido relacionado

La actualidad más candente

Spanning trees por
Spanning treesSpanning trees
Spanning treesShareb Ismaeel
9.4K vistas14 diapositivas
Graphs in Data Structure por
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structurehafsa komal
2.2K vistas22 diapositivas
Introduction to Graph Theory por
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph TheoryPremsankar Chakkingal
35.2K vistas35 diapositivas
Graph traversals in Data Structures por
Graph traversals in Data StructuresGraph traversals in Data Structures
Graph traversals in Data StructuresAnandhasilambarasan D
4.5K vistas11 diapositivas
Graph theory por
Graph theoryGraph theory
Graph theoryAparnaKumari31
2.1K vistas13 diapositivas
Depth first search [dfs] por
Depth first search [dfs]Depth first search [dfs]
Depth first search [dfs]DEEPIKA T
1.7K vistas11 diapositivas

La actualidad más candente(20)

Graphs in Data Structure por hafsa komal
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
hafsa komal2.2K vistas
Depth first search [dfs] por DEEPIKA T
Depth first search [dfs]Depth first search [dfs]
Depth first search [dfs]
DEEPIKA T1.7K vistas
Graphs bfs dfs por Jaya Gautam
Graphs bfs dfsGraphs bfs dfs
Graphs bfs dfs
Jaya Gautam17.1K vistas
Graph Data Structure por Keno benti
Graph Data StructureGraph Data Structure
Graph Data Structure
Keno benti616 vistas
Graph traversal-BFS & DFS por Rajandeep Gill
Graph traversal-BFS & DFSGraph traversal-BFS & DFS
Graph traversal-BFS & DFS
Rajandeep Gill1.3K vistas
Adjacency list por Stefi Yu
Adjacency listAdjacency list
Adjacency list
Stefi Yu4.5K vistas
Spanning trees & applications por Tech_MX
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
Tech_MX24.6K vistas
graph theory por ganith2k13
graph theory graph theory
graph theory
ganith2k1314.5K vistas

Destacado

Data Structures - Lecture 10 [Graphs] por
Data Structures - Lecture 10 [Graphs]Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]Muhammad Hammad Waseem
6.4K vistas52 diapositivas
Graphs data Structure por
Graphs data StructureGraphs data Structure
Graphs data StructureMahmoud Alfarra
721 vistas18 diapositivas
Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un... por
Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un...Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un...
Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un...sethuraman R
1.4K vistas61 diapositivas
Graph theory 1 por
Graph theory 1Graph theory 1
Graph theory 1Tech_MX
8K vistas43 diapositivas
Apache Flink & Graph Processing por
Apache Flink & Graph ProcessingApache Flink & Graph Processing
Apache Flink & Graph ProcessingVasia Kalavri
1.8K vistas97 diapositivas
Introduction to data structure por
Introduction to data structureIntroduction to data structure
Introduction to data structureZaid Shabbir
31.4K vistas20 diapositivas

Destacado(17)

Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un... por sethuraman R
Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un...Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un...
Introduction to Data structure & Algorithms - Sethuonline.com | Sathyabama Un...
sethuraman R1.4K vistas
Graph theory 1 por Tech_MX
Graph theory 1Graph theory 1
Graph theory 1
Tech_MX8K vistas
Apache Flink & Graph Processing por Vasia Kalavri
Apache Flink & Graph ProcessingApache Flink & Graph Processing
Apache Flink & Graph Processing
Vasia Kalavri1.8K vistas
Introduction to data structure por Zaid Shabbir
Introduction to data structureIntroduction to data structure
Introduction to data structure
Zaid Shabbir31.4K vistas
Batch and Stream Graph Processing with Apache Flink por Vasia Kalavri
Batch and Stream Graph Processing with Apache FlinkBatch and Stream Graph Processing with Apache Flink
Batch and Stream Graph Processing with Apache Flink
Vasia Kalavri9.6K vistas
Graph data structure por Tech_MX
Graph data structureGraph data structure
Graph data structure
Tech_MX14.1K vistas
Data structures (introduction) por Arvind Devaraj
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)
Arvind Devaraj21K vistas
Graph Basic In Data structure por Ikhlas Rahman
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
Ikhlas Rahman2.1K vistas
Graphs ppt por aimorales
Graphs pptGraphs ppt
Graphs ppt
aimorales52.2K vistas
Why apache Flink is the 4G of Big Data Analytics Frameworks por Slim Baltagi
Why apache Flink is the 4G of Big Data Analytics FrameworksWhy apache Flink is the 4G of Big Data Analytics Frameworks
Why apache Flink is the 4G of Big Data Analytics Frameworks
Slim Baltagi30.7K vistas

Similar a Graphs in data structure

Graph Theory por
Graph TheoryGraph Theory
Graph TheoryRashmi Bhat
310 vistas78 diapositivas
Graph 1 por
Graph 1Graph 1
Graph 1International Islamic University
272 vistas90 diapositivas
358 33 powerpoint-slides_13-graphs_chapter-13 por
358 33 powerpoint-slides_13-graphs_chapter-13358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13sumitbardhan
3.9K vistas41 diapositivas
UNIT III.pptx por
UNIT III.pptxUNIT III.pptx
UNIT III.pptxSwarndeviKm
29 vistas74 diapositivas
Graphs Algorithms por
Graphs AlgorithmsGraphs Algorithms
Graphs AlgorithmsKasun Ranga Wijeweera
1.1K vistas21 diapositivas
Graphs (Models & Terminology) por
Graphs (Models & Terminology)Graphs (Models & Terminology)
Graphs (Models & Terminology)zunaira saleem
150 vistas16 diapositivas

Similar a Graphs in data structure(20)

358 33 powerpoint-slides_13-graphs_chapter-13 por sumitbardhan
358 33 powerpoint-slides_13-graphs_chapter-13358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13
sumitbardhan3.9K vistas
Graphs (Models & Terminology) por zunaira saleem
Graphs (Models & Terminology)Graphs (Models & Terminology)
Graphs (Models & Terminology)
zunaira saleem150 vistas
Graph por Niliha
GraphGraph
Graph
Niliha59 vistas
Basics of graph por Khaled Sany
Basics of graphBasics of graph
Basics of graph
Khaled Sany589 vistas
14 chapter9 graph_algorithmstopologicalsort_shortestpath por SSE_AndyLi
14 chapter9 graph_algorithmstopologicalsort_shortestpath14 chapter9 graph_algorithmstopologicalsort_shortestpath
14 chapter9 graph_algorithmstopologicalsort_shortestpath
SSE_AndyLi123 vistas
Lecture 5b graphs and hashing por Victor Palmar
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
Victor Palmar1.2K vistas

Último

Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... por
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...ShapeBlue
183 vistas18 diapositivas
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... por
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
176 vistas29 diapositivas
"Surviving highload with Node.js", Andrii Shumada por
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
58 vistas29 diapositivas
"Node.js Development in 2024: trends and tools", Nikita Galkin por
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin Fwdays
33 vistas38 diapositivas
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue por
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlueShapeBlue
152 vistas23 diapositivas
CryptoBotsAI por
CryptoBotsAICryptoBotsAI
CryptoBotsAIchandureddyvadala199
42 vistas5 diapositivas

Último(20)

Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... por ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue183 vistas
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... por TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc176 vistas
"Surviving highload with Node.js", Andrii Shumada por Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 vistas
"Node.js Development in 2024: trends and tools", Nikita Galkin por Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays33 vistas
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue por ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue152 vistas
State of the Union - Rohit Yadav - Apache CloudStack por ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue303 vistas
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue por ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue207 vistas
Ransomware is Knocking your Door_Final.pdf por Security Bootcamp
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdf
Security Bootcamp98 vistas
Digital Personal Data Protection (DPDP) Practical Approach For CISOs por Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 vistas
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... por ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue108 vistas
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... por Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Jasper Oosterveld35 vistas
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... por ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue199 vistas
Future of AR - Facebook Presentation por Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 vistas
The Power of Heat Decarbonisation Plans in the Built Environment por IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE84 vistas
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... por ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue141 vistas
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue por ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue224 vistas
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... por ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue129 vistas
The Role of Patterns in the Era of Large Language Models por Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li91 vistas

Graphs in data structure

  • 1. Data Structure Graphs Preston University Kohat Hamza Javed BCS 4th 2121-115001
  • 3. Introduction • Graphs are a generalization of trees • Nodes or vertices • Edges or arcs • Two kinds of graphs • Directed • Undirected 3
  • 4. Introduction: Formal Definition • A graph G = (V,E) consists of a finite set of vertices, V, and a finite set of edges E. • Each edge is a pair (v,w) where v, w  V 4
  • 5. Introduction: Formal Definition • A directed graph, or digraph, is a graph in which the edges are ordered pairs • (v, w) ≠ (w, v) • An undirected graph is a graph in which the edges are unordered pairs • (v, w) == (w, v) 5
  • 6. Introduction: Directed Graphs • In a directed graph, the edges are arrows. • Directed graphs show the flow from one node to another and not vise versa. 6
  • 7. Introduction: Undirected Graphs • In a Undirected graph, the edges are lines. • UnDirected graphs show a relationship between two nodes. 7
  • 8. Terminology • In the directed graph above, b is adjacent to a because (a, b)  E. Note that a is not adjacent to b. • A is a predecessor of node B • B is a successor of node A • The source of the edge is node A, the target is node B 8
  • 9. Terminology • In the undirected graph above, a and b are adjacent because (a,b)  E. a and b are called neighbors. 9
  • 10. Terminology • A path is a sequence of vertices w1, w2,…wn such that (wi, wi+1)  E, 1 <= i < n, and each vertex is unique except that the path may start and end on the same vertex • The length of the path is the number of edges along the path 10
  • 11. Terminology • An acyclic path is a path which does not follow a sequence. • A cyclic path is a path such that • There are at least two vertices on the path • w1 = wn (path starts and ends at same vertex) • And also maintains the sequence 11
  • 12. Test Your Knowledge Cyclic or Acyclic? 12
  • 13. Terminology • A directed graph that has no cyclic paths is called a DAG (a Directed Acyclic Graph). • An undirected graph that has an edge between every pair of vertices is called a complete graph. Note: A directed graph can also be a complete graph; in that case, there must be an edge from every vertex to every other vertex. 13
  • 14. Test Your Knowledge Complete, or “Acomplete” (Not Complete) 14
  • 15. Test Your Knowledge Complete, or “Acomplete” (Not Complete) 15
  • 16. Terminology • An undirected graph is connected if a path exists from every vertex to every other vertex • A directed graph is strongly connected if a path exists from every vertex to every other vertex • A directed graph is weakly connected if a path exists from every vertex to every other vertex, disregarding the direction of the edge 16
  • 17. Terminology • A graph is known as a weighted graph if a weight or metric is associated with each edge. 17
  • 19. Following are the representation of a graph • Adjacency Matrix • Adjacency List There are other representations also like, Incidence Matrix and Incidence List. The choice of the graph representation is situation specific. It totally depends on the type of operations to be performed and ease of use. 19
  • 20. Adjacency Matrix • Adjacency Matrix is a 2D array of size V x V where V is the number of vertices in a graph. Let the 2D array be adj[][], a slot adj[i][j] = 1 indicates that there is an edge from vertex i to vertex j. Adjacency matrix for undirected graph is always symmetric. Adjacency Matrix is also used to represent weighted graphs. If adj[i][j] = w, then there is an edge from vertex i to vertex j with weight w. 20
  • 22. Adjacency List • An array of linked lists is used. Size of the array is equal to number of vertices. Let the array be array[]. An entry array[i] represents the linked list of vertices adjacent to the ith vertex. This representation can also be used to represent a weighted graph. The weights of edges can be stored in nodes of linked lists. Following is adjacency list representation of the above graph. 22
  • 25. 25
  • 27. Uses for Graphs • Computer network: The set of vertices V represents the set of computers in the network. There is an edge (u, v) if and only if there is a direct communication link between the computers corresponding to u and v. 27
  • 28. Uses for Graphs • Two-Player Game Tree: All of the possibilities in a board game like chess can be represented in a graph. Each vertex stands for one possible board position. (For chess, this is a very big graph!) 28
  • 32. 32