Graph 1
Graph 1
• A graph is an abstract data structure that is used to implement the graph concept from
mathematics. A graph is basically, a collection of vertices (also called nodes) and edges
that connect these vertices. A graph is often viewed as a generalization of the tree
structure, where instead of a having a purely parent-to-child relationship between tree
nodes, any kind of complex relationships between the nodes can be represented.
• The figure given shows a graph with V(G) = { A, B, C, D and E} and E(G) = { (A, B),
(B, C), (A, D), (B, D), (D, E), (C, E) }. Note that there are 5 vertices or nodes and 6
edges in the graph.
A B C
D E
D E
e1 A B C
A B e4
2
e2 7 1
e3 D E F
C e6 D B
e5 e7 3
• U is known as the origin or initial point of e. Correspondingly, v is known as the destination or terminal point of e
• Since an adjacency matrix contains only 0s and 1s, it is called a bit matrix or a
Boolean matrix. The entries in the matrix depend on the ordering of the nodes
in G. therefore, a change in the order of nodes will result in a different
adjacency matrix.© Oxford University Press 2014. All rights
Adjacency Matrix Representation