算法设计与分析算法设计与分析 (13).ppt
《算法设计与分析算法设计与分析 (13).ppt》由会员分享,可在线阅读,更多相关《算法设计与分析算法设计与分析 (13).ppt(23页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、1Chapter 12Local SearchSlides by Kevin Wayne.Copyright 2005 Pearson-Addison Wesley.All rights reserved.2Coping With NP-HardnessQ.Suppose I need to solve an NP-hard problem.What should I do?A.Theory says youre unlikely to find poly-time algorithm.Must sacrifice one of three desired features.nSolve pr
2、oblem to optimality.nSolve problem in polynomial time.nSolve arbitrary instances of the problem.12.1 Landscape of an Optimization Problem4Gradient Descent:Vertex CoverVERTEX-COVER.Given a graph G=(V,E),find a subset of nodes S of minimal cardinality such that for each u-v in E,either u or v(or both)
3、are in S.Neighbor relation.S S if S can be obtained from S by adding or deleting a single node.Each vertex cover S has at most n neighbors.Gradient descent.Start with S=V.If there is a neighbor S that is a vertex cover and has lower cardinality,replace S with S.Remark.Algorithm terminates after at m
4、ost n steps since each update decreases the size of the cover by one.5Gradient Descent:Vertex CoverLocal optimum.No neighbor is strictly better.optimum=center node onlylocal optimum=all other nodesoptimum=all nodes on left sidelocal optimum=all nodes on right sideoptimum=even nodeslocal optimum=omit
5、 every third node6Local SearchLocal search.Algorithm that explores the space of possible solutions in sequential fashion,moving from a current solution to a nearby one.Neighbor relation.Let S S be a neighbor relation for the problem.Gradient descent.Let S denote current solution.If there is a neighb
6、or S of S with strictly lower cost,replace S with the neighbor whose cost is as small as possible.Otherwise,terminate the algorithm.A funnelA jagged funnel12.4 Maximum Cut8Maximum CutMaximum cut.Given an undirected graph G=(V,E)with positive integer edge weights we,find a node partition(A,B)such tha
7、t the total weight of edges crossing the cut is maximized.Toy application.nn activities,m people.nEach person wants to participate in two of the activities.nSchedule each activity in the morning or afternoon to maximize number of people that can enjoy both activities.Real applications.Circuit layout
8、,statistical physics.9Maximum CutSingle-flip neighborhood.Given a partition(A,B),move one node from A to B,or one from B to A if it improves the solution.Greedy algorithm.10Maximum Cut:Local Search AnalysisTheorem.Let(A,B)be a locally optimal partition and let(A*,B*)be optimal partition.Then w(A,B)e
9、 we w(A*,B*).Pf.nLocal optimality implies that for all u A:Adding up all these inequalities yields:nSimilarlynNow,each edge counted onceweights are nonnegative11Maximum Cut:Big Improvement FlipsLocal search.Within a factor of 2 for MAX-CUT,but not poly-time!Big-improvement-flip algorithm.Only choose
10、 a node which,when flipped,increases the cut value by at least Claim.Upon termination,big-improvement-flip algorithm returns a cut(A,B)with(2+)w(A,B)w(A*,B*).Pf idea.Add to each inequality in original proof.Claim.Big-improvement-flip algorithm terminates after O(-1 n log W)flips,where W=e we.nEach f
11、lip improves cut value by at least a factor of(1+/n).nAfter n/iterations the cut value improves by a factor of 2.nCut value can be doubled at most log W times.if x 1,(1+1/x)x 212Maximum Cut:ContextTheorem.Sahni-Gonzales 1976 There exists a-approximation algorithm for MAX-CUT.Theorem.Goemans-Williams
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 算法设计与分析算法设计与分析 13 算法 设计 分析 13
限制150内