In graph theory, a** graph representation** is a technique to store graph into the memory of computer.

• **There are mainly three ways to represent a graph −**

**• Adjacency Matrix
• Incidence Matrix
• Adjacency List**

## ‣ Adjacency Matrix:

Let **G=(V,E)** be a graph with n vertices: **v _{1}**,

**v**,

_{2}**v**, ……

_{3}**V**. The adjacency matrix of G with respect to given ordered list of vertices is a

_{n}**nxn**matrix denoted by

**A(G)=(a**

_{ij})_{nxn}.such that,

## Undirected graph representation

## Directed graph represenation

In the above examples, 1 represents an edge from row vertex to column vertex, and 0 represents no edge from row vertex to column vertex.

**Q). Find the adjacency matrix M _{A} of undirected graph G shown in Fig:**

**Solution:**Since graph G consist of four vertices. Therefore, the adjacency matrix wills a 4 x 4 matrix. The adjacency matrix is as follows in fig:

## ‣ Incidence Matrix:

Let G be a graph with vertices **v _{1}**,

**v**,….

_{2}**v**and edges

_{m}**e**,

_{1}**e**,…

_{2}**e**. The incidence matrix I(G) of graph G is a mxn matrix with

_{n}**I(G) = (m**

_{ij})_{mxn}.such that,

**Q). Consider the undirected graph G as shown in fig. Find its incidence matrix MI.**

The undirected graph consists of four vertices and five edges. Therefore, the incidence matrix is an 4 x 5 matrix, which is shown in Fig:

## ‣ Adjacency List:

An adjacency list provides a collection of the combinations of connected vertices in a graph.

This type of graph is suitable for the undirected graphs without multiple edges, and directed graphs.

**UnDirected Graph fig:**

**Directed Graph fig:**