PERT && Knapsack && 匹配

         PERT ( Program Evaluation and Review Technique ), the plan evaluation technique, is also called "critical path analysis".

         Critical path ( critical path ): The tasks on it are those tasks that determine the time required for the entire project. If you want to reduce the time required for the project, you must speed up the completion of tasks on the critical path.

         Critical path method ( critical path method ): Topological sorting.

        

         The backpack problem ( Knapsack ), there are mainly partial backpacks, complete backpacks, and multi-dimensional backpacks. Some backpacks use greedy thinking; full backpacks and multi-dimensional backpacks are made with DP .

 

 

Keywords: expand backward, expand forward

The "critical path" is the longest path of this graph; for directed acyclic graphs, you can use the topology method to do it. The core of the algorithm is "backward expansion": it is to add this point after the in-degree of a certain point is processed.

         This kind of thinking is very common:

1) For       example , the point expansion in BFS is to first find a point that has an optimal solution, and then update the value of the reachable point. When it can no longer be updated, the optimal value of that point is determined, and other points can be updated;

2)       As a way of writing the infinite backpack problem, first enumerate the capacity and then enumerate the items. The enumerated capacity has reached the optimal solution, and you can update other points.

This method is difficult to judge: how to determine that a point has reached the optimal state?

1)  In PERT , when the in-degree of a point is 0 , the optimal point is reached.

2)  In SPFA , it is precisely because it is impossible to judge this point, so a point must be added to the queue for multiple times, but the number of times will not be too many;

There is also "recursion", that is, for a certain point, find all the points that can reach it before and update:

1 ) 01 backpack is this method

 

 

Guess you like

Origin blog.csdn.net/zjsxzjb/article/details/6244527