Lecture 12 Graph
Lecture 12 Graph
Afsana Begum
Senior Lecturer,
Software Engineering Department,
Daffodil International University
What is a graph?
• A data structure that consists of a set of nodes
(vertices) and a set of edges that relate the nodes
to each other
• The set of edges describes relationships among
the vertices
Undirected graphs
1. Adjacency Matrix
An adjacency matrix is 2D array of V x V vertices. Each row and
column represent a vertex.
1 2
3 4
Graph terminology
Complete graph: A graph in which every vertex is
directly connected to every other vertex
Graph Implementation
Directed Graph:
https://www.techiedelight.com/implement-graph-data-structure
-c/
Undirected graph:
https://www.geeksforgeeks.org/graph-and-its-representations/