近似算法(参考中科大黄刘生PPT)

基本概念

  1. 局限性:
    1)问题的可解性
    2)可计算理论:通过建立计算的数学模型,区分哪些可计算、哪些不可计算
    3)可计算函数:在抽象计算机上编出程序计算其值的函数
    4)Church-Turing论题:若一个函数在某个合力的计算模型上可计算,则它在图灵机上也是可计算的
    5)不可计算性:又穷描述过程无法完成的问题和函数
    6)可计算问题:多项式时间内可解,上界是 O ( n k ) O(n^k) O(nk)

  2. 不可解问题:停机问题
    能否写一个程序正确判断输入给它的任何一个程序是否会停机?

diagonal(Y){
	if halt(Y,Y):
		goto a
	else
		halts
}

它停机当且仅当halt返回否,这是矛盾的,因为只有在不停机的时候才能返回值
因此,停机问题不可解

  1. 形式语言框架
    1)判断语言L:算法A接收L中的每个串,拒绝每个不在L中的串,则称L是由A判定的语言
    2)算法A判定语言L: ∀ x ∈ L , A ( x ) = 1 ; ∀ x ∉ L , A ( x ) = 0 \forall x \in L, A(x)=1; \forall x \not \in L, A(x)=0 xL,A(x)=1;xL,A(x)=0
    3)多项式时间接收的语言L:存在k,对任意长度n的串 x ∈ L x\in L xL都可以在 O ( n k ) O(n^k) O(nk)时间内接受x,则L是算法在多项式时间内接受的语言
    4)多项式时间判定的语言L:存在k,对任意长度n的串 x ∈ 0 , 1 ∗ x\in {0,1}^* x0,1,算法可以在 O ( n k ) O(n^k) O(nk)时间内正确地判定是否有 x ∈ L x\in L xL,则L是算法多项式时间内可以判定的语言

  2. 图灵机(TM)
    1)DTM(确定性图灵机):对任一个状态和符号,要执行的动作都是唯一的
    2)NTM(非确定性图灵机):执行的动作是有穷多个可供选择

P、NP、NPC类问题

  1. P类问题(DTM)
    形式化定义:P={L:L是一个能在多项式时间内被一台DTM所接受的语言}
    非形式定义:P是所有用确定性算法在多项式时间内可解(判定)的问题的集合

  2. NP问题
    形式化定义:NP={L:L是一个能在多项式时间内被一台NTM所接受的语言}
    非形式化定义:NP是所有用非确定性算法在多项式时间内可解的(判定)问题的集合

  3. NP问题的求解
    1)猜测阶段:非确定性算法产生解
    非确定算法有点类似之前的概率算法,通过执行choice语句
    2)验证阶段:确定性算法在多项式时间内验证解
    验证算法A:若 ∀ x ∈ L , ∃ y \forall x \in L, \exist y xL,y使得 A ( x , y ) = 1 A(x,y)=1 A(x,y)=1,其中x是待验证的输入串,y为证书的二进制串
    证书相当于证据,验证该证书是否为问题的正确答案
    3)定理:语言L可在多项式时间内被非确定性地接受,当且仅当L在多项式时间内被确定性地验证(多项式时间可验证的问题就是NP问题)
    等价定义:
    NP={NDTM能在多项式时间内接受的语言类}
    NP={DTM能在多项式时间内验证的语言类}

  4. NPC问题
    多一归约
    1)定义: ∀ I , I 是 L 1 输 出 “ y e s ” 的 实 例 < = > f ( I ) 是 L 2 输 出 “ y e s ” 的 实 例 \forall I, I是L_1输出“yes”的实例<=>f(I)是L_2输出“yes”的实例 I,IL1yes<=>f(I)L2yes,则称f是从 L 1 L_1 L1 L 2 L_2 L2的多一归约,记作: L 1 ≤ m L 2 L_1 \le _mL_2 L1mL2,也就是 L 2 L_2 L2至少比 L 1 L_1 L1
    2)若f是多项式时间可以计算,则上述归约称为多项式时间多一归约,也称多项式时间变换 L 1 ≤ m p L 2 L_1 \le _m^p L_2 L1mpL2

NPC问题:对于一个判定性问题q,若
1) q ∈ N P q\in NP qNP
2)NP中任一问题均可多项式时间多一归约到q

  1. NP-hard问题
    问题q满足条件(2)不一定满足(1)

例如停机问题就无法在多项式时间内验证,不属于NP问题
对于SAT问题可以在多项式时间归约到停机问题,也就是穷举所有bool赋值情况,若赋值结果为真则停机,否则进入循环,因此可以归约到q,满足 S A T ≤ p SAT \le_p SATp停机问题
最后停机问题则是NP-hard

  1. 关系图:
    在这里插入图片描述

如何证明q是NP-hard:
首先找到已知的NPC或者NPH问题p,通过证明归约p到q,也就是 p ≤ q p\le q pq,可以证明问题是NP-hard的(因为 ≤ p \le p p是有传递性的)

如何证明q是NPC:
首先要证明是NP-hard,然后判定q是否属于NP问题(围棋的必胜下法就是一个NP-hard问题但不是NPC问题)

三种归约策略

  1. 定义
    独立集I:G=<V,E>,设 I ∈ V I\in V IV,I中任何点对之间无边
    Independent-Set={ < G , k > <G,k> <G,k>:G中有一个 s i z e ≥ k size\ge k sizek的独立集}

顶覆盖C:G=<V,E>,设 C ∈ V C\in V CV,E中每条边至少有一个端点在C中
Vertex-Cover={ < G , k > <G,k> <G,k>:G中有一个 s i z e ≤ k size\le k sizek的顶点覆盖}

集合覆盖S’: S j j ∈ J {S_j}_{j\in J} SjjJ为S的一个覆盖,他们的并集等于S,子集的交并未为空
Set-Cover={ < S , k > <S,k> <S,k>,S有一个 s i z e ≤ k size\le k sizek的集合覆盖}

两个集合互补:I是一个独立集当且仅当V-I是一个顶点覆盖集,即C=V-I

3-SAT问题
在这里插入图片描述

  1. 简单等价归约
    因为独立集和顶覆盖是互补集合,所以他们彼此都可以通过增加多项式的时间找到互相的解,因此 I ≤ q C I \le_q C IqC C ≤ I C \le I CI均成立,等价

  2. 从特殊到一般
    对于所有顶覆盖,每个顶点的边集合放在一起,可以形成k个边集合,k个边集合的并集也就是一个完整的E集合,因此 C ≤ S ′ C \le S' CS

  3. 通过编码
    在这里插入图片描述
    对于 φ = C 1 ∧ C 2 ∧ . . . ∧ C k \varphi=C_1 \wedge C_2 \wedge ... \wedge C_k φ=C1C2...Ck,构造G的独立集S,对于 C i = z i 1 ∨ z i 2 ∨ z i 3 C_i=z_{i1} \vee z_{i2} \vee z_{i3} Ci=zi1zi2zi3,在G中创建三个顶点 z i 1 、 z i 2 、 z i 3 z_{i1}、z_{i2}、z_{i3} zi1zi2zi3以及连接的边组成的三角形,由此形成点集V和边集E,并对其中不同的子句 x i x_i xi x i ˉ \bar{x_i} xiˉ连接边(为了保证之后选择独立子集的过程中不会同时选中)

描述完这个图之后我们可以看出,只要在图中的每个三角形中找到一个点并形成独立子集,则满足了3SAT的要求。也满足了独立子集的要求。
例如上图中找到 x 2 , x 1 , x 4 x_2,x_1,x_4 x2,x1,x4,同时为true则满足题目要求。

NP-hard求解方法

  1. 超多项式时间启发
    1)伪多项式时间算法:背包问题、素数确认问题
    为什么这些事伪多项式?
    虽然这些问题可以在多项式的时间内求解,例如素数问题 O ( n ) O(\sqrt n) O(n ),但是这里n并不是求解问题的规模,真正的规模应该是存储数的位数大小 l o g n log n logn,带入后是一个指数级的复杂度。
    这可能会提出疑问,那所有多项式时间,我都可以把n替换成log形式的数,那岂不是都是可以是指数级表达式?Nonono,这里我们需要关注一个问题真正的规模表示,对于排序问题,问题规模就是数组大小,因此是一个真多项式;而对于素数确认问题,问题规模显然不是n大小,n并不代表规模,我们需要的是一个logn位的数来存储这个数,存储位数才是我们的规模代表

2)弱NPC问题:这样可以用伪多项式表示的称为弱NPC问题
这里注意不是所有问题的遍历都是多项式表示,例如TSP问题的求解复杂度为 O ( n ∗ n ! ) O(n*n!) O(nn!)

  1. 启发式概率分析
    对输入实例进行约束和要求,只求解部分特点的输入实例
    缺点:选取一个特殊的输入分布往往是不易的

  2. 近似算法
    因为输入实例本身可能也是近似的,因此我们不需要找到最优解,只需要找到次优解即可

近似算法预备知识和基本定义

  1. 优化问题的组成
    1)实例集D:输入实例的集合
    2)解集S(I):输入实例 I ∈ D I \in D ID的所有可行解的集合
    3)解的值函数f:给每个解赋一个值,f:S(I)->R

  2. 最大值优化问题
    也就是在D中找到最优解使得对应的f最大,最优解的值记为OPT(I)

  3. 约定
    1)f的值域和I里的所有数都是整数
    2)对 ∀ σ ∈ S ( I ) , f ( σ ) \forall \sigma \in S(I), f(\sigma) σS(I),f(σ)是一个多项式(针对size)

  4. 定义:若一个NPH判定问题H1是多项式归约为计算一个优化问题H2的解,则H2是NPH的

  5. 近似算法A:是一个多项式时间求解优化问题的算法,使得对一个给定的输入实例,输出一个解 σ ∈ S ( I ) \sigma \in S(I) σS(I)。通常A(I)表示算法A所获得的解值 f ( σ ) f(\sigma) f(σ)

绝对性能保证

  1. 定义:一个绝对近似算法是优化问题H的多项式时间近似算法,使得对某一常数k>0满足 ∀ I ∈ D , ∣ A ( I ) − O P T ( I ) ∣ ≤ k \forall I \in D, |A(I)-OPT(I)| \le k ID,A(I)OPT(I)k。对于大部分NP-hard问题,仅当P=NP,才能找到绝对近似算法

  2. 图的顶点着色
    1)定义:使用最少的颜色数来为图G的顶点上色,使得所有相邻的顶点均有不同的颜色
    2)定理:判定一个平面图是否可3着色的问题是NPC
    近似算法A(G){
    检验G是否可以二着色(二部图,这是多项式时间可计算);若是返回2
    检验G是否可以五着色(实际上四色定理决定了必定可以4染色)
    }
    故有定理:近似算法A的性能满足 ∣ A ( G ) − O P T ( G ) ∣ ≤ 2 |A(G)-OPT(G)|\le 2 A(G)OPT(G)2

  3. 图的边着色
    1)定义:使用最少的颜色为图的边上色,使得所有相邻的边有不同的颜色
    2)定理1:确定一个三证则平面图所需的边着色问题是NPH
    3)定理2:对于任一图,至少需要k,至多需要k+1种颜色为边着色,k是最大度数
    4)定理3:可以找到一个多项式时间算法A找到k+1边着色
    因此近似算法有性能保证: ∣ A ( G ) − O P T ( G ) ∣ ≤ 1 ∣ |A(G)-OPT(G)|\le 1| A(G)OPT(G)1

绝对近似算法之否定

  1. 前面的例子展示了一类特殊的优化问题,这些问题中的最优解的值或者所在的小范围都是已知的

  2. 定理:若 P ≠ N P P\not =NP P=NP,对任何确定的k,找不到近似算法A可解背包问题使得: ∣ A ( I ) − O P T ( I ) ∣ ≤ k |A(I)-OPT(I)|\le k A(I)OPT(I)k

证明:
对于背包问题的参数:n为物品个数,w为背包最大承重。
假设存在近似算法A使得 ∣ A ( I ) − O P T ( I ) ∣ ≤ k |A(I)-OPT(I)|\le k A(I)OPT(I)k,则可以将利润扩大k+1倍,同样有 ∣ A ( ( k + 1 ) I ) − O P T ( ( k + 1 ) I ) ∣ ≤ k |A((k+1)I)-OPT((k+1)I)|\le k A((k+1)I)OPT((k+1)I)k,并且完全对应相同的解。则就有
∣ ( k + 1 ) A ( I ) − ( k + 1 ) O P T ( I ) ∣ ≤ k = > ∣ A ( I ) − O P T ( I ) ∣ ≤ ( k / k + 1 ) |(k+1)A(I)-(k+1)OPT(I)|\le k=>|A(I)-OPT(I)|\le (k/k+1) (k+1)A(I)(k+1)OPT(I)k=>A(I)OPT(I)(k/k+1),故可以找到最优解并且是多项式时间,矛盾

  1. 定理:若 P ≠ N P P\not =NP P=NP,则对于团问题不存在绝对近似算法(最大团也就是最大独立集问题)

证明:定义图的m次幂 G m G^m Gm,取G的m个拷贝,连接位于不同副本的任意两顶点。其中G的最大团的size为a,当且仅当 G m G^m Gm中最大团的size为ma。

后面用反证法,也就是假设存在 ∣ A ( I ) − O P T ( I ) ∣ ≤ k |A(I)-OPT(I)|\le k A(I)OPT(I)k,也就存在 ∣ A ( G k + 1 ) − O P T ( G k + 1 ) ∣ ≤ k |A(G^{k+1})-OPT(G^{k+1})|\le k A(Gk+1)OPT(Gk+1)k=> ∣ A ( G k + 1 ) − ( k + 1 ) O P T ( G ) ∣ ≤ ( k / k + 1 ) |A(G^{k+1})-(k+1)OPT(G)|\le (k/k+1) A(Gk+1)(k+1)OPT(G)(k/k+1),其中又可以证明对于 G m G^m Gm中体积为t的团,可以在多项式时间找到t/m的团,因此后面容易得到矛盾

相对性能保证

  1. 多机调度

1)问题定义:

n个作业J1、J2…Jn,相应的运行时间为P1、P2、P3…Pn。将n个作业分配到m台同样的机器上,使得完成时间最短。
完成时间:是指所有机器运行总时间最长的那一台机器的运行时间
可行解集合:n个作业划分为m个子集,该问题即使在m=2也是NP-hard

2)List调度算法

n个作业依次以online的方式分配到m台机器的某一台上,规则是当前作业分配到当时负载最小的机器上,也就是当前分配的所有作业总的运行时间
有定理:对于该算法对于所有输入实例有 A ( I ) O P T ( I ) ≤ 2 − 1 m \frac{A(I)}{OPT(I)}\le 2-\frac{1}{m} OPT(I)A(I)2m1,并且界是紧致的,因为存在实例使得等号成立
证明:设最后一个放工作量为 J i J_i Ji的作业,且该调度算法的最终解的值为L,则显然其他机器上的作业量都少于 L − J i L-J_i LJi,所以可以得到 O P T ( I ) ∗ m ≥ ( L − J i ) ∗ ( m − 1 ) + L OPT(I)*m\ge (L-J_i)*(m-1)+L OPT(I)m(LJi)(m1)+L,故有 L ≤ O P T ( I ) + J i m − 1 m ≤ ( 2 − 1 m ) O P T ( I ) L\le OPT(I)+J_i\frac{m-1}m\le (2-\frac1 m)OPT(I) LOPT(I)+Jimm1(2m1)OPT(I)成立
再证明近似比的紧确界,这里用n=m(m-1)+1的例子,前n-1个作业需要单位1时长,最后一个需要m时长。也就是很明显用List调度算法需要用2m-1的时长;而这里最优解实际上是将m时长的任务单独做,则需要m时长

  1. 相对性能度量

算法A在一个输入实例I上的性能比 R A ( I ) R_A(I) RA(I)被定义为
R A ( I ) = { A ( I ) O P T ( I ) i f 最 小 化 问 题 O P T ( I ) A ( I ) i f 最 大 化 问 题 R_A(I)=\begin{cases} \frac{A(I)}{OPT(I)} if 最小化问题\\ \frac{OPT(I)}{A(I)} if 最大化问题 \end{cases} RA(I)={OPT(I)A(I)ifA(I)OPT(I)if
显然 R A ( I ) ≤ 1 R_A(I)\le 1 RA(I)1,越接近1越好,若 R A ( I ) ≤ ( 1 + ϵ ) R_A(I)\le (1+ \epsilon) RA(I)(1+ϵ),则称A是 1 + ϵ 1+\epsilon 1+ϵ-近似算法

对于优化问题,近似算法A的绝对性能比RA是 R A = i n f r ∣ R A ( I ) ≤ r , ∀ I ∈ D R_A=inf{r|R_A(I)\le r, \forall I \in D} RA=infrRA(I)r,ID R A R_A RA是性能比上界集合中的下确界(最大下界)

  1. LPT

将作业按其运行时间递减排序,然后用List策略调度
定理:LPT算法的性能比: R L P T = 4 3 − 1 3 m R_{LPT}=\frac4 3 - \frac 1 {3m} RLPT=343m1
证明:
1)当m=1时,成立
2)m>1时,假设存在一个反例I使得 R A ( I ) > 4 3 − 1 3 m R_A(I) > \frac4 3 - \frac 1 {3m} RA(I)>343m1
首先证明这个反例的最后一个处理的工作一定是 P n P_n Pn
若不是 P n P_n Pn,则有一个 P k P_k Pk是最后一个处理,则序列 P 1 . . . P k P_1...P_k P1...Pk的A算法处理时间A(I_k)=A(I),且明显OPT(I_k)<OPT(I),故有更小的k个作业满足这个反例,因此矛盾,最后一个处理的工作只能是 P n P_n Pn

然后证明在这个反例的条件下每个机器上的作业最多有2个
因为最后一个是 A ( P n ) A(P_n) A(Pn),则有 A ( I ) − P n ≤ ∑ i = 1 n − 1 P i m A(I)-P_n\le \frac{\sum_{i=1}^{n-1}P_i} m A(I)Pnmi=1n1Pi,并且又由 O P T ( I ) ≥ ∑ i = 1 n P i m OPT(I)\ge \frac{\sum_{i=1}^{n}P_i} m OPT(I)mi=1nPi,因此有 A ( I ) ≤ O P T ( I ) + m − 1 m P n A(I)\le OPT(I)+\frac{m-1}{m}P_n A(I)OPT(I)+mm1Pn,故有 4 3 − 1 3 m < A ( I ) O P T ( I ) < 1 + ( m − 1 ) P n m O P T ( I ) \frac 4 3 - \frac 1 {3m}<\frac{A(I)}{OPT(I)}<1+\frac{(m-1)P_n}{m OPT(I)} 343m1<OPT(I)A(I)<1+mOPT(I)(m1)Pn,可以证得 O P T ( I ) < 3 P n OPT(I)<3P_n OPT(I)<3Pn
因此我们有结论,在这个反例下每个机器的工作作业不超过2

下面再证明至多包含2个作业时,LPT也是最优的
可以令n=2m,若n<2m,则可以对剩余的部分补工作时长为0的工作。
则对于每台机器上的作业I,j都有i<m<j,因为若不满足这个条件,也就是i<j<m,则必有s>t>m,则我们可以交换i和t,则一定能得到比原先时长更短的序列,故矛盾。

因此相当于先把所有1-m的作业分配到m个机器上,再把剩下m个作业分配到机器上,和OPT的调度结果相同,因此 A ( I ) O P T ( I ) = 1 \frac{A(I)}{OPT(I)}=1 OPT(I)A(I)=1矛盾。

最后我们还需要证明等号成立的情况

  1. 渐进性能比

定义: R A max ⁡ = i n f { r ∣ ∃ N ∈ Z + , R A ( I ) ≤ r , ∀ I ∈ D π w i t h O P T ( I ) ≥ N } R_A^{\max}=inf\{r|\exist N \in Z^+,R_A(I)\le r, \forall I \in D_{\pi} with OPT(I)\ge N\} RAmax=inf{rNZ+,RA(I)r,IDπwithOPT(I)N}
只有对于scaling性质的问题,近似算法的绝对性能比和渐进性能比是相同的

  1. 装箱问题

1)首次适应算法(FF):对于每个物品每次从头到尾扫描箱子,若有合适的则放入
显然 R F F ( I ) ≤ 2 R_{FF}(I)\le 2 RFF(I)2
证明整个过程至多只有一个箱子是大于半空的。然后反证法可以证明矛盾
渐进性能比为7/4,不同

2)递减首次合适算法
R F F D ≤ 3 / 2 , R F F D m a x = 11 / 9 R_{FFD}\le 3/2, R_{FFD}^{max}=11/9 RFFD3/2,RFFDmax=11/9

  1. TSP问题
    这里我们考虑的都是满足三角不等式的TSP问题

1)近邻法:从任一顶点开始,出发访问一个最近的未访问过的顶点, R N N m a x = θ ( l g n ) R_{NN}^{max}=\theta(lgn) RNNmax=θ(lgn)

2)MST启发
step1:在G中找到一条最小生成树T
step2:复制T中的所有边做一个T的多重图
step3:对于多重图做一个欧拉回路
step4:去除欧拉回路中已经访问的点
在这里插入图片描述
在这里插入图片描述
很显然对于 d ( T ) < O P T ( G ) d(T)<OPT(G) d(T)<OPT(G),则必有 A M S T ( G ) ≤ d ( E T ) = 2 d ( T ) < 2 O P T ( G ) A_{MST}(G)\le d(ET)=2d(T)<2OPT(G) AMST(G)d(ET)=2d(T)<2OPT(G)

3)CH启发:实际上就是做欧拉回路的时候多重图不再是对T所有边进行重复,而是仅仅对奇数点进行重复,这样使得所有点的度数为偶数

这里引入匹配集的概念:就是添加边之后使得T度数为偶数的边集合
在这里插入图片描述
例如图中就是可以添加{B、E},{C、D}或者{B、C},{D、E}
并且这些边共同组成了一个回路O,且很容易证明得到 d ( O ) ≤ d ( T ) ≤ O P T ( G ) d(O)\le d(T)\le OPT(G) d(O)d(T)OPT(G)
因此对于O中的最小匹配集必然满足 d ( M ) ≤ d ( O ) / 2 d(M)\le d(O)/2 d(M)d(O)/2成立
因此很容易证明得到最终得到的 A C H ( G ) < d ( M ) + O P T ( G ) ≤ 1.5 O P T ( G ) A_CH(G)<d(M)+OPT(G) \le 1.5OPT(G) ACH(G)<d(M)+OPT(G)1.5OPT(G)
但是找最小匹配集需要 O ( n 3 ) O(n^3) O(n3)的时间,而MST启发的运行时间为 O ( n ) O(n) O(n)

相对近似之否定结果

  1. 问题的近似算法之间无关联

例如:顶点覆盖和最大集问题,虽然他们的解互相为补集,但最优算法之间并没有关系。VC问题有一个近似比为2的算法,但实际上对于MIS问题,并不能由此推断也有近似比为常数的算法。例如VC中一个最优解为 O P T V C ( G ) = n / 2 − 1 OPT_{VC}(G)=n/2-1 OPTVC(G)=n/21,则近似解为 A V C ( G ) = n − 2 A_{VC}(G)=n-2 AVC(G)=n2,由补集可得MIS的近似解为 A M I S ( G ) = 2 A_{MIS}(G)=2 AMIS(G)=2,但是最优解为 O P T M I S ( G ) = n / 2 + 1 OPT_{MIS}(G)=n/2+1 OPTMIS(G)=n/2+1,显然他们的比值并不是常数

  1. 近似算法不存在

在这里插入图片描述
也就是说有一类问题的无穷近似解就是无穷,这类解是不能称作有近似解的。这里可以用反证法证明
定理:若 P ≠ N P P\not= NP P=NP,则 R M I N ( T S P ) = 无 穷 R_{MIN}(TSP)=无穷 RMIN(TSP)=
假如不为无穷为k,则对于 A ( I ) ≤ k O P T ( I ) = k n A(I)\le kOPT(I)=kn A(I)kOPT(I)=kn,否则 A ( I ) ≥ O P T ( I ) ≥ ( k + 1 ) n − 1 A(I)\ge OPT(I)\ge (k+1)n-1 A(I)OPT(I)(k+1)n1,因此可以通过A找到解之值来判定G中是否存在HC。NPC问题矛盾

  1. 否定总结
    1)绝对近似之否定:很多问题找不到绝对近似算法
    2)相对近似之否定:很多问题的有界性能比近似算法不存在
    3)两类近似算法之间的近似性能(相对误差): ∣ O P T ( I ) − A ( I ) ∣ ≤ f ( n ) |OPT(I)-A(I)|\le f(n) OPT(I)A(I)f(n)
    这种情况下反而有空能蕴含着渐进性能比为1的情况,例如当 f ( n ) = l g 2 ( O P T ( I ) ) f(n)=lg^2(OPT(I)) f(n)=lg2(OPT(I))

其他

调度算法的近似方案,对于n个作业的前k个进行最优化寻找(可以通过穷举),对于后面的使用LPT算法
有绝对性能比为 1 + 1 − 1 / m 1 + [ k / m ] 1+\frac{1-1/m}{1+[k/m]} 1+1+[k/m]11/m
先证明 A k ( I ) A_k(I) Ak(I)的上界,由第j个是最后一个任务,则该机器上时间为 A k ( I ) A_k(I) Ak(I),则此时其他m-1个机器都是大于 A k ( I ) − P j A_k(I)-P_j Ak(I)Pj,则总时长 T ≥ m ( A k ( I ) − P j ) + P j T\ge m(A_k(I)-P_j)+P_j Tm(Ak(I)Pj)+Pj,其中对于T又有 T ≤ O P T ( I ) ∗ m T\le OPT(I)*m TOPT(I)m,故可以得到 A k ( I ) ≤ O P T ( I ) + ( 1 − 1 / m ) P j A_k(I)\le OPT(I)+(1-1/m)P_j Ak(I)OPT(I)+(11/m)Pj

再证明OPT(I)的下界,则有 O P T ( I ) ≥ ( 1 + [ k / m ] ) P j OPT(I)\ge (1+[k/m])P_j OPT(I)(1+[k/m])Pj得证

  • 1
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
这本书在国内已经绝版。目录如下 Introduction Dorit S. Hochbaum 0.1 What can approximation algorithms do for you: an illustrative example 0.2 Fundamentals and concepts 0.3 Objectives and organization of this book 0.4 Acknowledgments I Approximation Algorithms for Scheduling Leslie A. Hall 1.1 Introduction 1.2 Sequencing with Release Dates to Minimize Lateness 1.2.1 Jacksons rule 1.2.2 A simple 3/2-approximation algorithm 1.2.3 A polynomial approximation scheme 1.2.4 Precedence constraints and preprocessing 1.3 Identical parallel machines: beyond list scheduling 1.3.1 P|rj,prec|Lmax:: list scheduling revisited 1.3.2 The LPT rule for P‖Cmax 1.3.3 The LPT rule for P|rj|Cmax 1.3.4 Other results for identical parallel machines 1.4 Unrelated parallel machines 1.4.1 A 2-approximation algorithm based on linear programming 1.4.2 An approximation algorithm for minimizing cost and makespan 1.4.3 A related result from network scheduling 1.5 Shop scheduling 1.5.1 A greedy 2-approximation algorithm for open shops 1.5.2 An algorithm with an absolute error bound 1.5.3 A 2 E -approximation algorithm for fixed job and flow shops 1.5.4 The general job shop: unit-time operations 1.6 Lower bounds on approximation for makespan scheduling 1.6.1 Identical parallel machines and precedence constraints 1.6.2 Unrelated parallel machines 1.6.3 Shop scheduling 1.7 Min-sum Objectives 1.7.1 Sequencing with release dates to minimize sum of completion times 1.7.2 Sequencing with precedence constraints 1.7.3 Unrelated parallel machines 1.8 Final remarks 2 Approximation Algorithms for Bin Packing: A Survey E. G. Coffman, Jr., M. R. Garey, and D. S. Johnson 2.1 Introduction 2.2 Worst-case analysis 2.2.1 Next fit 2.2.2 First fit 2.2.3 Best fit, worst fit, and almost any fit algorithms 2.2.4 Bounded-space online algorithms 2.2.5 Arbitrary online algorithms 2.2.6 Semi-online algorithms 2.2.7 First fit decreasing and best fit decreasing 2.2.8 Other simple offline algorithms 2.2.9 Special-case optimality, approximation schemes, and asymptotically optimal algorithms 2.2.10 Other worst-case questions 2.3 Average-case analysis 2.3.1 Bounded-space online algorithms 2.3.2 Arbitrary online algorithms 2.3.3 Offiine algorithms 2.3.4 Other average-case questions 2.4 Conclusion Approximating Covering and Packing Problems: Set Cover, Vertex Cover, Independent Set, and Related Problems Dorit S. Hachbaum 3.1 Introduction 3.1.1 Definitions, formulations and applications 3.1.2 Lower bounds on approximations 3.1.3 Overview of chapter 3.2 The greedy algorithm for the set cover problem 3.3 The LP-algorithm for set cover 3.4 The feasible dual approach 3.5 Using other relaxations to derive dual feasible solutions 3.6 Approximating the multicoverproblem 3.7 The optimal dual approach for the vertex cover and independent set problems: preprocessing 3.7.1 The complexity of the LP-relaxation of vertex cover and independent set 3.7.2 Easily colorable graphs 3.7.3 A greedy algorithm for independent set in unweighted graphs 3.7.4 A local-ratio theorem and subgraph removal 3.7.5 Additional algorithms without preprocessing 3.7.6 Summary of approximations for vertex cover and independent set 3.8 Integer programming with two variables per inequality 3.8.1 The half integrality and the linear programming relaxation 3.8.2 Computing all approximate solution 3.8.3 The equivalence of IP2 to 2-SAT and 2-SAT to vertex cover 3.8.4 Properties of binary integer programs 3.8.5 Dual feasible solutions for IP2 3.9 The maximum coverage problem and the greedy 3.9.1 Tile greedy approach 3.9.2 Applications of the maxinmum coverage problem 4 The Primal-Dual Methud for Approximation Algorithms and Its Applicatiun to Network Design Problems Michel X. Goemans and David P. Williamson 4.1 Introduction 4.2 The classical primal-dual method 4.3 Thc primal-dual method Im approximation algorithms 4.4 A model of network design problems 4.4.1 0-I functions 4.5 Downwards monotone functions 4.5.1 The edge-covering problem 4.5.2 Lower capacitated partitioning problems 4.5.3 Location-design and location-routing problems 4.5.4 Proof of Theorems 4.5 and 4.6 4.6 0-1 proper functions 4.6.1 The generalized Sterner tree problem 4.6.2 The T-join problem 4.6.3 The minimum-weight perfect matching problem 4.6.4 Point-to-point connection problems 4.6.5 Exact partitioning problems 4.7 General proper functions 4.8 Extensions 4.8.1 Mininmm multicut in trees 4.8.2 The prize-collecting problems 4.8.3 Vertex connectivity problems 4.9 Conclusions 5 Cut Problems and Their Application to Divide-and-Conquer David B. Shmoys 5.1 Introduction 5.2 Minimum multicuts and maximum multicommodity flow 5.2.1 Multicuts, maximum multicommodity flow, and a weak duality theorem 5.2.2 Fractional multicuts, pipe systems, and a strong duality theorem 5.2.3 Solving the linear programs 5.2.4 Finding a good multicut 5.3 Sparsest cuts and maximum concurrent flow 5.3.1 The sparsest cut problem 5.3.2 Reducing the sparsest cut problem to the minimum multicut problem 5.3.3 Embeddings and the sparsest cut problem 5.3.4 Finding a good embedding 5.3.5 The maximum concurrent flow problem 5.4 Minimum feedback arc sets and related problems 5.4.1 An LP-based approximation algorithm 5.4.2 Analyzing the algorithm Feedback 5.4.3 Finding a good partition 5.5 Finding balanced cuts and other applications 5.5.1 Finding balanced cuts 5.5.2 Applications of balanced cut theorems 5.6 Conclusions Approximation Algorithms for Finding Highly Connected Suhgraphs Samir KhulJer 6.1 Introduction 6.1.1 Outline of chapter and techniques 6.2 Edge-connectivity problems 6.2.1 Weighted edge-connectivity 6.2.2 Unweighted edge-connectivity 6.3 Vertex-connectivity problems 6.3.1 Weighted vertex-connectivity 6.3.2 Unweighted vertex-connectivity 6.4 Strong-connectivity problems 6.4.1 Polynomial time approximation algorithms 6.4.2 Nearly linear-time implementation 6.5 Connectivity augmentation 6.5.1 increasing edge connectivity from I to 2 6.5.2 Increasing vertex connectivity from I to 2 6.5.3 Increasing edge-connectivity to 3. Algorithms for Finding Low Degree Structures Balaji Raghavachari 7.1 Introduction 7.2 Toughness and degree 7.3 Matchings and MDST 7.4 MDST within one of optimal 7.4.1 Witness sets 7.4.2 The △* 1 algorithm 7.4.3 Performance analysis 7.5 Local search techniques 7.5.1 MDST problem 7.5.2 Constrained forest problems 7.5.3 Two-connected subgraphs 7.6 Problems with edge weights - points in Euclidean spaces 7.7 Open problems 8 Approximation Algorithms for Geometric Problems Marshall Bern and David Eppstein 8.1 Introduction 8.1.1 Overview of topics 8.1.2 Special nature of geometric problems 8.2 Traveling salesman problem 8.2.1 Christofides algorithm 8.2.2 Heuristics 8.2.3 TSP with neighborhoods 8.3 Steiner tree problem 8.3.1 Steiner ratios 8.3.2 Better approximations 8.4 Minimum weight triangulation 8.4.1 Triangulation without Steiner points 8.4.2 Steiner triangulation 8.5 Clustering 8.5.1 Minmax k-clustering 8.5.2 k-minimum spanning tree 8.6 Separation problems 8.6.1 Polygon separation 8.6.2 Polyhedron separation 8.6.3 Point set separation 8.7 Odds and ends 8.7.1 Covering orthogonal polygons by rectangles 8.7.2 Packing squares with fixed comers 8.7.3 Largest congruent subsets 8.7.4 Polygon bisection 8.7.5 Graph embedding 8.7.6 Low-degree spanning trees 8.7.7 Shortest paths in space 8.7.8 Longest subgraph problems 8.8 Conclusions 9 Various Notions of Approximations: Good, Better, Best, and More Dorit S. Hochbaum 9.1 Introduction 9.1.1 Overview of chapter 9.2 Good: fixed constant approximations 9.2.1 The weighted undirected vertex feedback set problem 9.2.2 The shortest superstring problem 9.2.3 How maximization versus minimization affects approximations 9.3 Better: approximation schemes 9.3.1 A fully polynomial approximation scheme for the knapsack problem 9.3.2 The minimum makespan and the technique of dual approximations 9.3.3 Geometric packing and covering--the shifting technique 9.4 Best: unless NP = P 9.4.1 The k-center problem 9.4.2 A powerful approximation technique for bottleneck problems 9.4.3 Best possible parallel approximation algorithms 9.5 Better than best 9.5.1 A FPAS for bin packing 9.5.2 A 9/8-approximation algorithm for ~dge coloring of multigraphs and beyond 9.6 Wonderful: within one unit of optimum 10 Hardness of Approximations San jeer Arora and Carsten Lund 10.1 Introduction 10.2 How to prove inapproximability results 10.2.1 The canonical problems 10.2.2 Inapproximability results for the canonical problems 10.2.3 Gap preserving reductions 10.3 Inapproximability results for problems in class I 10.3.1 Max-SNP 10.4 Inapproximability results for problems in class II 10.4.1 SETCOVER 10.5 Inapproximability results lor problems in class 111 10.5.1 LABELCOVER maximization version ,. 10.5.2 LABELCOVER mtn version 10.5.3 Nearest lattice vector problem 10.6 Inapproximability results for problems in class IV 10.6.1 CLIQUE 10.6.2 COLORING 10.7 Inapproximability results at a glance 10.7.1 How to prove other hardness results: a case study 10.8 prohabilistically checkable proofs and inapproximability 10.8.1 The PCP theorem 10.8.2 Connection to inapproximability of MAX-3SAT 10.8.3 Where the gap comes from 10.9 Open problems 10.10 Chapter notes 11 Randomized Approximation Algorithms in Combinatorial Optimization Rajeev Motwani, Joseph Seffi Naor, and Prabhakar Raghavan 11.1 Introduction 11.2 Rounding linear programs 11.2.1 The integer multicommodity flow problem 11.2.2 Covering and packing problems 11.2.3 The maximum satisfiability problem 11.2.4 Related work 11.3 Semidefinite programming 11.3.1 The maximum cut problem 11.3.2 The graph coloring problem 11.4 Concluding remarks 11.4.1 Derandomizafion and parallelization 11.4.2 Computational experience 11.4.3 Open problems 12 The Markov Chain Monte Carlo Method: An Approach to Approximate Counting and Integration Mark Jerrum and Alistair Sinclair 12.1 Introduction 12.2 An illustrative example 12.3 Two techniques for bounding the mixing time 12.3.1 Canonical paths 12.3.2 Conductance 12.4 A more complex example: monomer-dimer systems 12.5 More applications 12.5.1 The permanent 12.5.2 Volume of convex bodies 12.5.3 Statistical physics 12.5.4 Matroid bases: an open problem 12.6 The Metropolis algorithm and simulated annealing Appendix 13 Online Computation Sandy Irani and Anna R. Karlin 13.1 Introduction 13.2 Three examples of competitive analysis 13.2.1 Paging 13.2.2 The k-server problem 13.2.3 Metrical task systems 13.3 Theoretical underpinnings: deterministic algorithms 13.3.1 Lower bounds 13.3.2 Design principles 13.3.3 Bounding competitiveness 13.4 Theoretical underpinnings: randomized algorithms 13.4.1 Example: paging 13.4.2 Lower bounds 13.4.3 The relationships between the adversaries 13.5 The k-server problem revisited 13.5.1 History. 13.5.2 Notation and properties of work functions. 13.5.3 The work function algorithm WFA 13.5.4 Proof of 2k - 1 -competitiveness 13.5.5 The duality lemma 13.5.6 The potential function 13.5.7 Quasi-convexity and the duality lemma 13.6 Online load balancing and virtual circuit routing 13.6.1 Load balancing on unrelated machines 13.6.2 Online virtual circuit routing 13.6.3 Recent results 13.7 Variants of competitive analysis 13.8 Conclusions and directions for future research Glossary of Problems Index
烟台科网络所NLP算法笔试,是一场为评估应聘者在自然语言处理领域的能力而设立的测试。该笔试内容主要涉及自然语言处理的理论知识和基础算法的应用。参加此次笔试的应聘者需要具备扎实的自然语言处理理论基础和相关算法的实践经验。 在此次笔试,可能会涉及到自然语言处理技术的基本概念、文本预处理、分词、词性标注、命名实体识别、文本分类、情感分析、文本生成等方面的内容。应聘者需要回答相关问题,并在一定时间内解答编程题目。 针对笔试的准备工作,应聘者需要系统学习自然语言处理的基本知识,如自然语言处理的发展历程、常用的自然语言处理算法、常见的自然语言处理任务等。同时,还需要关注自然语言处理领域的最新研究进展和相关论文,了解业界的最佳实践以及前沿技术。 为了提高应对此次笔试的能力,应聘者可以通过刷题和实践项目来加强自己的编程能力和实战经验。可以选择一些经典的自然语言处理算法实现来进行学习和练习,如基于统计模型的分词、词性标注和命名实体识别算法,基于深度学习的文本分类和情感分析算法等。 总之,参加烟台科网络所NLP算法笔试需要应聘者准备充分,具备扎实的自然语言处理理论知识和实践经验,并熟练掌握常用的自然语言处理算法和工具。同时,还需关注自然语言处理领域的最新研究进展,不断提升自身的专业能力。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值