## Adjacency matrix |

In **adjacency matrix** is a

In the special case of a finite

The adjacency matrix should be distinguished from the

For a simple graph with vertex set *V*, the adjacency matrix is a square |*V*| × |*V*| matrix *A* such that its element *A*_{ij} is one when there is an edge from vertex *i* to vertex *j*, and zero when there is no edge.^{[1]} The diagonal elements of the matrix are all zero, since edges from a vertex to itself (^{[2]}

The same concept can be extended to

The adjacency matrix *A* of a *r* and *s* vertices can be written in the form

where *B* is an *r* × *s* matrix, and 0_{r,r} and 0_{s,s} represent the *r* × *r* and *s* × *s* zero matrices. In this case, the smaller matrix *B* uniquely represents the graph, and the remaining parts of *A* can be discarded as redundant. *B* is sometimes called the biadjacency matrix.

Formally, let *G* = (*U*, *V*, *E*) be a *U* = {*u*_{1}, …, *u*_{r}} and *V* = {*v*_{1}, …, *v*_{s}}. The *biadjacency matrix* is the *r* × *s* 0–1 matrix *B* in which *b*_{i,j} = 1 if and only if (*u*_{i}, *v*_{j}) ∈ *E*.

If *G* is a bipartite *b*_{i,j} are taken to be the number of edges between the vertices or the weight of the edge (*u*_{i}, *v*_{j}), respectively.

An (*a*, *b*, *c*)-*adjacency matrix* *A* of a simple graph has *A*_{i,j} = *a* if (*i*, *j*) is an edge, *b* if it is not, and *c* on the diagonal. The *adjacency matrix*. This matrix is used in studying ^{[3]}

The ** distance matrix** has in position (