Discrete Structure20815 marksGraph representation using adjacency matrix
Explain any two ways of representing the graph.
Explain any two ways of representing the graph. [5]
An adjacency matrix is a 2D array (matrix) of size V x V, where V is the number of vertices in the graph. Definition: For a graph G = (V, E), the adjacency matrix A is defined as: Example: Consider a graph with 4 vertices (1, 2, 3, 4) and edges: (1,2), (1,3), (2,4), (3,4) Advantages: - Simple to ...