We have already defined graphs in set-theoretic termsAs a set of vertices and a set of edges and represented them pictorially to impart intuition. However, we need an alternate representation that facilitates working with graphs algorithmically.

One such representation is the adjacency matrix representation. Using this representation, graphs can be stored as two-dimensional arrays.

Get hands-on with 1400+ tech skills courses.