FIG representation of - FIG.

Graph representation

  • Adjacency matrix notation - represents the adjacency matrix vertices
    • Undirected graph adjacency matrix

(1) undirected adjacency matrix FIG symmetric matrix to be compressed is stored; of n nodes to the storage space without need of FIG n (n + 1) / 2

(2) undirected, the vertex v graph i of the adjacency matrix elements of the i-th row and

    • There the graph adjacency matrix

  (1) There is not necessarily symmetrical to the adjacency matrix, there are n vertices is n memory space required to FIG. 2

  (2) a directed graph: vertex V i out is the adjacency matrix of the i-th row and the elements of the vertex V i out is the adjacency matrix of the elements of the i-th column and

    • Network adjacency matrix (FIG network is Weighted)

 

  • Adjacency list representation
    • deal with
      • FIG vertices using a one-dimensional array is stored. Vertex arrays, each data element is also a need to store a pointer to the first abutment point, so as to locate the side information node
      • FIG each vertex v i of all adjacent points constituting a linear table, since the number of adjacent points undefined, so a single linked list memory, no vertex v in the figure called i side table, there is referred to Fig vertices V I as the end of an arc edge list
    • Undirected graph adjacency list

 

 

    • There adjacency list digraph

 

    • Net adjacency list
      • For the network of FIG weighted values, the edge may be defined in the table node weight increase of a data field to store the weight

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/KBryant/p/11616218.html