Improved Algorithms for Edge Colouring in the W-Streaming Model
Total Page:16
File Type:pdf, Size:1020Kb
Improved Algorithms for Edge Colouring in the W-Streaming Model Moses Charikar∗ Paul Liuy Abstract et al. [2] shows that no algorithm can do better than In the W-streaming model, an algorithm is given a 2∆ colouring when ∆ = O(log n) (2∆ is achieved O(n polylog n) space and must process a large graph of by the greedy algorithm). On the algorithmic side, up to O(n2) edges. In this short note we give two algo- several O(∆) colouring algorithms are known, with rithms for edge colouring under the W-streaming model. approximation factors depending on whether the input For edge colouring in W-streaming, a colour for every is vertex-arrival or edge-arrival. In the vertex arrival edge must be determined by the time all the edges are model, all edges out-going from a vertex are streamed streamed. Our first algorithm uses ∆ + o(∆) colours in consecutively in a batch. In the edge-arrival model, O(n log2 n) space when the edges arrive according to a there are no constraints on the order of the edges. uniformly random permutation. The second algorithm For adversarial orders in the vertex-arrival model, the uses (1 + o(1))∆2=s colours in O~(ns) space when edges best known result is achieved by Cohen et al. [5] arrival adversarially. using (1 + o(1))∆ colours. For random orders in the edge-arrival model, an algorithm using (1 + o(1))∆ 1 Introduction colours by Bhattacharya et al. [4] was simultaneously discovered at the same time as this paper, surpassing The problem of edge colouring asks for an assignment of the previous state-of-the-art of 1:26∆ by Bahmani et colours to the edges of a graph such that no two incident al. [1]. However, the online model allows for O(poly(n)) edges have the same colour and the total number of memory, so the methods taken by previous works do not colours used is minimized. In this short note, we apply in W-streaming. In particular, even the classic study the problem of edge colouring in the W-streaming greedy algorithm requires O(n∆) space. In the offline model. model, algorithmic versions of Vizing's theorem [8, 11] In the W-streaming model, input is given in a gives a polynomial time ∆ + 1 colouring algorithm streaming fashion, and an output stream is written as for edge colouring. Any graph of maximum degree ∆ the input is processed. An algorithm can choose to requires at least ∆ colours, so distinguishing between ∆ stream over the input many times, although for our and ∆ + 1 is known to be NP-Hard. purposes we focus on one-pass algorithms. With respect The current state-of-the-art in W-streaming is by to edge colouring in W-streaming, an algorithm is given Behnezhad et al. [3], who achieve a 2e∆-colouring O(n polylog n) space and must process a large graph of algorithm for the random arrival case and a O(∆2) n vertices, up to O(n2) edges, and maximum degree algorithm for the adversarial arrival case. In this short ∆. During the course of the stream, each edge must be note, we give two algorithms for edge colouring under coloured by the algorithm, and their colours announced the W-streaming model that improves upon Behnezhad by the time the stream completes. Several classical et al. [3]. The first is a ∆ + o(∆) algorithm for the graph problems have been studied in the W-streaming random arrival case using O(n log n) space. The second model, including connectivity, minimum spanning tree, is a O(∆2=s) algorithm for the adversarial arrival case euler tours, and in particular edge colouring [3, 6, 7, 10]. using O~(ns) space. Since only O(n polylog(n)) space is allowed, most edges have their colours announced close to the time they 2 A simple algorithm for edge colouring under are streamed in. In contrast to the online model, edge random arrivals colours do not have to be announced the instant they are seen. Instead, we may use our O(n polylog n) space When the edges are streamed in randomly, consider the to “buffer” the announcement of the edge colours. following simple algorithm: In the online model, a lower bound of Bar-Noy ∗Stanford University, [email protected] yStanford University, [email protected] Copyright c 2021 by SIAM Unauthorized reproduction of this article is prohibited Algorithm 1: A simple algorithm for random Let u be a node of maximum degree ∆. The analysis arrivals above means we colour every chunk with at most (1 + ^ δu)du + 1 colours. Thus the total number of colours Break the edges into C sized chunks where p used is at most N((1+δ )d^ +1) = ∆+O(∆= α) with C = α2n. For each chunk, use any offline u u probability at least 1 − 1= poly(n). ∆ + 1 coloring algorithm. For each chunk use a different palette of colours. 3 A simple algorithm for edge colouring under adversarial arrivals When the edges are streamed in adversarially, consider Theorem 2.1. When α = Ω(log np), Algorithm 1 colours any input graph with ∆+O(∆= α) colours with the following simple algorithm: high probability. For a ∆ + o(∆) colouring, O(n log2 n) Algorithm 2: A simple algorithm for adversarial space is sufficient. arrivals Proof. Let Gi be the subgraph induced by chunk i, and For each node u, generate s > 36 log n random let d(u) and di(u) be the degree of u in G and Gi bits. Partition the edge set E into bipartite respectively. For the ease of exposition, assume that graphs B1;B2;:::;Bs, by the following proce- C divides E exactly. The total number of chunks is dure: N = E . Fix any i 2 f1;:::;Ng. Since the edges are C • Given e = (u; v) let D be the indices where randomly ordered, the expected degree of u in Gi is ^ d(u) the random bits of u and v differ. du = N in expectation. For each of the C edges in 1 our chunk, let u;j be an indicator variable for the event • Choose an index i 2 D uniformly at random that the j-th edge is incident on node u. Thus, we have and assign (u; v) to Bi. PC 1 di(u) = j=1 u;j. Due to the random ordering, di(u) (i) follows a hypergeometric distribution and the 1u;j's are For each node u 2 Bi, store a counter Cu negatively dependent. initially set to 0. Upon streaming in an edge 1 (i) (i) Applying Chernoff's bound for negatively de- (u; v) 2 Bi, output the colour (i; Cu ;Cv ). pendent random variables (Theorem A.1), we have (i) (i) 2 h i Increment both Cu and Cv by 1. ^ 2 ^ Pr di(u) ≥ (1 + δu)du ≤ exp − minfδu; δugdu=3 . 1 ∆ Where u lies in the left partition and v lies in the Choose δu = p . Then for δu ≤ 1, we have: Nd^u α right partition of its bipartite graph. 2 h i The version of the algorithm we use on each bipartite ^ graph B is the same as the one used in [3]. Pr di(u) ≥ (1 + δu)du i ∆2 ≤ exp − 2 ^ 3N duα Theorem 3.1. Algorithm 2 colours any input graph ∆ with (1 + o(1))∆2=s colours in O~(ns) space. ≤ exp − (d^ ≤ ∆=N) 3Nα u Proof. First, we show that the graphs B produced in i αn∆ E Algorithm 2 are indeed bipartite. By construction, = exp − (N = 2 ) 3E α n every edge (u; v) in graph Bi connects a node whose ≤ exp (−α=3) (E ≤ n∆) i-th bit is 0 with a node whose i-th bit is 1. Thus the = 1= poly(n)(α = Ω(log n)) left partition of Bi is precisely the nodes with their i-th bit equal to 0 and the right partition is precisely the where we may adjust the degree of the poly(n) as high nodes with their i-th bit equal to 1. as we like (by adjusting α). The case for δu > 1 achieves Next, we show that the maximum degree of each similar 1= poly(n) bounds. Bi is concentrated about ∆=s. Let du;v be the number ^ differing bits between u and v. For any two vertices u Thus for every u in Gi, we have di(u) ≤ (1 + δ)du and v, the expected value of d random bits is s=2. with probability 1 − 1= poly(n). Let 1i be the indicator u;v By a Chernoff bound, variable for this event happening for Gi. By a union bound, we have 3 Pr [du;v ≤ s=4] ≤ exp(−s=12) ≤ 1=n : N N 1 X 1 Thus by a union bound, every pair of nodes will have Pr \i=1 i ≥ 1 − (1 − Pr [ i]) ≥ 1 − 1= poly(n): i=1 at least s=4 differing bits. By symmetry, any index Copyright c 2021 by SIAM Unauthorized reproduction of this article is prohibited is equally likely to differ between any pair of nodes. algorithm in the random order arrival model. In Moses For each edge, we choose a random index out of all Charikar, editor, Proceedings of the Twenty-First An- the differing indices to assign the edge to. Thus the nual ACM-SIAM Symposium on Discrete Algorithms, SODA 2010, pages 31{39. SIAM, 2010. maximum degree of each Bi is ∆=s in expectation. Furthermore, the expectation is tightly concentrated [2] Amotz Bar-Noy, Rajeev Motwani, and Joseph Naor.