1. The characteristics of adjacency matrix (non-direction graph):
The adjacency matrix of graphs is stored by using two arrays to represent graphs:
1.) A one-dimensional array stores vertex information in a stored graph.
2.) A two-dimensional array (called an adjacency matrix) that stores information about an edge or arc in a graph.
In the figure above we set two arrays:
Vertex array: vertex[4] = {V0,v1,v2,v3}
Edge array: arc[4][4] is a symmetric matrix (0 means that there is no edge between vertices, 1 indicates the existence of edges between vertices)
2. The characteristics of adjacency matrix (forward graph):
The side of the non-direction graph constitutes a symmetric matrix, seemingly wasting half of the space, that if there is to the diagram storage, will not use the resources well?
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/
Vertex array Vertex[4] = {V0,v1,v2,v3}
Arc Array Arc[4][4] is also a matrix, but because it is a graph, the matrix is asymmetric.
such as: V1 to V0 arc, so arc[1][0] = 1, and V0 to V1 no arc, so arc[0][1] = 0
3. Characteristics of adjacency matrix (NET):
A map with a right on each side is called a net. The normal weight value indicates the distance between two points.
Here ∞ represents a value that is allowed by a computer greater than the weights on all sides.
Author: csdn Blog zdp072