Presentation is loading. Please wait.

Presentation is loading. Please wait.

“IBM Research Report A faster Exponential-Time Algorithm for Max 2-Sat, Max Cut, and Max k- Cut”, Alexander D. Scott, Gregory B. Sorkin, IBM Research Division.

Similar presentations


Presentation on theme: "“IBM Research Report A faster Exponential-Time Algorithm for Max 2-Sat, Max Cut, and Max k- Cut”, Alexander D. Scott, Gregory B. Sorkin, IBM Research Division."— Presentation transcript:

1 “IBM Research Report A faster Exponential-Time Algorithm for Max 2-Sat, Max Cut, and Max k- Cut”, Alexander D. Scott, Gregory B. Sorkin, IBM Research Division Presented By Troy McMahon

2 Problems Addressed Max 2-Sat Max 2-Sat Max Cut Max Cut Max k-Cut Max k-Cut

3 Background The fastest previous algorithm for Max 2- Sat has a runtime of ~O(2 m/5 ), where m is the number of clauses The fastest previous algorithm for Max 2- Sat has a runtime of ~O(2 m/5 ), where m is the number of clauses The fastest previous algorithm for Max Cut has a runtime of ~O(2 m/4 ), where m is the number of edges The fastest previous algorithm for Max Cut has a runtime of ~O(2 m/4 ), where m is the number of edges

4 Method This paper considers a single, more general class of problems that includes both Max Cut and 2-Sat. This paper considers a single, more general class of problems that includes both Max Cut and 2-Sat.

5 Notation D-vertex = “Vertex of degree d” D-vertex = “Vertex of degree d” m and n are the number of vertices and edges in a graph. m and n are the number of vertices and edges in a graph. [r] = {1,…,r} is the set of colors a vertex can be colored [r] = {1,…,r} is the set of colors a vertex can be colored

6 Max (r, 2)-CSP An instance consists of a graph G=(E,V), and a set of score functions, and a set of available colors [r]={1,…,r} An instance consists of a graph G=(E,V), and a set of score functions, and a set of available colors [r]={1,…,r} For every edge there exists a dyadic function s uv (r i,r j ) that maps [r] 2 -> R For every edge there exists a dyadic function s uv (r i,r j ) that maps [r] 2 -> R For every vertex there exists a monadic function s v (r i ) that maps [r] 1 -> R For every vertex there exists a monadic function s v (r i ) that maps [r] 1 -> R There is single also a “niladic” score function, s o () that maps [r] 0 -> R There is single also a “niladic” score function, s o () that maps [r] 0 -> R This function has no effect on the solution to the problem, and exists only for convenient bookkeeping This function has no effect on the solution to the problem, and exists only for convenient bookkeeping

7 Max (r, 2)-CSP A candidate solution,  :V->[r] is a coloring of the vertices (with colorings from [r]) A candidate solution,  :V->[r] is a coloring of the vertices (with colorings from [r]) The score of a coloring is given by the function The score of a coloring is given by the function The solution to an instance of the Max (r, 2)-CSP problem is the coloring of the graph that maximizes the total score The solution to an instance of the Max (r, 2)-CSP problem is the coloring of the graph that maximizes the total score

8 Max Cut Max Cut is the partition of a graph into two classes that maximizes the number of edges cut by the petition. Max Cut is the partition of a graph into two classes that maximizes the number of edges cut by the petition.

9 Max Cut Reduction to (r,2)CSP: Reduction to (r,2)CSP: Consider each edge to be a function that is 1 if the vertices it connects are different colors, and 0 otherwise Consider each edge to be a function that is 1 if the vertices it connects are different colors, and 0 otherwise Max Cut is equivalent to finding a 2-coloring of the vertices that maximizes the sum of all of the edge functions Max Cut is equivalent to finding a 2-coloring of the vertices that maximizes the sum of all of the edge functions Max Cut  (r,2)CSP Max Cut  (r,2)CSP

10 Max 2-Sat An instance of Max 2-sat consists of a set of 2ary Boolean functions An instance of Max 2-sat consists of a set of 2ary Boolean functions A solution is a setting of the variables that maximizes the number satisfied functions A solution is a setting of the variables that maximizes the number satisfied functions

11 Max 2-Sat Reduction to (r,2)CSP Reduction to (r,2)CSP Max 2-sat can be reduced to (r,2)CSP by creating a vertex for each variable and an edge fore every function Max 2-sat can be reduced to (r,2)CSP by creating a vertex for each variable and an edge fore every function The score of an edge is 1 whenever the corresponding function is satisfied and 0 otherwise The score of an edge is 1 whenever the corresponding function is satisfied and 0 otherwise Max 2-sat  (r,2)CSP Max 2-sat  (r,2)CSP

12 Algorithm Reduce vertices of degree 0 Reduce vertices of degree 0 Reduce vertices of degree 1 Reduce vertices of degree 1 Reduce vertices of degree 2 Reduce vertices of degree 2 Branch Branch

13 Reducing Vertices of Degree 0 If a vertex, y has no edges then that vertex has no dyadic constraints If a vertex, y has no edges then that vertex has no dyadic constraints Color y the color that maximizes the function for vertex y Color y the color that maximizes the function for vertex y Color(y) = maxarg CX[r] (s y (C) ) Color(y) = maxarg CX[r] (s y (C) ) An equivalent problem can be formed by increasing s o by max(s y (r) ), and removing y form the graph An equivalent problem can be formed by increasing s o by max(s y (r) ), and removing y form the graph This can be done in O(r) time This can be done in O(r) time

14 Reducing Vertices of Degree 1 Let y be a vertex of degree 1, and x be y’s neighbor Let y be a vertex of degree 1, and x be y’s neighbor Can be reduced to an equivalent problem by removing vertex y, and edge xy from the graph, and modifying the score functions in the following way Can be reduced to an equivalent problem by removing vertex y, and edge xy from the graph, and modifying the score functions in the following way For all CX[r], s x (C)= s x (C)+ max DX[r] {s xy (CD)+ s y (D)} For all CX[r], s x (C)= s x (C)+ max DX[r] {s xy (CD)+ s y (D)} This can be done in O(r 2 ) time This can be done in O(r 2 ) time

15 Reducing Vertices of Degree 1 Once an optimal coloring,  ‘ is found for the reduced graph, and optimal coloring,  for the original graph can be found in the following manner Once an optimal coloring,  ‘ is found for the reduced graph, and optimal coloring,  for the original graph can be found in the following manner  (y)=maxarg DX[r] {s xy (  ‘(x)D)+ s y (D)}  (y)=maxarg DX[r] {s xy (  ‘(x)D)+ s y (D)} For all other verities v,  (v)=  ‘(v) For all other verities v,  (v)=  ‘(v) This can be done in O(1) time This can be done in O(1) time

16 Reducing Vertices of Degree 1

17 Reducing Vertices of Degree 2 Let y be a vertex of degree 2, and x and z be y’s neighbors Let y be a vertex of degree 2, and x and z be y’s neighbors Can be reduced to an equivalent problem by removing vertex y, and the edges xy and zy from the graph, and modifying the score functions in the following way Can be reduced to an equivalent problem by removing vertex y, and the edges xy and zy from the graph, and modifying the score functions in the following way For all C,DX[r], s xz (CD)= s xz (CD)+ max EX[r] {s xy (CE) + s yz (ED)+ s y (E)} For all C,DX[r], s xz (CD)= s xz (CD)+ max EX[r] {s xy (CE) + s yz (ED)+ s y (E)} This can be done in O(r 3 ) time This can be done in O(r 3 ) time

18 Reducing Vertices of Degree 2 Once an optimal coloring,  ‘ is found for the reduced graph, and optimal coloring,  for the original graph can be found in the following manner Once an optimal coloring,  ‘ is found for the reduced graph, and optimal coloring,  for the original graph can be found in the following manner  (y)=maxarg EX[r] {s xy (  ‘(x)E) + s yz (E  ‘(z))+ s y (E)}  (y)=maxarg EX[r] {s xy (  ‘(x)E) + s yz (E  ‘(z))+ s y (E)} For all other verities v,  (v)=  ‘(v) For all other verities v,  (v)=  ‘(v) This can be done in O(1) time This can be done in O(1) time

19 Reducing Vertices of Degree 2

20 Branching Branching Algorithm Branching Algorithm y=highest degree vertex in G y=highest degree vertex in G V’=V/y V’=V/y E’=E-neighbors(y) E’=E-neighbors(y) For C=every color in [r] For C=every color in [r] So’=So+Sy(C) So’=So+Sy(C) For x=every neighbor of y For x=every neighbor of y Sx(D)’=Sx(D)+Sxy(CD) Sx(D)’=Sx(D)+Sxy(CD)  C =recurse on (V’, E’, S’) + {  (y)=C}  C =recurse on (V’, E’, S’) + {  (y)=C}  =max( ,  C )  =max( ,  C ) Return  Return  This algorithm only branches if there are no vertices of degree <3 that it can reduce This algorithm only branches if there are no vertices of degree <3 that it can reduce

21 Branching Graphical representation of a reduction on vertex x. Graphical representation of a reduction on vertex x. In this case the colors in [r] are red and blue In this case the colors in [r] are red and blue Vertex x is removed, and 2 new graphs are created (one where the vertex is red and one where it is blue) Vertex x is removed, and 2 new graphs are created (one where the vertex is red and one where it is blue) The optimal coloring of the original graph is the max of the optimal colorings of the two new graphs. The optimal coloring of the original graph is the max of the optimal colorings of the two new graphs.

22 Recursion Depth Lemma: If a graph has n vertices and m edges, than the graph is empty after m/5 branches Lemma: If a graph has n vertices and m edges, than the graph is empty after m/5 branches

23 Recursion Depth Case 1: If the graph has any vertices of degree P5, then the algorithm will branch on one of these vertices destroying at least 5 edges Case 1: If the graph has any vertices of degree P5, then the algorithm will branch on one of these vertices destroying at least 5 edges

24 Recursion Depth Graphs containing only vertices of degree 3 and 4 Graphs containing only vertices of degree 3 and 4

25 Recursion Depth Case 2: The highest degree vertex has degree 4. Case 2: The highest degree vertex has degree 4. If the vertex it branches on has at least one neighbor of degree 3 If the vertex it branches on has at least one neighbor of degree 3 4 edges will be destroyed directly 4 edges will be destroyed directly The neighbor of degree 3 will be reduced to degree 2 The neighbor of degree 3 will be reduced to degree 2 This vertex will be reduced at the next level destroying 1 additional edge This vertex will be reduced at the next level destroying 1 additional edge If the vertex it branches on has at least 4 neighbor of degree 4 If the vertex it branches on has at least 4 neighbor of degree 4 4 edges are destroyed 4 edges are destroyed 4 vertices of degree 3 are created 4 vertices of degree 3 are created The fact that this algorithm terminates with no vertices of degree 3 is enough to limit the number of such reductions The fact that this algorithm terminates with no vertices of degree 3 is enough to limit the number of such reductions

26 Recursion Depth Case 3: The graph contains only vertices of degree 3 Case 3: The graph contains only vertices of degree 3 Branching will eliminate 3 edges directly Branching will eliminate 3 edges directly Removing a vertex will reduce the degree of each of that vertex’s neighbors to 2 Removing a vertex will reduce the degree of each of that vertex’s neighbors to 2 These neighbors will be reduced at the next level without branching These neighbors will be reduced at the next level without branching At least 1 edge is destroyed for each of these neighbors At least 1 edge is destroyed for each of these neighbors In total at least 6 edges are destroyed In total at least 6 edges are destroyed

27 Recursion Depth Every time the algorithm branches, the number of edges is reduced by at least 5 Every time the algorithm branches, the number of edges is reduced by at least 5 The graph will be empty after m/5 branches The graph will be empty after m/5 branches The maximum number of times this algorithm can branch is therefore m/5 The maximum number of times this algorithm can branch is therefore m/5

28 Space Complexity This algorithm needs to store the best solution found at each level This algorithm needs to store the best solution found at each level The space complexity of this algorithm is therefore O(nd), or O(nm/5), The space complexity of this algorithm is therefore O(nd), or O(nm/5),

29 Time of Algorithm This algorithm has a branching factor of r This algorithm has a branching factor of r The time for each level is bounded by the function The time for each level is bounded by the function T( l )= O(2r 3 n) + rT( l -1) T( l )= O(2r 3 n) + rT( l -1) This algorithm therefore runs in O(r 3 nr m/5 ) time This algorithm therefore runs in O(r 3 nr m/5 ) time

30 Improved Algorithm Preference for selecting branching vertices Preference for selecting branching vertices Vertices of degree >=6 Vertices of degree >=6 Vertices of degree 5 that have at least 1 neighbor of degree 3 or 4 Vertices of degree 5 that have at least 1 neighbor of degree 3 or 4 Vertices of degree 5 with only degree 5 neighbors Vertices of degree 5 with only degree 5 neighbors Vertices of degree 4 that have at least 1 neighbor of degree 3 Vertices of degree 4 that have at least 1 neighbor of degree 3 Vertices of degree 4 with only degree 4 neighbors Vertices of degree 4 with only degree 4 neighbors Vertices of Degree 3 Vertices of Degree 3 All other aspects of this algorithm are the same as the first algorithm All other aspects of this algorithm are the same as the first algorithm

31 Reduction Forest A reduction on a vertex, v, can split component of the graph containing G into multiple subcomponents A reduction on a vertex, v, can split component of the graph containing G into multiple subcomponents Let k(v) be the number of sub-components that a reduction on v will yield Let k(v) be the number of sub-components that a reduction on v will yield This defines a “reduction forest” This defines a “reduction forest” Nodes in the reduction forest correspond to possible vertex reductions Nodes in the reduction forest correspond to possible vertex reductions Each node has a child for every sub-component that is created by that node’s corresponding reduction Each node has a child for every sub-component that is created by that node’s corresponding reduction A node n’s children correspond to the first reductions in A node n’s children correspond to the first reductions in

32 Splitting Tree Splitting trees can be formed by contracting out all of the nodes that correspond to reductions on vertices of degreeO2 Splitting trees can be formed by contracting out all of the nodes that correspond to reductions on vertices of degreeO2 The depth of a splitting tree is equal to the maximum number of branching reductions that occur along the corresponding sequence The depth of a splitting tree is equal to the maximum number of branching reductions that occur along the corresponding sequence The maximum number of branching reductions is bounded by the maximum splitting tree depth The maximum number of branching reductions is bounded by the maximum splitting tree depth

33 Depth of Splitting Tree Lemma: For a graph with m edges, the depth of the splitting tree is at most 2+19m/100 Lemma: For a graph with m edges, the depth of the splitting tree is at most 2+19m/100

34 Depth of Splitting Tree Case 1: If the graph has a vertex of degree P6, then the algorithm branches on this vertex destroying 6 edges Case 1: If the graph has a vertex of degree P6, then the algorithm branches on this vertex destroying 6 edges We only need to consider graphs with vertices of degree <6 We only need to consider graphs with vertices of degree <6

35 Depth of Splitting Tree There are only two types of branching reductions that don’t destroy at least 6 edges There are only two types of branching reductions that don’t destroy at least 6 edges Reductions on vertices of degree 5 that have only degree 5 neighbors Reductions on vertices of degree 5 that have only degree 5 neighbors Reductions on verities of degree 4 that have only degree 4 neighbors Reductions on verities of degree 4 that have only degree 4 neighbors The improved algorithm works by limiting the number of occurrences of these types of reductions The improved algorithm works by limiting the number of occurrences of these types of reductions

36 Degree 5 Vertices With 5 Degree 5 Neighbors If a component requires a reduction on a degree 5 vertex with 5 degree 5 neighbors on of 4 things must be true If a component requires a reduction on a degree 5 vertex with 5 degree 5 neighbors on of 4 things must be true a. The reduction is the first degree 5 reduction in this branch of the splitting tree a. The reduction is the first degree 5 reduction in this branch of the splitting tree This only occurs once per branch, and contributes at most 1 to the height of the tree This only occurs once per branch, and contributes at most 1 to the height of the tree b. The previous reduction produced vertices of degree 3 or 4 that were destroyed b. The previous reduction produced vertices of degree 3 or 4 that were destroyed We can pair this reduction with the previous reduction We can pair this reduction with the previous reduction

37 Degree 5 Vertices With 5 Degree 5 Neighbors c. The previous reduction was a reduction on a degree 5 vertex that destroyed all 5 of that vertex’s neighbors c. The previous reduction was a reduction on a degree 5 vertex that destroyed all 5 of that vertex’s neighbors Again w can pair this reduction with the previous Again w can pair this reduction with the previous The previous reduction was on a degree 5 vertex and produced vertices of degree 3 or 4 that were split off into a different connected component The previous reduction was on a degree 5 vertex and produced vertices of degree 3 or 4 that were split off into a different connected component Produces a non-empty subcomponent, but does not add to the depth of the component of interest Produces a non-empty subcomponent, but does not add to the depth of the component of interest We can construct a similar argument for vertices of degree 4 with 4 neighbors of degree 4 We can construct a similar argument for vertices of degree 4 with 4 neighbors of degree 4

38 Depth of Splitting Tree Case 2: Graphs containing only vertices of degree <6. Case 2: Graphs containing only vertices of degree <6.

39 Depth of Splitting Tree The dept of a vertex in the splitting tree is at most xm+2 The dept of a vertex in the splitting tree is at most xm+2 The +2 comes from the first occurrences of degree 5 and degree 4 vertices The +2 comes from the first occurrences of degree 5 and degree 4 vertices Solve for x Solve for x x=19/100 x=19/100 The depth of the splitting tree is therefore 19m/100+2 The depth of the splitting tree is therefore 19m/100+2 The recursive depth of this algorithm is therefore 19m/100+2 The recursive depth of this algorithm is therefore 19m/100+2

40 Space Complexity This algorithm needs to store the best solution found at each level This algorithm needs to store the best solution found at each level The space complexity of this algorithm is therefore O(nd), or O((19m/100+1)n) The space complexity of this algorithm is therefore O(nd), or O((19m/100+1)n)

41 Time of Algorithm This algorithm has a branching factor of r This algorithm has a branching factor of r The time for each level is bounded by the function The time for each level is bounded by the function T( l )= O(2r 3 n) + rT( l -1) T( l )= O(2r 3 n) + rT( l -1) This algorithm therefore runs in O(r 3 nr 19m/100+2 ) time This algorithm therefore runs in O(r 3 nr 19m/100+2 ) time

42 Conclusion This paper presents 2 algorithms for solving (r,2)-CSP This paper presents 2 algorithms for solving (r,2)-CSP The first runs in time O(2r 3 nr m/5 ) and space O(mn/5) The first runs in time O(2r 3 nr m/5 ) and space O(mn/5) The second runs in time O(2r 3 nr 19m/100 ) and space O((19m/100+1)n) The second runs in time O(2r 3 nr 19m/100 ) and space O((19m/100+1)n) 2-Sat and max cut can be reduced to (r,2)- CSP 2-Sat and max cut can be reduced to (r,2)- CSP 2-Sat and max cut can therefore be solved in time O(2r 3 nr 19m/100 ) and space O((19m/100+1)n) 2-Sat and max cut can therefore be solved in time O(2r 3 nr 19m/100 ) and space O((19m/100+1)n)

43 References “IBM Research Report A faster Exponential-Time Algorithm for Max 2-Sat, Max Cut, and Max k-Cut”, Alexander D. Scott, Gregory B. Sorkin, IBM Research Division, IBM Research Division, Thomas J. Watson Research Center, 2004 “IBM Research Report A faster Exponential-Time Algorithm for Max 2-Sat, Max Cut, and Max k-Cut”, Alexander D. Scott, Gregory B. Sorkin, IBM Research Division, IBM Research Division, Thomas J. Watson Research Center, 2004


Download ppt "“IBM Research Report A faster Exponential-Time Algorithm for Max 2-Sat, Max Cut, and Max k- Cut”, Alexander D. Scott, Gregory B. Sorkin, IBM Research Division."

Similar presentations


Ads by Google