An embedding algorithm for a special case of extended grids

A book consists of a line in the 3-dimensional space, called the spine, and a number of pages, each a half-plane with the spine as boundary. A book embedding (, ) of a graph consists of a linear ordering of , of vertices, called the spine ordering, along the spine of a book and an assignment , of edges to pages so that edges assigned to the same page can be drawn on that page without crossing. That is, we cannot find vertices u, v, x, y with (u) < (x) < (v) < (y), yet the edges uv and xy are assigned to the same page, that is (uv) = (xy). The book thickness or page number of a graph G is the minimum number of pages in required to embed G in a book. In this paper we consider the extended grid and prove that the 1n extended grid can be embedded in two pages. We also give a linear time algorithm to embed the 1n extended grid in two pages.


Introduction:
The growth of the subject 'graph theory' has been very rapid in recent years, particularly since the domain of its application is varied. Graph algorithms play a very important role in design of various computer networks. Among the problems one comes across in graph theory, is the embedding of graphs. A particular way of embedding graphs is in the pages of a book. The book embedding of graphs was first introduced by Bernhart and Kainen [1] and since then, many researchers have actively studied it. Determining the book thickness for general graphs is NP-hard. But obtaining the book thickness for particular graphs have been found to be possible. The book embeddings have been studied for many classes of graphs. To name a few, we have: Complete Graphs [1,2], Complete Bipartite Graphs [10], Trees, Grids and X-trees [3], hypercubes [3,9], incomplete hypercubes [8], iterated line digraphs [6], de Bruijn graphs, Kautz graphs, shuffle-exchange graphs [7], for each of which embedding in books have been studied.
The book embedding problem has many different applications, which include sorting with parallel stacks, single-row routing of printed circuit boards, and the design of fault-tolerant processor arrays [4,12].
In this paper, we discuss the book embedding of extended grids

Preliminaries
The Extended Grid [11] is an extension of the Mesh network very popular for its layout design and ease of implementation. It is a large graph with big edge to vertex ratio. The Extended Grid graphs are sub graphs of the tessellation of the K 4 graphs. The 2-dimensional grid graph (also called Mesh) M(r, s) is a graph whose vertex set is the set of ordered pairs of nonnegative integers {(i, j): 0 ≤ i < r, 0 ≤ j<s}, in which there is an edge between vertex (i, j) and (k, l) if either |i -k| = 1 and j= l, or i = k and |j -l| = 1. See Figure 1.
The Extended Grid EM(r, s) is the graph whose vertex set is the set of ordered pairs of nonnegative integers {(i, j): 0 ≤ i<r, 0 ≤ j<s}, in which there is an edge between vertex (i, j) and (k,l) if and only if |i -k| ≤ 1 and |j -l| ≤ 1 . Thus the extended grid is obtained from a 2dimensional grid by adding diagonal edges to the nodes. See Figure 2.  The graph EM(m, n) consists of m rows of 'n' K 4 graphs and n columns of 'm' K 4 graphs. In this paper, we shall denote the K 4 in the i th row, j th column by G i,j .

Embedding EM(1, n) in two pages
We shall now prove two preliminary lemmas in respect of the extended grids. Lemma 1: Extended grids EM(m, n) cannot be embedded in a single page. Proof: It is enough to prove the lemma for the special case m = 1, n = 1. Let EM(1, 1) have vertices u 1 , u 2 , u 3 , u 4 as shown in Figure 3. Let these vertices be embedded in any manner on P 4 , which after renaming be

Figure 3
We see that EM(1, 1) is just K 4 and hence 3-regular. Hence deg(u i ) = 3 for each i= 1, 2, 3, 4. Consequently deg(v i ) = 3 for each i = 1, 2, 3, 4. Therefore, each v i is adjacent to each of the v j , i ≠ j. In particular, there has to be an edge between v 1 and v 4 . But then, there cannot be an edge between v 2 and v 4 in the same page. See Figure 3. Thus, a single page is not sufficient to embed EM(1, 1). Now we shall prove the main result of this paper.  1, 1 , v 1, 2 , ..., v 1, n+1 , v 2, n+1 , ..., v 2, 1 . Hence it requires exactly two pages for embedding the edges of EM(1, n) in a book [1]. Hence the theorem.

ALGORITHM BKEMBED(1, n)
Step 1: Label the vertices of P 2n+2 , the spine of the book embedding with the sequenceS 0 S R where S 0 is the sequence {v 1,1 , ..., v 1,n 1 } and S 1 is the sequence {v 2,1 , ..., v 2,n 1 } Step 2: Join v 1,1 to v 1,2 in page 1 Step 3: for i = 1 to n Note: Let 1  i  n . The above algorithm works in the following way (i) The printing cycle S 0 S R is obtained by nesting

Proof of Correctness of the Embedding algorithm
Theorem2:Algorithm BKEMBED(1, n) embeds all the edges of EM (1, n) in two pages for any n. Proof: We give the proof of correctness using loop-invariants [5]. In step 1, the algorithm labels the spine P 2n+2 with the labels v 1, 1, … , v 1, n+1 , v 2, n+1 , … , v 2, 1 , in that order. See Figure 6. We shall now prove using loop-invariants that step 3 correctly completes the embedding of EM (1, n) in two pages in a book.

Time Complexity
Now we shall find the time complexity of BKEMBED(1, n). We shall directly compute the time complexity calculating the effort in each step of the algorithm.

Conclusion
The Extended Grid EM(1, n) is planar while EM(m, n) is non-planar. Hence EM(m, n) will require atleast 3 pages to embed them. At the first instance it looks as if the number of pages will increase as the number of rows increase. However as the number of rows and columns increase, the number of vertices also increase. Hence these graphs may be embedded in considerably less number of pages. But to prove such a possibility would be a challenge.