Four case studies in this chapter:
- Scheduling overdue jobs
- K-center
- Scheduling jobs in PARALLEL
- Metric travelling salesman
Scheduling jobs in PARALLEL with local search, other three with greedy.
Difference between greedy and local search:(Quote from book WS = Williamson and Shmoys. The Design of Approximation Algorithms. Cambridge University Press, 2010.
-
Both algorithms work by making a sequence of decisions that optimize some local choice, though these local choices might not lead to the best overall solution.
他俩都通过制定一系列的决策decision来优化某些局部选择,yet这些局部选择不一定会带来全局最优。
-
In a greedy algorithm, a solution is constructed step by step, and at each step of the algorithm the next part of the solution is constructed by making some decision that is locally the best possible.
贪心的解由一步一步构造,每一步都是局部最优的。
-
A local search algorithm starts with an arbitrary feasible solution to the problem, and then checks if some small, local change to the solution results in an improved objective function. If so, the change is made. When no further change can be made, we have a locally optimal solution, and it is sometimes possible to prove that such locally optimal solutions have value close to that of the optimal solution.
局部搜索以任意的可行解为起始,check是否对solution result做改变小的局部会提高OBJ function目标函数。当没有further改变时,就获得了locally optimal solution。
-
greedy algorithms are typically primal infeasible algorithms: they construct a solution to the problem during the course of the algorithm. Local search algorithms are primal feasible algorithms: they always maintain a feasible solution to the problem and modify it during the course of the algorithm. 自己总结如下:
Difference between greedy and local search About primal infeasible/feasible algorithms
- Local search局部搜索类似于高中学的线性规划。类似于在线性规划中添加约束,不断优化的过程 即是在平面内不断添加约束直线的过程。2条约束直线时也是当前的解,在此基础上再添加一条约束直线也是当前的解。一步比一步的约束大,但每一步都是合理解。
图1 - 在每一步都增加一条直线更加逼近更为准确的可行域,但每一步都是合理解 - Greedy贪心算法中每个策略的选择只导向一种结果。每个策略都已经是一种定局,如果想要(改变/优化)解,只能改变贪心策略。如何改变贪心策略?e.g. 贪心策略1)在有很多作业没写的情况下,先做ddl最早的。贪心策略2)在有很多作业没写的情况下,先做学分占比最大的(老师求不打------综上,更新贪心算法相当于更新策略。
Scheduling overdue jobs
In the book of WS The Design of Approximation Algorithms, this section is described in 2.1 Scheduling jobs with deadlines on a single machine on Page 36.