Efficient Computation of Implicit Representations of Sparse Graphs -LRB- Revised Version -RRB- S.R. Arikati A. Maheshwari C.D. Zaroliagis MPI -LCB- I -LCB- 95 -LCB- 1-013 June 1995 Efficient Computation of Implicit Representations of Sparse Graphs ? -LRB- Revised Version -RRB- Srinivasa R. Arikati 1 Anil Maheshwari 2y Christos D. Zaroliagis 1 -LRB- 1 -RRB- Max-Planck-Institut f?ur Informatik Im Stadtwald , D-66123 Saarbr?ucken , Germany -LRB- 2 -RRB- School of Computer Science , Carleton University Ottawa , Canada K1S 5B6 E-mail : farikati,zarog@mpi-sb.mpg.de maheshwa@scs.carleton.ca June 20 , 1995 Abstract The problem of finding an implicit representation for a graph such that vertex adjacency can be tested quickly is fundamental to all graph algorithms . In particular , it is possible to represent sparse graphs on n vertices using O -LRB- n -RRB- space such that vertex adjacency is tested in O -LRB- 1 -RRB- time . We show here how to construct such a representation efficiently by providing simple and optimal algorithms , both in a sequential and a parallel setting . Our sequential algorithm runs in O -LRB- n -RRB- time . The parallel algorithm runs in O -LRB- log n -RRB- time using O -LRB- n = log n -RRB- CRCW PRAM processors , or in O -LRB- log n log ? n -RRB- time using O -LRB- n = log n log ? n -RRB- EREW PRAM processors . Previous results for this problem are based on matroid partitioning and thus have a high complexity . ? This work was partially supported by the EU ESPRIT Basic Research Action No. 7141 -LRB- ALCOM II -RRB- . yThis research was done while the author was with the Max-Planck-Institut f?ur Informatik . 1 Introduction A fundamental data structuring question in the design of efficient graph algorithms is how to represent a graph in memory using as little space as possible , so that given any two vertices we can test their adjacency quickly -LSB- 12 , 19 -RSB- . Following -LSB- 12 , 19 -RSB- , we say that a class of graphs has an implicit representation if there exists a constant such that for every n-vertex , m-edge graph G in the class , there is a labeling of the vertices with dlog nebits each that allows us to decide vertex adjacency in O -LRB- 1 -RRB- time . Implicit representation eliminates the need for an adjacency matrix . In the adjacency matrix representation of G adjacency can be tested in O -LRB- 1 -RRB- time , but n2 bits are required even for the case where G is sparse -LRB- i.e. m = O -LRB- n -RRB- -RRB- . On the other hand , a representation of G using adjacency lists requires mdlog ne bits , but the test for adjacency takes O -LRB- log n -RRB- time . An alternative characterization of sparse graphs is given through a graph-parameter called arboricity . The arboricity of a graph G is defined as maxJ fjE -LRB- J -RRB- j = -LRB- jV -LRB- J -RRB- j ? 1 -RRB- g , where J is any subgraph of G with jV -LRB- J -RRB- j vertices and jE -LRB- J -RRB- j edges . Graphs of bounded arboricity are called sparse . As observed in -LSB- 12 -RSB- , an implicit representation can be computed by decomposing the edges of G into edge-disjoint forests , or alternatively , by coloring the edges of G with k colors such that there is no monochromatic cycle . If G has this latter property , we say that it is k-forest colorable . It follows from a theorem of Nash-Williams -LSB- 15 , 16 -RSB- that if G has arboricity c then G is c-forest colorable , and consequently that G has an implicit representation of cndlog ne bits1 . In such a case , G is said to have an optimal implicit representation . In this paper , we are concerned with the efficient computation of optimal implicit representations of sparse graphs . The known sequential and parallel algorithms -LSB- 5 , 14 -RSB- for obtaining an optimal implicit representation are based on involved techniques such as Edmonds ' results on matroid partitioning -LSB- 1 -RSB- . In -LSB- 5 -RSB- , an efficient matroid partitioning algorithm results in the computation of a c-forest coloring of a graph with arboricity c. -LRB- For sparse graphs , the algorithm runs in O -LRB- n1 :5 plog n -RRB- time . -RRB- Similarly , the algorithms in -LSB- 14 -RSB- for matroid union and intersection result in a randomized parallel algorithm for finding a c-forest coloring of graphs with arboricity c. -LRB- The algorithm runs in O -LRB- log3 n -RRB- time using O -LRB- n4 :5 -RRB- processors on a randomized CREW PRAM . -RRB- Planar graphs , an important case of sparse graphs with c < = 3 , have received a considerable amount of attention -LSB- 4 , 12 , 18 -RSB- . An alternative way to generate the implicit representation of a graph is proposed in -LSB- 19 -RSB- -LRB- Theorem 1.8 -RRB- . If G has treewidth t , then it has an implicit representation of tndlog ne bits . 1Note that other authors , see e.g. -LSB- 12 , 19 -RSB- , refer to this number of bits as -LRB- c + 1 -RRB- ndlog ne due to a slightly different storage of the implicit representation they use . Note that this approach is not efficient in general , since there exist sparse graphs of small arboricity but of large treewidth . For example , planar graphs may have treewidth ? -LRB- pn -RRB- . The main contribution of this paper is twofold . First , we provide optimal sequential and parallel algorithms for obtaining an optimal implicit representation of a sparse graph , when its arboricity c is known . Our results and their comparison with previous work are summarized in Table 1 . Note that several important subclasses of sparse graphs are of known arboricity , for example , planar graphs -LRB- c < = 3 -RRB- , graphs of genus o -LRB- n -RRB- -LRB- c < = 4 -RRB- , graphs of bounded degree d -LRB- c < = bd = 2c + 1 -RRB- and graphs of bounded treewidth t -LRB- c < = t -RRB- . Implicit Previous Results Previous Results Results of Representation for Planar Graphs for Sparse Graphs this paper Number of bits 3ndlog ne cndlog ne cndlog nez Sequential Time O -LRB- n -RRB- O -LRB- n1 :5 plog n -RRB- O -LRB- n -RRB- Parallel CRCW Time O -LRB- log n log log n -RRB- O -LRB- log3 n -RRB- y O -LRB- log n -RRB- PRAM Number of Processors O -LRB- n = log n log log n -RRB- O -LRB- n4 :5 -RRB- y O -LRB- n = log n -RRB- Parallel EREW Time O -LRB- log2 n log log n -RRB- O -LRB- log4 n -RRB- y O -LRB- log n log ? n -RRB- PRAM Number of Processors O -LRB- n = log n log log n -RRB- O -LRB- n4 :5 -RRB- y O -LRB- n = log n log ? n -RRB- Table 1 : Our results and their comparison with previous work , for sparse graphs of known arboricity c . The sequential -LRB- resp . parallel -RRB- previous results for planar graphs are due to -LSB- 18 -RSB- -LRB- resp . -LSB- 4 -RSB- -RRB- . The sequential -LRB- resp . parallel -RRB- previous results for sparse graphs are due to -LSB- 5 -RSB- -LRB- resp . -LSB- 14 -RSB- -RRB- . -LRB- y -RRB- These results are for randomized PRAMs . -LRB- z -RRB- For planar graphs c < = 3 . The second contribution is based on the observation that the results in Table 1 require a priori the knowledge of the arboricity of the input graph . However , the known algorithms for computing the exact value of the arboricity -LRB- when nothing else is known about the graph -RRB- are based on matroid theory : a sequential algorithm -LSB- 5 -RSB- and a randomized parallel algorithm -LSB- 14 -RSB- . We also present here simple and optimal algorithms , including a deterministic parallel algorithm , to compute a 2-approximation for arboricity -LRB- i.e. an approximation which can be at most twice the exact value -RRB- . Furthermore , this approximation leads to an implicit representation that needs almost the same amount of space as required by the implicit representation computed using the exact value for arboricity . Our results and their comparison with previous work are summarized on Table 2 . Implicit Sparse Graphs of unknown arboricity c Representation Previous results This paper Number of bits cndlog ne -LRB- c + 2 -RRB- ndlog ne Sequential Time O -LRB- n1 :5 plog n -RRB- O -LRB- n -RRB- Parallel CRCW Time O -LRB- log3 n -RRB- y O -LRB- log2 n = log log n -RRB- PRAM Number of Processors O -LRB- n4 :5 -RRB- y O -LRB- n log log n = log2 n -RRB- Parallel EREW Time O -LRB- log4 n -RRB- y O -LRB- log2 n -RRB- PRAM Number of Processors O -LRB- n4 :5 -RRB- y O -LRB- n = log2 n -RRB- Table 2 : Our results and their comparison with previous work , for sparse graphs of unknown arboricity c . The sequential -LRB- resp . parallel -RRB- previous results are due to -LSB- 5 -RSB- -LRB- resp . -LSB- 14 -RSB- -RRB- . -LRB- y -RRB- These results are for randomized PRAMs . Our results are achieved by simple and rather intuitive techniques compared with those used in -LSB- 1 , 4 , 5 , 14 , 18 -RSB- and moreover , our algorithms are easy to implement . Also , our results extend to the k-forest coloring problem which is of independent interest since it is a fundamental problem in the design of fault-tolerant communication networks -LSB- 10 -RSB- , analysis of electric networks -LSB- 9 , 17 -RSB- and the study of rigidity of structures -LSB- 13 -RSB- . The paper is organized as follows . In Section 2 we show the reduction of the problem of finding an implicit representation of a sparse graph G to that of finding a forest coloring of G . The latter problem is solved in Section 3 , under the assumption that the arboricity of G is known . In Section 4 we show how a 2-approximation for the arboricity of a graph can be found . We conclude with Section 5 . 2 Implicit Representation and Forest Coloring In this section , we show how an implicit representation of a sparse graph with arboricity c is computed and adjacency queries are answered , if we are provided with a c-forest coloring of the graph . We then show how a k-forest coloring , for k = O -LRB- c -RRB- , can be used to compute an almost optimal implicit representation . We begin with some preliminaries . 2.1 Preliminaries Our model of parallel computation is the well-known PRAM -LSB- 11 -RSB- . A PRAM employs a number of processors all of which operate synchronously and have access to a common memory . We shall use here two variants : the EREW PRAM -LRB- where simultaneous access to the same memory location by more than one processor is not allowed -RRB- and the CRCW PRAM -LRB- which allows concurrent access to the same memory location by more than one processor ; in the case of concurrent writing one such processor succeeds arbitrarily -RRB- . Throughout the paper , G = -LRB- V ; E -RRB- , jV j = n , jEj = m , denotes a simple undirected graph . The vertices of G are given distinct labels 1 ; 2 ; : : : ; n , and , unless stated otherwise , vi refers to the vertex with label i . We assume that G is given in the standard form of doubly-linked adjacency lists . This means that for each neighbor u of a vertex v , there exists one entry for u in the adjacency list of v. -LRB- Remark : Only for our EREW PRAM algorithms , we will further assume that the adjacency lists are provided with the so-called cross-links : the entry for u in the adjacency list of vertex v is provided , in addition to its identification , with a pointer to v 's entry in the adjacency list of u. For details , see e.g. -LSB- 7 , 8 -RSB- . -RRB- Many times throughout the paper , we will need to perform parallel prefix computations on adjacency lists . Note that performing a prefix computation on a list -LRB- instead of an array -RRB- does not cause a problem , since a list of size p can be converted into an array in O -LRB- log p -RRB- time using O -LRB- p = log p -RRB- EREW PRAM processors -LSB- 11 -RSB- . Hence , we shall assume from now on that every adjacency list Lv , for v 2 G , has been converted into its associated array A -LRB- Lv -RRB- and we shall not make any distinction between Lv and A -LRB- Lv -RRB- when we refer to the adjacency list of v. 2.2 Computing the implicit representation We first show how to compute an implicit representation of G , if G is a tree . Choose any vertex r and root G at r . The data structure is an array P -LRB- v -RRB- for all v 2 V , where P -LRB- v -RRB- is the parent of v -LRB- P -LRB- r -RRB- = ;-RRB- . The number of bits needed to store P is ndlog ne . Two vertices u and v are adjacent in G iff either P -LRB- v -RRB- = u or P -LRB- u -RRB- = v. Hence the adjacency test can be done in constant time . Clearly , the above method works if G is a forest also . Suppose a c-forest coloring of a sparse graph G is given , where c is the arboricity of G. To compute an implicit representation of G , root all forests . The data structure is an n ? c array P , where P -LRB- v ; i -RRB- is the parent of v in the i-th forest . The number of bits needed to store P is cndlog ne . Two vertices u and v are adjacent in G iff , for some i , either u = P -LRB- v ; i -RRB- or v = P -LRB- u ; i -RRB- . For a given pair of vertices this test takes O -LRB- c -RRB- = O -LRB- 1 -RRB- time , since c is constant . Lemma 1 Given a c-forest coloring of an n-vertex sparse graph G with arboricity c , an -LRB- optimal -RRB- implicit representation of cndlog ne bits can be computed either in O -LRB- n -RRB- sequential time , or in O -LRB- log n -RRB- parallel time using O -LRB- n = log n -RRB- EREW PRAM processors . Proof : As shown above , the array P provides an implicit representation of G . The basic steps for computing P involve : rooting a tree and computing the parent of each vertex . Both these steps can be implemented in O -LRB- n -RRB- sequential time , or in O -LRB- log n -RRB- time with O -LRB- n = log n -RRB- EREW PRAM processors using standard techniques -LRB- see e.g. -LSB- 11 -RSB- , Chapter 3 -RRB- . We now discuss the computation of an implicit representation of G when a k-forest coloring of G is given , where k is a constant approximation for c . If we use the previous approach and compute an n ? k array P , we need kndlog ne bits to store P . However , we can do better than this by following a different approach to reduce the number of bits . Our data structure consists of two arrays P and Q : P is an array of length m and Q of length n . In the array P we store first the parents of v1 , then the parents of v2 , and so on . Q -LRB- i -RRB- indicates the position in P where the parents of vi begin -LRB- if Q -LRB- i -RRB- = Q -LRB- i + 1 -RRB- or Q -LRB- i -RRB- > m , then vi has no parents -RRB- . The implementation is presented in Algorithm 1 . Input : A graph G = -LRB- V ; E -RRB- , jV j = n , with a k-forest coloring . Output : An implicit representation of G. 1 . ` : = 1 ; 2 . for i : = 1 to n do -LRB- a -RRB- Q -LRB- i -RRB- : = ` ; -LRB- b -RRB- for j : = 1 to k do i. if vi is not a root in the j-th forest then ii . P -LRB- ` -RRB- : = parent of vi in the j-th forest ; iii . ` : = ` + 1 ; od od Algorithm 1 : Computation of implicit representation . Observe that each edge of G is represented exactly once in P . Hence , to store P we need mdlog ne bits and to store Q we need ndlog me bits . Since m < = c -LRB- n ? 1 -RRB- -LRB- because G has arboricity c -RRB- , the total number of bits required is at most c -LRB- n ? 1 -RRB- dlog ne + ndlog ne + ndlog ce < = -LRB- c + 2 -RRB- ndlog ne . Vertex vi is a parent of vj iff vi = P -LRB- ` -RRB- for some Q -LRB- j -RRB- < = ` < = Q -LRB- j + 1 -RRB- ? 1 . These two vertices are adjacent in G iff one of them is a parent of the other . Since Q -LRB- j +1 -RRB- ? Q -LRB- j -RRB- < = k for all j , the adjacency test takes O -LRB- k -RRB- = O -LRB- 1 -RRB- time . Lemma 2 Given a k-forest coloring of an n-vertex sparse graph G with arboricity c , where k = O -LRB- c -RRB- , an implicit representation of -LRB- c + 2 -RRB- ndlog ne bits -LRB- henceforth almost optimal implicit representation -RRB- can be computed either in O -LRB- n -RRB- sequential time , or in O -LRB- log n -RRB- parallel time using O -LRB- n = log n -RRB- EREW PRAM processors . Proof : As shown above , arrays P and Q provide an implicit representation of G . The sequential time bound follows immediately by Algorithm 1 . We derive the parallel complexity bounds as follows . Let v1 ; v2 ; : : : ; vn be the vertices of G. From the k-forest coloring , we create -LRB- temporarily -RRB- an n?k array P . In this array we store , for each vertex vi , its parents in the k forests in the same way as we did in the proof of Lemma 1 ; i.e. first the parents of v1 , then the parents of v2 , etc. . This is done by associating a processor with vertex vi in forest ` , 1 < = ` < = k. Then , this processor copies the parent of vi in the ` - th forest into the array position P -LSB- -LRB- i ? 1 -RRB- k + ` -RSB- . Since every edge of G is represented only once in the k-forest coloring , some of the entries of P are empty . We remove all the empty entries by performing a parallel prefix computation on P . The resulting array is the required array P . It is easy to see that having P and by performing another prefix summation on it , we can construct the array Q . Since prefix sums in an array of size p can be computed in O -LRB- log p -RRB- time using O -LRB- p = logp -RRB- EREW PRAM processors -LSB- 11 -RSB- , the required implicit representation can be achieved within the stated complexity bounds . We have shown that implicit representation can be computed using forest coloring . Thus , for the rest of the paper , we will be concerned with the forest coloring problem . 3 Forest Coloring With Known Arboricity In this section we present algorithms for computing forest colorings of sparse graphs . We begin with some useful technical lemmas . Lemma 3 Suppose the vertices of a graph G can be ordered as v1 ; v2 ; : : : ; vn such that each vertex vi has at most k neighbors before it -LRB- i.e. , among v1 ; : : : ; vi ? 1 -RRB- . Then , G is k-forest colorable . Proof : We will use induction on i . The basis , i = 1 , is trivial . Assume that the subgraph of G induced by v1 ; : : : ; vi ? 1 can be colored using k colors , say integers from 1 up to k. Let the neighbors of vi that come before it , be u1 ; : : : ; up , where p < = k. For each 1 < = j < = p , color the edge -LRB- vi ; uj -RRB- with color j . We refer to the ordering defined in Lemma 3 as a k-ordering of the vertices . Lemma 4 Let G = -LRB- V ; E -RRB- be an n-vertex graph with arboricity c . Then G has a vertex of degree at most 2c ? 1 . Proof : Since G has arboricity c , m = jEj < = c -LRB- n ? 1 -RRB- . So the sum of the degrees is at most 2c -LRB- n ? 1 -RRB- and hence G must have a vertex of degree at most 2c ? 1 . Lemma 5 Let G = -LRB- V ; E -RRB- be an n-vertex graph with arboricity c and let U be the set of vertices of degree at most 2c . Then jU j > = -LRB- 1 2c +1 -RRB- n. Proof : As before , m = jEj < = c -LRB- n ? 1 -RRB- . There are n ? jU j vertices of degree at least 2c + 1 , and summing the degrees of these vertices we get -LRB- n ? jU j -RRB- -LRB- 2c + 1 -RRB- < = 2m . The lemma follows by rearranging the terms . Lemma 3 implies that in order to find a k-forest coloring -LRB- and thus an optimal implicit representation -RRB- of a sparse graph G , it suffices to find a k-ordering of G . A sequential algorithm for computing a forest coloring of G is given in Algorithm 2 . Input : A graph G = -LRB- V ; E -RRB- , jV j = n , and its arboricity c. Output : A -LRB- 2c ? 1 -RRB- - forest coloring of G. 1 . G0 : = G ; Low : = fv : degree of v in G0 is at most 2c ? 1g ; i : = n. 2 . while Low < > ; do -LRB- a -RRB- Pick a vertex , say u , from the set Low . -LRB- b -RRB- for each neighbor w 62 Low of u do Decrease the degree of w by one and add w to the set Low if its degree becomes 2c ? 1 . -LRB- c -RRB- G0 : = G0 ? u ; vi : = u ; i : = i ? 1 . 3 . Compute a -LRB- 2c ? 1 -RRB- - forest coloring of G using the procedure given in the proof of Lemma 3 . Algorithm 2 : A sequential algorithm to compute forest coloring . Theorem 1 Let G be an n-vertex sparse graph with arboricity c . Then Algorithm 2 finds a -LRB- 2c ? 1 -RRB- - forest coloring of G in O -LRB- n -RRB- time . Proof : By Lemma 4 , G has a vertex of degree at most 2c ? 1 ; call it vn and delete it from G . The remaining graph has also arboricity < = c and therefore has a vertex , say vn ? 1 , of degree at most 2c ? 1 . By repeating this process , we obtain a sequence v1 ; : : : ; vn . This procedure is formalized in Algorithm 2 . It is easy to verify that the sequence v1 ; : : : ; vn , generated in Step 2 of the algorithm , is a -LRB- 2c ? 1 -RRB- - ordering of vertices of G and hence , by Lemma 3 , a -LRB- 2c ? 1 -RRB- - forest coloring of G . We now discuss the complexity of the algorithm . The time needed by each iteration of the while loop is bounded by the degree of the vertex u . So the total time of the while loop is bounded by the sum of degrees , which is O -LRB- m -RRB- = O -LRB- n -RRB- , since G is sparse . Also Step 3 clearly takes O -LRB- n -RRB- time . The bound follows . A parallel algorithm to compute a forest coloring of sparse graphs is given in Algorithm 3 . Input : A graph G = -LRB- V ; E -RRB- , jV j = n and its arboricity c. Output : A 2c-forest coloring of G. 1 . G0 : = G ; i : = 1 ; mark all vertices unlabeled . 2 . while there is an unlabeled vertex do : -LRB- a -RRB- Let U be the set of vertices of G0 with degree at most 2c . -LRB- b -RRB- for each v 2 U do : label -LRB- v -RRB- = i. -LRB- c -RRB- G0 : = G0 ? U ; update the degrees of neighbors of U accordingly . -LRB- d -RRB- i : = i + 1 . 3 . for each vertex v in G do : delete all the neighbors u from its adjacency list satisfying label -LRB- u -RRB- < label -LRB- v -RRB- . 4 . for each vertex v do : let its neighbors be u1 ; : : : ; u ` , where ` < = 2c ; color the edge -LRB- v ; ui -RRB- with color i , 1 < = i < = ` . Algorithm 3 : A parallel algorithm to compute forest coloring . Theorem 2 Let G be an n-vertex sparse graph with arboricity c. Then , Algorithm 3 finds a 2c-forest coloring of G in O -LRB- log n -RRB- time using O -LRB- n = log n -RRB- CRCW PRAM processors , or in O -LRB- log n log ? n -RRB- time using O -LRB- n = log n log ? n -RRB- EREW PRAM processors . Proof : The proof of correctness comes easily by Lemma 5 . We will now analyze the complexity of the algorithm . Steps 1 and 4 can be implemented in O -LRB- 1 -RRB- time using O -LRB- n -RRB- processors on an EREW PRAM . Step 3 can be implemented in O -LRB- log n -RRB- time using O -LRB- n = log n -RRB- processors , on an EREW PRAM , by performing a prefix sum computation in the adjacency lists of G0 -LSB- 11 -RSB- . We now argue about the complexity of Step 2 . By Lemma 5 , the number of iterations of the while-loop is O -LRB- log n -RRB- . Note that if in each iteration we update the adjacency list and recompute the degree of each vertex after deleting U , we will spend -LRB- roughly -RRB- O -LRB- log n -RRB- time per iteration and thus O -LRB- log2 n -RRB- time overall . Below , we show how we can do better than this . We begin with the CRCW PRAM implementation . We will first show how we can implement Step 2 in O -LRB- log n -RRB- time with O -LRB- n -RRB- processors . The implementation is based on the following observation : instead of recomputing the degree of each vertex in G0 , it is sufficient to mark , during the i-th iteration , those vertices that have degree at most 2c . These are exactly the vertices which will be assigned label i and will not participate in any further iteration . This can be done as follows . For every vertex v 2 G0 , assign one processor Pu to every vertex u in its adjacency list . Call such a processor active if u has not been labeled yet . Let M -LRB- v -RRB- be a specific location in shared memory associated with vertex v . Then all active processors Pu repeat , in parallel , the following two steps for 2c + 1 times : -LRB- a -RRB- Every Pu writes its id , id -LRB- Pu -RRB- , into the specified memory location M -LRB- v -RRB- . -LRB- b -RRB- All Pu read the contents of M -LRB- v -RRB- ; if M -LRB- v -RRB- = id -LRB- Pu -RRB- , then Pu becomes inactive . As a final step , we check if the contents of M -LRB- v -RRB- after the -LRB- 2c + 1 -RRB- - st iteration is the same as that after the 2c-th iteration . -LRB- This final step can be easily implemented in the local memory of one processor . -RRB- If this is true , then the degree of v is at most 2c ; otherwise , v has degree greater than 2c . Call the above procedure mark-U . It is clear from its description that procedure mark-U takes O -LRB- 1 -RRB- time using O -LRB- n -RRB- processors on a CRCW PRAM . Hence , Step 2 takes overall O -LRB- log n -RRB- time and O -LRB- n -RRB- processors . We will now show how to reduce the number of processors to O -LRB- n = log n -RRB- . The analysis is identical to the proof of Lemma 1 in -LSB- 7 -RSB- and originates from the method given in Section 4 of -LSB- 3 -RSB- . -LRB- We only describe it here for the sake of completeness . -RRB- We implement Step 2 in two phases . The first phase consists of O -LRB- log log n -RRB- iterations . During the i-th iteration we update the adjacency lists and recompute the degrees of vertices in G0 , using the O -LRB- log n = log log n -RRB- - time , O -LRB- n log log n = log n -RRB- - processor CRCW PRAM algorithm of -LSB- 3 -RSB- for computing prefix sums . By Lemma 5 , the size of G0 reduces by a constant factor '' after each iteration , where '' > = 1 = -LRB- 2c + 1 -RRB- . Using O -LRB- n = log n -RRB- -LRB- i.e. fewer -RRB- processors , the i-th iteration can be implemented in time O -LRB- -LRB- -LRB- 1 ? '' -RRB- in -RRB- =-LRB- n log n -RRB- + log n = log log n -RRB- = O -LRB- -LRB- 1 ? '' -RRB- i log n + log n = log log n -RRB- . As a consequence , the first phase can be implemented in O -LRB- log n -RRB- time using O -LRB- n = log n -RRB- processors . At the end of the first phase , the size of G0 has been reduced to O -LRB- n = log n -RRB- . Then , in the second phase , we simply apply to G0 our non-optimal implementation described above . Hence , Step 2 can be implemented in O -LRB- logn -RRB- time using O -LRB- n = log n -RRB- processors on a CRCW PRAM . Let us now discuss the EREW PRAM implementation . As before , we will first show how to implement Step 2 in O -LRB- log n log ? n -RRB- time using O -LRB- n -RRB- processors and then we will discuss the optimal implementation . Our approach -LRB- for the non-optimal implementation -RRB- is inspired by a method used in -LSB- 8 -RSB- . Since now concurrent read and/or write is not allowed , we have to modify the procedure mark-U . The goal is again to mark the vertices with degree < = 2c . For every vertex v 2 G0 , we allocate , as before , a processor Pu to every vertex u in the adjacency list of v. Call a vertex u , as well as its associated processor , marked if u is of degree < = 2c . If we delete , in one step , all marked vertices in the adjacency list of a vertex v -LRB- with degree > 2c -RRB- , then large \ gaps '' may be created . But now we do not have the concurrent access capability to overcome this problem . Instead of deleting all marked vertices , we delete a -LRB- large enough -RRB- subset of them in such a way that adjacency lists in G0 are correctly updated -LRB- i.e. without gaps -RRB- . This allows us to check easily if the degree of a vertex v is < = 2c . -LRB- Simply assign a processor to the adjacency list of v and let it follow the successor pointers for at most 2c steps . If after 2c steps , or earlier , the processor reaches the end of the list , then v has degree < = 2c . -RRB- To find the desired subset of marked vertices , we do the following . In the i-th iteration of the while-loop we construct an auxiliary graph H = -LRB- VH ; EH -RRB- , where VH = fx : x is marked in G0g and EH = f -LRB- x ; y -RRB- : x ; y are consecutive marked vertices in some adjacency list of G0g . Let h = jVH j. Note that H has maximum degree bounded by 2c and can be constructed in O -LRB- 1 -RRB- time using O -LRB- h -RRB- processors : to every marked vertex x in G0 , assign a processor Px to its adjacency list . By following successor pointers and cross-links , processor Px marks -LRB- in at most 2c steps -RRB- all occurrences of x in other adjacency lists . Then Px , during a second pass on the adjacency list of x , checks if the successor vertex of x , succ -LRB- x -RRB- , in the adjacency list of a vertex v is also marked . If yes , edge -LRB- x ; succ -LRB- x -RRB- -RRB- is added to EH . -LRB- Note that duplicate edges are not created , since Px can easily keep track of the edges that it had already added to EH . -RRB- An edge -LRB- x ; y -RRB- in H means that marked vertices x and y should not be simultaneously deleted in the adjacency list of v . This implies that an independent set in H denotes a set of marked vertices which can be deleted such that neither large gaps are created nor concurrent memory accesses occur . In -LSB- 6 , 8 -RSB- it is shown how to compute , in such a bounded-degree graph H , an independent set I of size jI j > = ffi h , for some constant < ffi < 1 , in O -LRB- log ? h -RRB- time using O -LRB- h -RRB- EREW PRAM processors . Now , the implementation of procedure mark-U is completed as follows . If Pu is marked and u 2 I , then u is deleted from the adjacency list of v . Since u 2 I , this operation is not performed by the predecessor and the successor vertices of u and thus there are no memory conflicts . Hence , at the end of every iteration the adjacency list of v , for every v 2 G0 , has been correctly updated . At the end of the i-th iteration , the size of G0 has been reduced by a -LRB- constant -RRB- factor of at least ffi = -LRB- 2c + 1 -RRB- . This implies that the total number of iterations is bounded by O -LRB- log n -RRB- . Since each iteration can be implemented in O -LRB- log ? n -RRB- time with O -LRB- n -RRB- processors , Step 2 takes O -LRB- log n log ? n -RRB- time using O -LRB- n -RRB- processors . To achieve an optimal number of processors O -LRB- n = log n log ? n -RRB- , we just apply the method given in Section 4 of -LSB- 8 -RSB- , or in the proof of Theorem 5.1 in -LSB- 2 -RSB- . -LRB- We do not give the analysis here , since it is rather tedious and the interested reader is referred to -LSB- 2 , 8 -RSB- for the details . -RRB- 4 Approximating Arboricity As it is mentioned in Introduction , all previous algorithms as well as those presented in the previous section require a priori the knowledge of the arboricity of the input graph in order to obtain its optimal implicit representation . However , the known algorithms for computing the exact value of the arboricity are based on matroid theory -LRB- either in sequential -LSB- 5 -RSB- or in parallel randomized computation -LSB- 14 -RSB- -RRB- and therefore are of high complexity . In this section we present simple and efficient algorithms to compute a 2-approximation to the arboricity of a graph . It follows by Lemma 2 that this approximate value gives an almost optimal implicit representation . In the following , G = -LRB- V ; E -RRB- , jV j = n , jEj = m , denotes a graph of unknown arboricity c. Algorithm 4 finds a sequential 2-approximation for c. Input : A graph G = -LRB- V ; E -RRB- . Output : A 2-approximation of the arboricity of G. 1 . G0 : = G ; k : = 0 . 2 . for i : = n downto 1 do -LRB- a -RRB- Let u be a vertex of smallest degree ffi in G0 . Define G0 = G0 ? u and update the degrees of neighbors of u accordingly . -LRB- b -RRB- vi : = u ; k : = maxfk ; ffi g. od 3 . return k. Algorithm 4 : A sequential algorithm to approximate arboricity . Lemma 6 A 2-approximation for the arboricity of a graph G can be computed in O -LRB- m + n -RRB- time . Proof : Let k be the value returned by Algorithm 4 . It is clear that v1 ; v2 ; : : : ; vn is a k-ordering and hence G is k-forest colorable by Lemma 3 . Moreover , G contains an induced subgraph H such that jE -LRB- H -RRB- j > = -LRB- k = 2 -RRB- jV -LRB- H -RRB- j , since jE -LRB- G0 -RRB- j > = -LRB- ffi = 2 -RRB- jV -LRB- G0 -RRB- j at the beginning of each iteration of the algorithm . Hence c > = -LRB- k = 2 -RRB- , implying that k is a 2-approximation for c . It is routine to implement Algorithm 4 in O -LRB- m + n -RRB- time . Our parallel algorithm to find a 2-approximation for the arboricity c of a graph G consists of two phases . In the first phase we use a repeated-doubling scheme to find a range for c , as follows . Assume we have a procedure ? that , given a graph G and an integer , returns true if it can find an - ordering of G. Now , observe that = dmn e is a lower bound for c . We set = and call ? . If it returns false , then we double , set = , and call ? again . After O -LRB- log c -RRB- calls to procedure ? we will obtain a such that 2 < = c < = and ? returns false for = 2 and true for = . In the second phase we do a binary search in the range -LRB- 2 ; -RSB- to find a such that procedure ? returns true for = and false for = ? 1 . The entire algorithm is given in Algorithm 5 . Input : A graph G = -LRB- V ; E -RRB- . Output : A 2-approximation of the arboricity of G. Comment : Procedure Par-Test-Ord is described in Algorithm 6 . 1 . : = dm = ne ; i : = 0 ; 2 . while Par-Test-Ord -LRB- G ; -RRB- = false do i : = i + 1 ; : = 2i ; od 3 . L : = = 2 + 1 ; R : = ; stop : = false ; 4 . while stop = false do -LRB- a -RRB- : = b -LRB- L + R -RRB- = 2c ; -LRB- b -RRB- If Par-Test-Ord -LRB- G ; -RRB- = true then If Par-Test-Ord -LRB- G ; ? 1 -RRB- = false then stop : = true else R : = else L : = od 5 . Return . Algorithm 5 : A parallel algorithm to approximate arboricity . Lemma 7 A 2-approximation for the arboricity c of a graph G can be found in O -LRB- log2 n log c = log log n -RRB- time using O -LRB- m log log n = log2 n -RRB- CRCW PRAM processors , or in O -LRB- log2 n log c -RRB- time using O -LRB- m = log2 n -RRB- EREW PRAM processors . Proof : First note that dm = ne is a lower bound on the arboricity of G. Let ? be the value of for which the algorithm stops . Observe that ? is the smallest such value for . Then ? < = 2c , since the algorithm stops for = 2c by Theorem 2 . A ? - ordering of G results in a ? - forest coloring of G by Lemma 3 . Hence ? is a 2-approximation for arboricity of G. Let us now discuss the complexity of Algorithm 5 . Step 2 is executed at most dlog ce times . The number of iterations of the while-loop in Step 4 is O -LRB- log c -RRB- . In each iteration of the while-loops in Steps 2 and 4 , we call the procedure Par-Test-Ord . PROCEDURE Par-Test-Ord -LRB- H ; -RRB- Input : A graph H = -LRB- V ; E -RRB- , jV j = n , and an integer . Output : A boolean variable ans . The variable ans is set to true if and only if the procedure is able to find an - ordering of G. 1 . H : = H ; n0 : = n ; ans : = true ; mark all vertices unlabeled . 2 . while there is an unlabeled vertex and -LRB- ans = true -RRB- do Let U be the set of vertices of H with degree at most . If jU j < -LRB- 1 +1 -RRB- n0 then ans : = false else -LRB- a -RRB- mark all vertices of U as labeled . -LRB- b -RRB- H : = H ? U ; n0 : = n0 ? jU j ; update the degrees of neighbors of U accordingly . od Algorithm 6 : The procedure called by Algorithm 5 . The complexity of this procedure dominates the resource bounds of the algorithm , since all other steps can be trivially done in O -LRB- 1 -RRB- time . Therefore , in the following we argue only for the complexity of the procedure . Although procedure Par-Test-Ord is very similar to Algorithm 3 , unfortunately we can not implement it in the bounds stated in Theorem 2 . The reason is that during every iteration of the while-loop in Step 2 of the procedure , we have to count the cardinality of U . Hence , in every iteration we need O -LRB- log n = log log n -RRB- time using O -LRB- m log log n = log n -RRB- CRCW PRAM processors -LSB- 3 -RSB- , or O -LRB- log n -RRB- time and O -LRB- m = log n -RRB- EREW PRAM processors -LSB- 11 -RSB- . Note that if the procedure does not return false , then the size of H is reduced by a constant factor after every iteration . This means that the total execution time of the procedure is O -LRB- log2 n = log log n -RRB- and it can be implemented using an optimal number of O -LRB- m log log n = log2 n -RRB- CRCW PRAM processors . Similarly , on the EREW PRAM model , we can implement procedure Par-Test-Ord in O -LRB- log2 n -RRB- time with O -LRB- m = log2 n -RRB- processors . Hence the complexity bounds stated in the lemma follow . By Lemmas 2 , 6 and 7 it is clear that Algorithms 4 and 5 can be used to compute implicit representations of sparse graphs , even without knowing the exact value of arboricity . We summarize the result below . Theorem 3 Let G be an n-vertex sparse graph of unknown arboricity . Then an almost optimal implicit representation of G can be computed in : -LRB- i -RRB- O -LRB- n -RRB- sequential time ; -LRB- ii -RRB- O -LRB- log2 n = log log n -RRB- parallel time using O -LRB- n log log n = log2 n -RRB- CRCW PRAM processors ; -LRB- iii -RRB- O -LRB- log2 n -RRB- parallel time using O -LRB- n = log2 n -RRB- EREW PRAM processors . 5 Final Remarks We have presented simple and optimal algorithms to compute implicit representations of sparse graphs . It is known that many intersection graphs also have implicit representations -LSB- 12 -RSB- . The problem of characterizing the classes of graphs having implicit representation is open . Note that Lemmas 6 and 7 compute a 2-approximation of the arboricity of any graph G -LRB- i.e. not necessarily sparse -RRB- . Our bounds compare favorably with both the sequential results in -LSB- 5 -RSB- -LRB- whose time varies between O -LRB- n1 :5 plog n -RRB- and O -LRB- n3 log n -RRB- -RRB- and the parallel ones in -LSB- 14 -RSB- -LRB- presented in Introduction -RRB- which find the exact value of the arboricity . It will be interesting to find better approximations for the arboricity of a graph than what we have presented . Although with our approximation we can compute an almost optimal implicit representation , our algorithms compute a number of forests which is at most twice the optimal . The known algorithms for computing an optimal forest coloring use matroid partitioning and thus have a high complexity . It is of independent interest to come up with efficient algorithms for computing an optimal forest coloring . Acknowledgements . We are grateful to Shiva Chaudhuri , Torben Hagerup , Glenn Manacher , Kurt Mehlhorn , Jaikumar Radhakrishnan , Raimund Seidel and K.V. Subrahmanyam for many helpful discussions and much useful criticism . References -LSB- 1 -RSB- J. Edmonds , \ Minimum partition of a matroid into independent sets '' , Research of the NBS , 69B :67 -LCB- 72 , 1965 . -LSB- 2 -RSB- R. Cole and U. Vishkin , \ Deterministic coin tossing with applications to optimal parallel list ranking '' , Information and Control , 70:32 -53 , 1986 . -LSB- 3 -RSB- R. Cole and U. Vishkin , \ Faster optimal prefix sums and list ranking '' , Information and Computation , 81:334 -352 , 1989 . -LSB- 4 -RSB- M. F?urer , X. He , M. Kao , and B. Raghavachari , \ Parallel algorithms for straight-line grid embeddings of planar graphs '' , Proc . 4th ACM Symp . on Parallel Algorithms and Architectures -LRB- SPAA ' 92 -RRB- , pp. 410 -LCB- 419 , 1992 . -LSB- 5 -RSB- H.N. Gabow and H.H. Westermann , \ Forests , frames , and games : algorithms for matroid sums and applications '' , Algorithmica , 7:465 -LCB- 497 , 1992 . -LSB- 6 -RSB- A. Goldberg , S. Plotkin and G. Shannon , \ Parallel symmetry-breaking in sparse graphs '' , SIAM J. on Disc . Math. , 1:434 -LCB- 446 , 1988 . -LSB- 7 -RSB- T. Hagerup , \ Optimal parallel algorithms on planar graphs '' , Information and Computation , 84:71 -LCB- 96 , 1990 . -LSB- 8 -RSB- T. Hagerup , M. Chrobak and K. Diks , \ Optimal parallel 5-colouring of planar graphs '' , SIAM J. on Computing , 18 -LRB- 2 -RRB- :288 -LCB- 300 , 1989 . -LSB- 9 -RSB- M. Iri and S. Fujishige , \ Use of matroid theory in operating research , circuits and systems theory '' , Int . J. Systems Sci. , 12 -LRB- 1 -RRB- : 27 -LCB- 54 , 1981 . -LSB- 10 -RSB- A. Itai and M. Rodeh , \ The multi-tree approach to reliability in distributed networks '' , Proc . 25th IEEE Symp . on FOCS , pp. 137-147 , 1984 . -LSB- 11 -RSB- J. J?aJ?a , \ An Introduction to Parallel Algorithms '' , Addison-Wesley , New York , 1992 . -LSB- 12 -RSB- S. Kannan , M. Naor , and S. Rudich , \ Implicit representation of graphs '' , Proc . 20th ACM Symp . on Theory of Computing -LRB- STOC ' 88 -RRB- , pp . 334 -LCB- 343 , 1988 . -LSB- 13 -RSB- L. Lovasz and Y. Yemini , \ On generic rigidity in the plane '' , SIAM J. on Alg . Disc . Meth. , 3:91 -LCB- 98 , 1982 . -LSB- 14 -RSB- H. Narayanan , H. Saran , and V.V. Vazirani , \ Randomized parallel algorithms for matroid union and intersection , with applications to arborescences , and edgedisjoint spanning trees '' , Proc . 3rd ACM-SIAM Symposium on Discrete Algorithms -LRB- SODA ' 92 -RRB- , pp. 357 -LCB- 366 , 1992 . -LSB- 15 -RSB- C. St. J. A. Nash-Williams , \ Edge-disjoint spanning trees of finite graphs '' , Journal London Math . Soc , 36:445 -LCB- 450 , 1961 . -LSB- 16 -RSB- C. St. J. A. Nash-Williams , \ Decomposition of finite graphs into forests '' , Journal London Math . Soc , 39:12 , 1964 . -LSB- 17 -RSB- T. Ohtsuki , Y. Ishizaki and H. Watanabe , \ Topological degrees of freedom and mixed analysis of electrical networks '' , IEEE Trans . Circuit Theory , CT-17 , 4:491 -LCB- 499 , 1970 . -LSB- 18 -RSB- W. Schnyder , \ Embedding planar graphs on the grid '' , Proc . 1st ACM-SIAM Symposium on Discrete Algorithms -LRB- SODA ' 90 -RRB- , pp. 138 -LCB- 148 , 1990 . -LSB- 19 -RSB- J. van Leeuwen . \ Graph algorithms '' , In J. van Leeuwen ed. , Handbook of Theoretical Computer Science , volume A , pp. 525 -LCB- 631 . Elsevier , Amsterdam , 1990 .

O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O B I O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O B O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O B I O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O B I O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O B I O O O O O O B O O O O O O O O O O O O O O O O B I O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B I O O O O O O O O O O O B I O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B I O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B I O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O

arboricity
graph algorithms
implicit representation
parallel computation
sparse graphs