Incidence and adjacency matrix

Lecture



The incidence matrix is one of the forms of representation of the graph, in which the links between the incident elements of the graph (edge ​​(arc) and vertex) are indicated. The columns of the matrix correspond to the edges, the rows - to the vertices. A non-zero value in the matrix cell indicates the relationship between the vertex and the edge (their incidence).

In the case of a directed graph, each arc <x, y> is mapped to "-1" in the row of the vertex x and the column of the arc <x, y> and "1" in the row of the vertex y and the column of the arc <x, y>; if there is no connection between vertex and edge, then "0" is put in the corresponding cell.

Content

  • 1 Example
  • 2 Features of this presentation
  • 3 See also
  • 4 References
  • 5 Literature

Example [edit]

Graph Incidence matrix
  Incidence and adjacency matrix   Incidence and adjacency matrix

Features of this view [edit]

  • Used for any graphs, even if there is a loop.
  • Each column does not need to be two units (or 1 and -1 in the case of a directed graph).

See also [edit]

Adjacency matrix

The adjacency matrix is one way of representing a graph as a matrix.

Content

  • 1 Definition
  • 2 Examples
  • 3 Properties
    • 3.1 Matrix Degrees
  • 4 Data Structure
  • 5 See also
  • 6 Literature
  • 7 References

Definition [edit]

The adjacency matrix of a graph G with a finite number of vertices n (numbered from 1 to n ) is a square matrix A of size n , in which the value of the element a ij equals the number of edges from the i -th vertex of the graph to the j -th vertex.

Sometimes, especially in the case of an undirected graph, a loop (edge ​​from the i -th vertex to itself) is counted as two edges, that is, the value of the diagonal element a ii in this case is equal to twice the number of loops around the i -th vertex.

The adjacency matrix of a simple graph (free of loops and multiple edges) is a binary matrix and contains zeros on the main diagonal.

Examples [edit]

  • Below is an example of an undirected graph and its corresponding adjacency matrix A. This graph contains a loop around vertex 1, depending on the specific applications of the element   Incidence and adjacency matrix can be considered equal to either one (as shown below) or two.
Graph Adjacency matrix
  Incidence and adjacency matrix   Incidence and adjacency matrix
  • a ij is the number of edges connecting vertices   Incidence and adjacency matrix and   Incidence and adjacency matrix , and in some applications each loop (edge   Incidence and adjacency matrix with some   Incidence and adjacency matrix ) counted twice.
  • The adjacency matrix of an empty graph that does not contain a single edge consists of all zeros.

Properties [edit]

The adjacency matrix of an undirected graph is symmetric, and therefore has real eigenvalues ​​and an orthogonal basis of eigenvectors. The set of its eigenvalues ​​is called the spectrum of a graph, and is the main subject of the study of spectral graph theory.

Two graphs G 1 and G 2 with adjacency matrices A 1 and A 2 are isomorphic if and only if there exists a permutation matrix P such that

PA 1 P -1 = A 2 .

From this it follows that the matrices A 1 and A 2 are similar, and therefore have equal sets of eigenvalues, determinants and characteristic polynomials. However, the converse is not always true — two graphs with similar adjacency matrices may be non-isomorphic.

Matrix Degrees [edit]

If A is the adjacency matrix of the graph G , then the matrix A m has the following property: an element in the i- th row, j- th column is equal to the number of paths from the i -th vertex to the j -th, consisting of exactly m edges.

Data structure [edit]

The adjacency matrix and adjacency lists are the main data structures used to represent graphs in computer programs.

The use of the adjacency matrix is ​​preferable only in the case of non-thinned graphs, with a large number of edges, since it requires storing one data bit for each element. If the graph is sparse, then most of the memory will be wasted on storing zeros, but in the case of unresolved graphs, the adjacency matrix represents the graph in memory rather compactly, using approximately   Incidence and adjacency matrix a bit of memory that can be much better than adjacency lists.

In algorithms that work with weighted graphs (for example, in the Floyd-Warcil algorithm), the elements of the adjacency matrix, instead of the numbers 0 and 1, indicating the presence or absence of an edge, often contain the weights of the edges themselves. In this case, in place of the missing edges put some special boundary value (English sentinel ), depending on the problem being solved, usually 0 or   Incidence and adjacency matrix .

See also [edit]

created: 2014-11-01
updated: 2021-03-13
132951



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Discrete Math. Set theory. Graph theory. Combinatorics.

Terms: Discrete Math. Set theory. Graph theory. Combinatorics.