Figure [Finishing]

FIG. 1. FIG divided into the weighted directed graph, and no

2. The memory map

  1. adjacency matrix - sequential storage two-dimensional array

  

 

 

  2. adjacency table - stored Chain 

 

3, FIG traversal

  Depth-first search:

  BFS: similar sequence traversal

 

4, the shortest path

  Single-source shortest path: Dijkstra algorithm

 

  Multi-source shortest path: Floyd algorithm

 

5, the minimum spanning tree

  Prim's algorithm

  Kruskal's algorithm

 

6, topological sorting

  A linear sequence to all vertices acyclic graph (DAG, Directed Acyclic Graph) a. 

  Find no input, output node only after deleting looking for the next one. For example:

    

 

7, disjoint-set

Guess you like

Origin www.cnblogs.com/huchengxi/p/12371160.html