Data structure-graph theory

Section 1-Graph traversal

topic Difficulty Accept
1 [Example question] One-stroke drawing problem submit
2 Snow shovel submit
3 Riding a fence submit

Section 2-Shortest Path

一、单源最短路: The side right cannot be negative;

  1. dijkstra (朴素版)O (n 2) O (n ^ 2)O ( n2)
  2. dijkstra (堆优化)O (mlogn) O (mlogn)O ( m l o g n )

二、单源最短路: The side weight can be positive or negative, but there can be no negative weight loop;

  1. bellman_ford O ( n m ) O(nm) O(nm)
  2. spfa:General O (m) O(m)O ( m ) , the worstO (nm) O(nm)O(nm)

三、多源最短路: The side weight can be positive or negative, but there can be no negative weight loop;

  1. floydO (n 3) O (n ^ 3)O ( n3)
topic Difficulty Accept
1 [Example 4.1] The shortest path problem Simple + submit
2 [Example 4.2] The travel of the cow medium submit
3 【Example 4.4】Minimum cost medium submit
4 [Example 4.6] Sweet butter medium submit
5 messenger simple submit
6 Optimal ride difficult submit
7 Shortest path Simple + submit
8 Heat wave simple submit
9 Divide candy medium submit
10 City road simple submit
11 Shortest path simple submit
12 SPFA (II) unknown No permission
13 Dijkstra (II) unknown No permission
14 Floyd unknown No permission

Section 3-Connectivity of Graphs

topic Difficulty Accept
1 Record CD submit
2 pearl submit

Section 4-Consolidation

find函数

  1. 无优化: Average O (logn) O(logn)O ( l o g n ) , the worstO (n) O(n)O ( n )
  2. 路径压缩: Average O (α (n)) O(α(n))O ( α ( n ) ) , the worstO (logn) O(logn)O ( l o g n )
  3. 按秩合并: Average O (logn) O(logn)O ( l o g n ) , the worstO (logn) O(logn)O ( l o g n )
  4. 路径压缩 + 按秩合并: Average O (α (n)) O(α(n))O ( α ( n ) ), 最坏O (α (n)) O (α (n))O ( α ( n ) )

α: Inverse Ackerman function, for the possible value n, α (n) α(n)α ( n ) are all less than 5;

topic Difficulty Accept
1 [Example 4.7] Relatives simple submit
2 [Example 4.8] Grid game Simple + submit
3 Gang Simple + submit
4 Fight crime medium submit
5 Match sale medium submit
6 genealogy Simple + submit
7 relative Simple + submit
8 Food chain difficult submit

Section 5-Minimum Spanning Tree

topic Difficulty Accept
1 [Example 4.9] The construction of urban public transport network submit
2 [Example 4.10] Optimal wiring problem submit
3 [Example 4.11] The shortest network submit
4 [Example 4.12] Family Tree submit
5 local area network submit
6 Busy city submit
7 Liaison submit
8 Connected grid submit

Section 6-Topological Sorting and Critical Path

topic Difficulty Accept
1 [Example 4.13] Bonus submit
2 Annoying slideshow submit
3 virus submit

Guess you like

Origin blog.csdn.net/weixin_46239370/article/details/113424908