Coping With NP-Hardne Chapter 12 Local Search Q Suppoe I need to olve an NP-hard problem What hould I do? A Theory ay you're unlikely to find poly-time algorithm Mut acrifice one of three deired feature Solve problem to optimality Solve problem in polynomial time Solve arbitrary intance of the problem Slide by Kevin Wayne Copyright @ 2005 Pearon-Addion Weley All right reerved 1 2 Gradient Decent: Vertex Cover 121 Landcape of an Optimization Problem VERTEX-COVER Given a graph G = (V, E), find a ubet of node S of minimal cardinality uch that for each u-v in E, either u or v (or both) are in S Neighbor relation S S' if S' can be obtained from S by adding or deleting a ingle node Each vertex cover S ha at mot n neighbor Gradient decent Start with S = V If there i a neighbor S' that i a vertex cover and ha lower cardinality, replace S with S' Remark Algorithm terminate after at mot n tep ince each update decreae the ize of the cover by one 4
Gradient Decent: Vertex Cover Local Search Local optimum No neighbor i trictly better Local earch Algorithm that explore the pace of poible olution in equential fahion, moving from a current olution to a "nearby" one Neighbor relation Let S S' be a neighbor relation for the problem Gradient decent Let S denote current olution If there i a neighbor S' of S with trictly lower cot, replace S with the neighbor whoe cot i a mall a poible Otherwie, terminate the algorithm optimum = center node only local optimum = all other node optimum = all node on left ide local optimum = all node on right ide optimum = even node local optimum = omit every third node A funnel A jagged funnel 5 6 Metropoli Algorithm 122 Metropoli Algorithm Metropoli algorithm [Metropoli, Roenbluth, Roenbluth, Teller, Teller 1953] Simulate behavior of a phyical ytem according to principle of tatitical mechanic Globally biaed toward "downhill" tep, but occaionally make "uphill" tep to break out of local minima Gibb-Boltzmann function The probability of finding a phyical ytem in a tate with energy E i proportional to e -E / (kt), where T > 0 i temperature and k i a contant For any temperature T > 0, function i monotone decreaing function of energy E Sytem more likely to be in a lower energy tate than higher one T large: high and low energy tate have roughly ame probability T mall: low energy tate are much more probable 8
Metropoli Algorithm Simulated Annealing Metropoli algorithm Given a fixed temperature T, maintain current tate S Randomly perturb current tate S to new tate S' N(S) If E(S') E(S), update current tate to S' Otherwie, update current tate to S' with probability e - ΔE / (kt), where ΔE = E(S') - E(S) > 0 Theorem Let f S (t) be fraction of firt t tep in which imulation i in tate S Then, auming ome technical condition, with probability 1: lim f S (t) = 1 t " # Z e$e(s) /(kt ), $E(S) /(kt ) where Z = & e S % N (S) Intuition Simulation pend roughly the right amount of time in each tate, according to Gibb-Boltzmann equation Simulated annealing T large probability of accepting an uphill move i large T mall uphill move are almot never accepted Idea: turn knob to control T Cooling chedule: T = T(i) at iteration i Phyical analog Take olid and raie it to high temperature, we do not expect it to maintain a nice crytal tructure Take a molten olid and freeze it very abruptly, we do not expect to get a perfect crytal either Annealing: cool material gradually from high temperature, allowing it to reach equilibrium at ucceion of intermediate lower temperature 9 10 Hopfield Neural Network 123 Hopfield Neural Network Hopfield network Simple model of an aociative memory, in which a large collection of unit are connected by an underlying network, and neighboring unit try to correlate their tate Input: Graph G = (V, E) with integer edge weight w Configuration Node aignment u = ± 1 poitive or negative Intuition If w uv < 0, then u and v want to have the ame tate; if w uv > 0 then u and v want different tate Note In general, no configuration repect all contraint 7 5 6 12
Hopfield Neural Network Hopfield Neural Network Def With repect to a configuration S, edge e = (u, v) i good if w e u v < 0 That i, if w e < 0 then u = v ; if w e > 0, u v Def With repect to a configuration S, a node u i atified if the weight of incident good edge weight of incident bad edge # w e u v $ 0 v: e=(u,v) " E Def A configuration i table if all node are atified -10 4-5 -1-1 atified node: 5-4 - 1-1 < 0 Goal Find a table configuration, if uch a configuration exit State-flipping algorithm Repeated flip tate of an unatified node Hopfield-Flip(G, w) { S arbitrary configuration while (current configuration i not table) { u unatified node u = - u return S bad edge Goal Find a table configuration, if uch a configuration exit 13 14 State Flipping Algorithm Hopfield Neural Network unatified node 10-8 > 0 unatified node 8-4 - 1-1 > 0 Claim State-flipping algorithm terminate with a table configuration after at mot W = Σ e w e iteration Pf attempt Conider meaure of progre Φ(S) = # atified node table 15 16
Hopfield Neural Network Complexity of Hopfield Neural Network Claim State-flipping algorithm terminate with a table configuration after at mot W = Σ e w e iteration Pf Conider meaure of progre Φ(S) = Σ e good w e Clearly 0 Φ(S) W We how Φ(S) increae by at leat 1 after each flip When u flip tate: all good edge incident to u become bad all bad edge incident to u become good all other edge remain the ame Hopfield network earch problem Given a weighted graph, find a table configuration if one exit Hopfield network deciion problem Given a weighted graph, doe there exit a table configuration? Remark The deciion problem i trivially olvable (alway ye), but there i no known poly-time algorithm for the earch problem polynomial in n and log W "(S') = "(S) # % w e + % w e & "(S) + 1 e: e = (u,v) $ E e i bad e: e = (u,v) $ E e i good u i unatified 17 18 Maximum Cut 124 Maximum Cut Maximum cut Given an undirected graph G = (V, E) with poitive integer edge weight w e, find a node partition (A, B) uch that the total weight of edge croing the cut i maximized w(a, B) := # w uv u" A, v " B Toy application n activitie, m people Each peron want to participate in two of the activitie Schedule each activity in the morning or afternoon to maximize number of people that can enjoy both activitie Real application Circuit layout, tatitical phyic 20
Maximum Cut Maximum Cut: Local Search Analyi Single-flip neighborhood Given a partition (A, B), move one node from A to B, or one from B to A if it improve the olution Greedy algorithm Max-Cut-Local (G, w) { Pick a random node partition (A, B) while ( improving node v) { if (v i in A) move v to B ele move v to A return (A, B) Theorem Let (A, B) be a locally optimal partition and let (A*, B*) be optimal partition Then w(a, B) ½ Σ e w e ½ w(a*, B*) Pf Local optimality implie that for all u A : Adding up all thee inequalitie yield: Similarly Now, each edge counted once % 1 2 2 # w uv $ # w uv = w(a, B) {u,v" A u % A, v % B # w e = # w uv + # w uv + # w uv % 2w(A, B) e" E {u,v$ A 14 243 u " A, v " B 14 243 {u,v$ A 14 243 w(a, B) w(a, B) weight are nonnegative 2 # w uv $ # w uv = w(a, B) {u,v" B u % A, v % B % 1 2 # v " A w uv $ # v " B w uv w( A, B) 21 22 Maximum Cut: Big Improvement Flip Maximum Cut: Context Local earch Within a factor of 2 for MAX-CUT, but not poly-time! Big-improvement-flip algorithm Only chooe a node which, when flipped, increae the cut value by at leat 2" n w(a, B) Claim Upon termination, big-improvement-flip algorithm return 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 terminate after O(ε -1 n log W) flip, where W = Σ e w e Each flip improve cut value by at leat a factor of (1 + ε/n) After n/ε iteration the cut value improve by a factor of 2 2" n w(a, B) Cut value can be doubled at mot log W time if x 1, (1 + 1/x) x 2 Theorem [Sahni-Gonzale 1976] There exit a ½-approximation algorithm for MAX-CUT Theorem [Goeman-Williamon 1995] There exit an 0878567- approximation algorithm for MAX-CUT 2 # min 0 " # " $ $ 1% co# Theorem [Håtad 1997] Unle P = NP, no 16/17 approximation algorithm for MAX-CUT 0941176 23 24
Neighbor Relation for Max Cut 125 Neighbor Relation 1-flip neighborhood (A, B) and (A', B') differ in exactly one node k-flip neighborhood (A, B) and (A', B') differ in at mot k node Θ(n k ) neighbor KL-neighborhood [Kernighan-Lin 1970] To form neighborhood of (A, B): Iteration 1: flip node from (A, B) that reult in bet cut value (A 1, B 1 ), and mark that node Iteration i: flip node from (A i-1, B i-1 ) that reult in bet cut value (A i, B i ) among all node not yet marked cut value of (A 1, B 1 ) may be wore than (A, B) Neighborhood of (A, B) = (A 1, B 1 ),, (A n-1, B n-1 ) Neighborhood include ome very long equence of flip, but without the computational overhead of a k-flip neighborhood Practice: powerful and ueful framework Theory: explain and undertand it ucce in practice 26 Multicat Routing 127 Nah Equilibria Multicat routing Given a directed graph G = (V, E) with edge cot c e 0, a ource node, and k agent located at terminal node t 1,, t k Agent j mut contruct a path P j from node to it terminal t j Fair hare If x agent ue edge e, they each pay c e / x 1 2 1 pay 2 pay outer outer 4 8 4 5 8 outer middle middle middle 4 outer 5 + 1 middle 5/2 + 1 5 + 1 8 5/2 + 1 v 1 1 t 1 t 2 28
Nah Equilibrium Nah Equilibrium and Local Search Bet repone dynamic Each agent i continually prepared to improve it olution in repone to change made by other agent Local earch algorithm Each agent i continually prepared to improve it olution in repone to change made by other agent Nah equilibrium Solution where no agent ha an incentive to witch Fundamental quetion When do Nah equilibria exit? Ex: Two agent tart with outer path Agent 1 ha no incentive to witch path (ince 4 < 5 + 1), but agent 2 doe (ince 8 > 5 + 1) Once thi happen, agent 1 prefer middle path (ince 4 > 5/2 + 1) Both agent uing middle path i a Nah equilibrium t 1 4 5 8 v 1 1 t 2 Analogie Nah equilibrium : local earch Bet repone dynamic : local earch algorithm Unilateral move by ingle agent : local neighborhood Contrat Bet-repone dynamic need not terminate ince no ingle objective function i being optimized 29 30 Socially Optimum Price of Stability Social optimum Minimize total cot to all agent Price of tability Ratio of bet Nah equilibrium to ocial optimum Obervation In general, there can be many Nah equilibria Even when it unique, it doe not necearily equal the ocial optimum Fundamental quetion What i price of tability? Ex: Price of tability = Θ(log k) Social optimum Everyone take bottom path Unique Nah equilibrium Everyone take top path Price of tability H(k) / (1 + ε) 3 5 5 1 + 1/2 + + 1/k 1 + ε k v 1 1/2 1/3 1/k k agent t 1 1 t 1 t 2 t 3 t k 1 + ε Social optimum = 1 + ε Nah equilibrium A = 1 + ε Nah equilibrium B = k t 1 t 2 Social optimum = 7 Unique Nah equilibrium = 8 0 0 0 0 31 32
Finding a Nah Equilibrium Finding a Nah Equilibrium Theorem The following algorithm terminate with a Nah equilibrium Bet-Repone-Dynamic(G, c) { Pick a path for each agent while (not a Nah equilibrium) { Pick an agent i who can improve by witching path Switch path of agent i Pf (continued) Conider agent j witching from path P j to path P j ' Agent j witche becaue $ f " P j ' # P j c f x f + 1 14 2443 newly incurred cot < $ e " P j # P j ' c e x e 14 243 cot aved Pf Conider a et of path P 1 Let x e denote the number of path that ue edge e Let Φ(P 1 ) = Σ e E c e H(x e ) be a potential function H(0) = 0, H(k) = " Since there are only finitely many et of path, it uffice to how that Φ trictly decreae in each tep k 1 i i=1 Φ increae by Φ decreae by $ f # P j ' " P j Thu, net change in Φ i negative c f [ H(x f +1) " H(x f )] = $ c e [ H(x e ) " H(x e " 1) ] = e # P j " P j ' $ f # P j ' " P j c $ e x e e # P j " P j ' c f x f + 1 33 34 Bounding the Price of Stability Bounding the Price of Stability Claim Let C(P 1 ) denote the total cot of electing path P 1 For any et of path P 1, we have Pf Let x e denote the number of path containing edge e Let E + denote et of edge that belong to at leat one of the path C(P 1,K, P k ) = C(P 1,K, P k ) " #(P 1,K, P k ) " H(k) $ C(P 1,K, P k ) c e e" E + # $ # c e H(x e ) e" E 14 + 243 %(P 1, K, P k ) $ # c e H(k) = H(k) C(P 1,K, P k ) e" E + Theorem There i a Nah equilibrium for which the total cot to all agent exceed that of the ocial optimum by at mot a factor of H(k) Pf Let (P 1* * ) denote et of ocially optimal path Run bet-repone dynamic algorithm tarting from P* Since Φ i monotone decreaing Φ(P 1 ) Φ(P 1* * ) C(P 1,K, P k ) " #(P 1,K, P k ) " #(P 1 *,K, P k *) " H(k) $ C(P 1 *,K, P k *) previou claim applied to P previou claim applied to P* 35 36
Summary Exitence Nah equilibria alway exit for k-agent multicat routing with fair haring Price of tability Bet Nah equilibrium i never more than a factor of H(k) wore than the ocial optimum Fundamental open problem Find any Nah equilibria in poly-time 37