Bart Jansen, Utrecht University Max Leaf Instance: Connected graph G, positive integer k Question: Is there a spanning tree for G with at least k leaves? Applications in network design YES-instance for k ≤ 8 2 Classical complexity Max-SNP complete, so no polynomial-time approximation scheme (PTAS) NP-complete, even for 3-regular graphs • By P. Lemke, 1988 Planar graphs of maximum degree 4 • By Garey and Johnson, 1979 3 Bipartite Max Leaf Instance: Connected bipartite graph G with black and white vertices according to the partition, positive integer k Question: Is there a spanning tree for G with at least k black leaves? 4 Classical complexity No constant-factor approximation NP-complete, even for: d-regular graphs for d ≥ 4 • By Fusco and Monti, 2007 Planar graphs of maximum degree 4 • By Li and Toulouse, 2006 5 Weighted Max Leaf Instance: Connected graph G with non-negative vertex weights; positive number k Question: Is there a spanning tree for G such that its leaves have combined weight at least k? Leaf weight 16 11 6 Classical complexity NP-complete by restriction of Max Leaf If weights {0,1} are allowed, no constant-factor approximation since it generalizes Bipartite Max Leaf We consider the fixed parameter complexity 7 Suppose we encounter a NP-complete problem No O(nc) algorithm for fixed c No efficient algorithm exists? What happens if we use some information about the instance? For example: solution size is k, much less than n. Can we solve it in O(2kn) time? True for many problems, such as Vertex Cover Instance of a parameterized problem is <I,k> Regular instance and the parameter as a natural number If there is an f(k)nc time algorithm for a problem Then it is Fixed Parameter Tractable (FPT) (n is the size of instance I) 8 A kernelization algorithm: Reduces parameterized instance <I,k> to equivalent <I’,k’> Size of I’ does not depend on I but only on k Time is poly (|I| + k) New parameter k’ is at most k If |I’| is O(g(k)), then g is the size of the kernel Kernelization algorithm implies fixed parameter tractability Compute a kernel, analyze it by brute force 9 Parameterize by the target value k Number of leaves, or leaf weight Max Leaf • Kernel with 3.75k vertices • O(4kk2+p(|V|+|E|)) algorithm Bipartite Max Leaf Weighted Max Leaf • No existing results • W[1] hard on general graphs • No existing results • Complexity depends on weight range • Kernel for restricted graph classes 10 Weight range General graphs {1,2,…} Kernel with 7.5k vertices 11 Weight range General graphs {1,2,…} {0,1,… } Planar graphs Genus ≤ g Degree of positiveweight ≤ d Kernel with 7.5k vertices Hard for W[1] 78k O(k√g+ g) O(kd2) 12 Weight range General graphs {1,2,…} {0,1,… } Q>0 Planar graphs Genus ≤ g Degree of positiveweight ≤ d Kernel with 7.5k vertices Hard for W[1] 78k O(k√g+ g) O(kd2) NP-complete for k=1 (not Fixed Parameter Tractable) 13 Weight range General graphs {1,2,…} Q≥1 Planar graphs Genus ≤ g Degree of positiveweight ≤ d Kernel with 7.5k vertices {0,1,… } Hard for W[1] 78k O(k√g+ g) O(kd2) Q≥1 U {0} Hard for W[1] O(k) O(k√g+ g) O(kd2) 14 Terminology and a lemma 15 A set S of vertices is a cutset if their removal splits the graph into multiple connected components A path component of length k is a path <x,v1,v2, .. , vk,y>, s.t. x, y have degree ≠ 2 all vi have degree 2 16 If S is a cutset, then at least one vertex of S is internal in a spanning tree We need to give at least one vertex in S a degree ≥ 2 to connect both sides 17 Bipartite Max Leaf is hard for W[1] 18 We prove that Bipartite Max Leaf is hard for W[1] (Probably) no f(k)nc algorithm No proof of membership in W[1] It might be harder than any problem in W[1] No hardness proof for W[2] either Fixed parameter tractable • • • • Vertex Cover Feedback Vertex Set Maximum Leaf Spanning Tree .. W[1]-complete • Independent Set • Set Packing • .. W[2]-complete • Dominating Set • .. 19 W[i] hardness is proven by parameterized reduction <I,k> <I’,k’> from some W[i]hard problem Similar to (Karp) reductions for NP-completeness Reduction in time f(k)*poly(|I|) New parameter k’ ≤ g(k) for some function g We reduce k-Independent Set (W[1]-complete) to Bipartite Max Leaf 20 k-Independent Set Instance: Graph G, positive integer k Question: Does G have an independent set of size at least k? ▪ (i.e. is there a vertex set S of size at least k, such that no vertices in S are connected by an edge in G?) Parameter: the value k 21 Given an instance of k-Independent Set, we reduce as follows: Color all vertices black Split all edges by a white vertex Add white vertex w with edges to all black vertices Set k’ = k Polynomial time k’ ≤ g(k) = k 22 Complement of S is a vertex cover Build spanning tree: Take w as root, connect to all black vertices We reach the white vertices from the vertex cover V – S ▪ Since every white vertex used to be an edge Edges incident on w are not drawn 23 Take the black leaves as the independent set If there was an edge x,y then they are not both leaves Since {x,y} is a cutset By contraposition, black leaves form an independent set Edges incident on w are not drawn 24 A linear kernel for Maximum Leaf Weight Spanning Tree on planar graphs 25 Kernel of size 78k on planar graphs Strategy: Give reduction rules ▪ that can be applied in polynomial time ▪ that reduce the instance to an equivalent instance Prove that after exhaustive application of the rules, either: ▪ the size of the graph is bounded by 78k ▪ or we are sure that the answer is yes ▪ then we output a trivial, constant-sized YES-instance 26 We want to be sure that the answer is YES if the graph is still big after applying reduction rules Use a lemma of the following form: If no reduction rules apply, there is a spanning tree with |G|/c leaves of weight ≥ 1 (for some c > 0) With such a proof, we obtain: If |G| ≥ ck then G has a spanning tree with |G|/c≥ck/c=k leaves of weight 1 So a spanning tree with leaf weight ≥ k If |G| ≥ ck after kernelization we return YES If not, the instance is small 27 The reduction rules must enforce: When we increase the size of the graph, eventually this leads to an increase in optimal leaf weight of a spanning tree So we need to avoid: A graph can always grow larger without increasing the optimal leaf weight of a spanning tree All reduction rules are needed to prevent such situations 28 Vertex of positive weight, with arbitrarily many degree-1 neighbors of weight 0 29 Structure: Vertex x of degree 1 adjacent to y of degree > 1 Operation: Delete x, decrease k by w(x), set w(y) = 0 Justification: Vertex x will be a leaf in any spanning tree The set {y} is a cutset, so y will never be a leaf in a spanning tree k’ = k – w(x) 30 A connected component of arbitrarily many vertices of weight 0 31 Structure: Two adjacent weight-0 vertices x, y Operation: Contract the edge xy, let w be the merged vertex Justification: We can always use the edge xy in an optimal tree 32 Arbitrarily many weight-0 degree-2 vertices with the same neighborhood 33 Structure: Two weight-0 degree-2 vertices u,v with equal neighborhoods {x,y} The remainder of the graph R is not empty Operation: Remove v and its incident edges Justification: {x, y} forms a cutset One of x,y will always be internal in a spanning tree 34 A necklace of arbitrary length Every pair of positive-weight vertices forms a cutset, so at most 1 leaf of positive weight 35 Structure: a weight-0 degree-2 vertex with neighbors x,y a direct edge xy Operation: remove the edge xy Justification: You never need xy If xy is used, we might as well remove it and connect x and y through z Since w(z) = 0, leaf weight does not decrease 36 Three path components of arbitrary length At most 4 leaves in any spanning tree 37 Structure: Path component <x,v1,v2,..,vp,y> with p ≥ 4 Operation: Replace v2,v3, .. , vp-1 by new vertex v* Weight of v*: Compute maximum of edge endpoint weights on edges (vi,vi+1) for i=1 .. p-1 Subtract maximum of w(v1) and (vp) Justification: The two spanning trees are equivalent Suppose a spanning tree avoids an edge inside the path component We gain at least as much weight by avoiding an edge incident on v* 38 An arbitrarily long cycle with alternating weighted / zero weight vertices At most one leaf of positive weight 39 Structure: The graph is a simple cycle Operation: Remove an edge that maximizes the combined weight of its endpoints Justification: Any spanning tree for G avoids exactly one edge Avoiding an edge with maximum weight of endpoints is optimal 40 Reduction rules are necessary and sufficient for the kernelization claim Rules do not depend on parameter k Reduction rules do not depend on planarity of the graph ▪ But the structural proof that every reduced instance has a |G|/c leaf weight spanning tree does depend on planarity Reduction rules can be executed in linear time Yields O(k) 278k + O(|V| + |E|) algorithm 41 Kernel for {0,1,…} weights on planar graphs Current kernel size 78k Improved analysis may decrease kernel size New reduction rules needed to go below 31k Kernel size for {1,2,...} weights Current kernel size 7.5k New reduction rules needed to go below 7.5k 42 What is it that makes Weighted Max Leaf hard? 43 Target leaf weight k Treewidth w Positive-weight vertices p Zero-weight vertices x Parameter k + x • Not fixed parameter tractable on general graphs • Hard for W[1] by reduction from k-Independent Set (Kernel for restricted graph classes) • Amenable to dynamic programming • O(ww |V|) time algorithm • Try all subsets of S positive-weight vertices, check if V \ S is a Connected Dominating Set • O(2p(|V|+|E|)) time • Not fixed parameter tractable • For x=0 (no zero-weight vertices) we have regular unweighted Max Leaf, which is NP-complete • Fixed parameter tractable • We reduce (k+x) Weighted Max Leaf with {0,1,…} weights to k’ = k+x Weighted Max Leaf with {1,2,…} weights 44 Weighted Max Leaf with weight 0 and parameter x + k Is there a spanning tree of leaf weight ≥ 13 ? k = 13, x = 2 Weighted Max Leaf with weight ≥ 1 and parameter k’ = x + k Is there a spanning tree of leaf weight ≥ 15 14 ? 45 Maximum Leaf Weight Spanning tree is a natural generalization of the Maximum Leaf Spanning Tree problem If weights are ≥ 1: Kernel with 7.5k vertices If weights are 0 or ≥ 1: W[1]-hard on general graphs Linear kernel when restricted to ▪ planar graphs, ▪ graphs of bounded genus, ▪ graphs in which the degree of positive-weight vertices is bounded. 46 Classifying complexity of general-graph problem Hardness proof for some W[i] > 1 Membership proof for some W[i] Investigate connections to approximation algorithms PTAS on planar graphs using Planar-Separators? Constant-factor approximation for {0,1} weights 47