an algorithm for the weak reconstruction of cartesian ...

3 downloads 0 Views 237KB Size Report
Assume G is a cartesian product graph and let P = Gx be a one point deleted subgraph. An O(jEjjV j(2 + jEjlog jV j)) algorithm which reconstructs cartesian ...
AN ALGORITHM FOR THE WEAK RECONSTRUCTION OF CARTESIAN-PRODUCT GRAPHS Johann Hagauer Institute for Theoretical Computer Science Technical University Graz Klostewiesgasse 32, A-8010 Graz Austria Janez Z erovnik 1 Faculty of Mechanical Engineering University of Maribor Smetanova 17, 2000 Maribor Slovenia AMS Subject Classication (1991): 05C, 68Q25 Keywords: reconstruction problem, cartesian product, composite graphs, polynomial algorithm.

Abstract

The cartesian product of graphs 1 and 2 is a graph 1 2 2 with vertex set ( 1 ) ( 2 ) and ( 1 2 )( 1 2 ) 2 ( 1 2 2 ) whenever 1 1 2 ( 1 ) and 2 = 2 or 2 2 2 ( 2 ) and 1 = 1 . is called a cartesian product graph if can be written as = 2 where both and are nontrivial graphs. Assume is a cartesian product graph and let = x be a one point deleted subgraph. An (j jj j(2 + j j log j j)) algorithm which reconstructs cartesian product graph from is given. G

x x

y y

E G

G

G

x y

G

G

E G

G

G

O

E

V

G

V

x

y

G

K

P

E

V

x y

H

G

E G

V

x

K

G

y

H

G

G

P

1 Aliated also at Department of Theoretical Computer Science, Institute of mathematics, physics and mechanics, Ljubljana. Email: [email protected]. Partially supported by the Ministry of Science and Technology of Slovenia, grant no. J2-7516. (The corresponding author).

1

1 Introduction In 11] Ulam asked the question whether a graph G is uniquely determined up to isomorphism by its maximal subgraphs, i.e. the graphs Gx = (V (G) n fxg E (G)) obtained from G by deleting a vertex x and all edges incident to it. It is known that the answer is negative for innite graphs. For nite graphs, however, the question is still open. Many partial results have been found. For example, Dorer 2] proved the validity of this conjecture for nite nontrivial cartesian product graphs, i.e. graphs which are the cartesian product of at least two nontrivial factors. According to MacAvaney 7], Sims showed that a nite connected cartesian product graph is uniquely determined by each of its point deleted subgraphs 9]. The result is given in terms of semistability of cartesian product graphs in 10]. In recent years graph products have become again a very interesting topic in graph theory, mainly due to the algorithmic point of view. Feigenbaum and Haddad studied the problems of minimal cartesian product extensions and maximal cartesian product subgraphs of arbitrary graphs, the problems arising in the design of computer networks and multiprocessing machines. Both problems were shown to be NP{ complete 4]. A related problem (One-vertex Factorable Extension { OFE) was considered in 6]: given a graph Gx , is it possible to extend it with a vertex to get a cartesian product graph? In 6] it is also shown that arbitrary cartesian product graph (nite or innite) can be up to isomorphism uniquely reconstructed from one vertex deleted subgraph. Reconstruction is said to be unique, if the neighborhood of the deleted vertex is determined. If there are more sets of vertices in Gx , which may be connected to the new vertex such that the resulting graph is a cartesian product, we say the reconstruction is not unique. All cases, when a nonunique reconstruction is possible, are characterized in 6]. In this paper, an O(mn(2 + m log n)) algorithm which reconstructs cartesian product graph G from a one point deleted subgraph is given. (We denoted n = jV (G)j and m = jE (G)j, as usual.  is the maximal degree of a vertex of G.) The paper is organized as follows. In the next section some denitions and known results are recalled. In Section 3, we give the skeleton of the algorithm. Two dierent constructions used in the algorithm are given in Sections 4 and 5. 0

2 Preliminaries All graphs considered in this paper are connected nite undirected graphs without loops or multiple edges. If G is a graph, we shall write V (G) or V for its vertex set and E (G) or E for its edge set. E (G) is a set of unordered pairs xy = fx yg of distinct vertices of G. N (v) shall denote the neighborhood of the vertex v, i.e. the set of all vertices adjacent to v. For standard denitions not given here we refer, for example, to 12]. Let u v 2 V (G). The interval IG (u v) is the set of vertices lying on any shortest path between u and v. The cartesian product of graphs G1 and G2 is the graph G1 2G2 with vertex set V (G1 )  V (G2 ) and (x1  x2 )(y1  y2 ) 2 E (G1 2G2 ) whenever x1 y1 2 E (G1 ) and x2 = y2 , or x2 y2 2 E (G2 ) and x1 = y1 . Cartesian product is commutative and associative in an obvious way, having the trivial graph as a unit. A product of nite number of factors is denoted by G = 2i I Gi . Common examples of cartesian products are squares, the skeletons of cubes and n{cubes, prisms (cartesian products of n{gons by an edge) etc. Now we dene the so{called product relation . Let G = 2i I Gi . Call e = fu vg a Gk {edge if e connects vertices u and v such that ui = vi for all i 6= k and fvk  uk g 2 E (Gk ). We then say that two edges e f are in the relation (2i I Gi ) if there is an i such that e and f are Gi edges. It is easy to see that (2i I Gi ) is an equivalence relation. It is known that among all relations induced by a cartesian product representations of G there exists a nest one 8]. This relation is unique and will be denoted by G or simply . It determines the so{called prime factor decomposition in an obvious way. Since  is unique the prime factor decomposition is unique up to isomorphisms and up to the order of factors. A graph G for which G has only one equivalence class is called prime. Otherwise we call the graph composite. In this paper, by a cartesian product graph we will always mean a composite graph. Let G be arbitrary graph and assume we have a decomposition of G, G = 2Gi . Then Gak = fv j vi = ai  i 6= kg is a k{layer (a Gk {layer) through the vertex a 2 G. 2

2

2

2

2

Figure 1: Nonunique extensions, example Gx = C8 . A product square in a cartesian product graph is a square for which the two pairs of opposite edges belong to distinct equivalence classes of the relation . Sometimes we say that edges of the same -class are colored with the same color. Hence, the edges of a product square are alternately colored by two colors. Note that this coloring need not be a proper coloring of edges of G, i.e. incident edges are allowed to be colored by the same color. It is easy to see that each pair of incident edges colored by dierent colors with respect to  spans exactly one product square. We say that the relation  has the square property. There are some more well-known facts that we are going to use frequently (see, for example 3]):  Product square has no diagonals.  All edges of any induced odd cycle are colored by the same color.  Induced 6{cycle in cartesian product graph has either all edges of the same color or edges are colored by three colors and each pair of opposite edges is colored by the same color.  If two squares share two edges then all edges of both squares are colored by the same color. dG (x y) is the distance in graph G between vertices x and y. Let us recall a well-known property of shortest paths in cartesian product graphs: any two shortest paths between arbitrary pair of vertices x and y have the same number of edges of each color (see, for example 5]). Gx denotes the subgraph of G induced by the vertex set V (G) nfxg and ' denotes graph isomorphism, i.e. G1 ' G2 means that G1 and G2 are isomorphic. The basic theorem we need for the correctness of the algorithm assures uniqueness of the reconstruction of cartesian product graphs 6]. Theorem 1 Let G and H be nite or innite connected cartesian product graphs. If the one vertex deleted subgraphs Gx and Hy , where x 2 G and y 2 H , are isomorphic, then G ' H . A one vertex extension is obviously determined by the set of vertices, say Nx in Gx which have to be connected to the new vertex. In general, there may be more dierent subsets Nx which all yield a cartesian product graph. The above theorem assures that in all cases, when the resulting graph is a cartesian product, they are isomorphic. If there is exactly one such subset Nx in Gx we say that the reconstruction is unique. (In terminology of 10] this is equivalent to G being semistable at x.) Characterization of graphs G for which the reconstruction is always unique is given in 6]. This characterization implies that there are two dierent cases where the reconstruction of a cartesian product graph is not unique: 1. C8 ' P3 2P3 n fcentral ; vertexg has two isomorphic reconstructions (see Fig. 1.) 2. Let G be a product K2 2P where P is a prime graph and let x2 be a vertex of P such that Px2 has at least one connected component which has at least one K2 factor. Then the reconstruction is not unique (See example on Fig 2.) Hence, for Gx 6' C8 , two succient conditions for uniqueness of reconstruction are:  If G has at least three factors then the reconstruction of Gx is unique.  If G has at least two factors dierent from K2 then the reconstruction of Gx is unique. 3

Figure 2: Nonunique extensions, example G = K2 2P4 .

3 The skeleton of the algorithm The above characterization guides the overall structure of the algorithm. The case Gx = C8 is clearly the simplest. The second case considered is G = K2 2P , where P may be arbitrary graph. After the second case is done without nding a cartesian graph extension to Gx , uniqueness of the reconstruction may be assumed in the last case. The algorithm can be sketched as follows: ALGORITHM: input=graph Gx if Gx ' C8 then G = P32P3 then output(G is a cartesian product) stop for all x 2 V (G) begin run Construction 1(x ) if the result is a cartesian product graph then output(G is a cartesian product) stop 0

0

end for all s 2 V (G) for all u v 2 N (s) begin run Construction 2(s u v) if the result is a cartesian product graph then output(G is a cartesian product) stop end output(G is NOT a cartesian product) stop

In each case when the algorithm outputs the positive answer, it is also possible to output the reconstructed graph. This will be clear from details of the construction procedures, which are given in the next two sections. The rst construction works for graphs with at least one K2 factor. Its parameter is a vertex of Gx . This covers all cases, where nonunique extensions are possible. If the rst construction is not successfull, the second construction is performed. The second construction works for graphs, for which there is only one extension possible. This construction has three parameters, vertex s with two neighbors, u and v. The parameter for the rst construction can clearly be chosen in O(n) ways. It is easy to see that the parameters for the second construction can be chosen in at most O(mn) ways. We will later show that time complexity of Construction 1 is O(m log n) and time complexity of Construction 2 is O(1) + O(2 ) + O(m log n)). The overall time complexity of the algorithm is therefore O(nm log n+nm(2 +m log n)) = O(nm(2 + m log n)).

4 First construction

The rst construction assumes that the graph G has at least one K2 factor, i.e. G = K2 2P , where P is any graph on at least two vertices. The construction works on the graph Gx . The parameter of this 4

Figure 3: Construction 1 construction is a vertex, say x 2 V (Gx ). 0

CONSTRUCTION 1: Assume x is given. Delete x from Gx to get (Gx )x =: R. For all connected components C of R do begin Factorize the graph C . If C = K22Q and N , the neigborhood of x is in one Q{layer then Nx := x  projection of N in the second Q{layer 0

0

0

0

0

end if Nx is dened in every connected component C then G is a cartesian product graph. Remark: If x is a neighbor of x in G such that R is of the form K22Q, then (clearly) the above 0

construction gives a cartesian product graph (see Fig. 3). Because of the Theorem 1, this graph must be isomorphic to the original graph G. Remark: In order to try Construction 1 for all possible choices of parameter x we have to factorize and test for each vertex of Gx . For factoring we may use the algorithm of Aurenhammer, Hagauer and Imrich with complexity O(m log n) 1]. This algorithm also gives coordinates for vertices of G. Therefore the test needed can be done within the same time complexity. Given the coordinates with respect to the factoring of R all vertices of the set N = NGx (x ), i.e. the set of neighbors of x in Gx , must have at least one coordinate equal and at least one of the coordinates which is equal for all vertices in N must correspond to a K2 factor. Note that Q need not be prime, so it may in general have some additional K2 factors. If N has this property, then it is clear how to obtain the 'projection' of N to extend the graph to a cartesian product. (Details are left to the reader. Hint: just take any of the suitable K2 factors.) Hence time complexity of Construction 1 is of order O(m log n). 0

0

0

0

0

5 Second construction Let G (and Gx ) be xed from now on. In this section (except in the Construction 2) we will assume that G is a cartesian product graph. In Construction 2 we assume that we are given a vertex, denoted by s, which is on distance 2 from x in the graph G. (Recall that all graphs are assumed to be connected.) Furthermore, we assume that we are given two vertices u, v such that suxv is a product square in G. Note that we may now also assume that G has a unique reconstruction. Before the Construction 2 we give several lemmas. Let the edges xv and su of the product square suxv have color c1 and the edges xu and sv have color c2 . Then, of course, c1 6= c2 . Note that s must be the unique common neighbor of u and v in Gx . If there was another common neighbor, say w of u and v in Gx , then we would have squares suwv and suxv sharing two edges, implying c1 = c2 . In the proofs of the lemmas 1, 8 and 9 we will use the following properties of shortest paths in a cartesian product graph: For any pair of vertices, every shortest path has the same number of edges of 5

Figure 4: Neighbors of x are only at levels 1,2 and 3. certain color (i.e. edges of certain  equivalence class). Furthermore, given any shortest path between a pair of vertices, we can construct shortest paths between this pair of vertices such that the order of colors of edges along the path is arbitrary. This facts can be easily shown, for example, by using the square property (see Lemma 2 and Lemma 3 of 13] for details).

Lemma 1 For any vertex y 2 V (G), y 6= x, the distance between y and s in G is equal to the distance between y and s in Gx .

Proof: First note that x and s are not in the same layer and hence there is one edge of color, c1, and

one edge of another color, c2 , on the shortest path from s to x. Let y be arbitrary vertex. If x is not on a shortest path from s to y, then the distances in G and in Gx are obviously equal. Now let us assume x is on a shortest path between s and y. Then edges of both color c1 and of color c2 are on any shortest path. Since shortest paths with arbitrary order of colors of edges exists, it can be shown that x can not be on all such paths. Hence, the distance in Gx between s and y is the same as the distance in G. 2

We need some more denitions. Given the vertex s, we dene levels in G and levels in Gx as follows: vertex w is at level ` in G () dG (s w) = ` and w is at level ` in Gx () dGx (s w) = `. Because of the just proved lemma, the levels of Gx and G are equivalent provided G is a cartesian product graph. For example, s is always at level 0, u, v are at level 1 and x is always at level 2. Let level(w) = `. We say an edge wy is a down{edge (cross{edge,up{edge) of w if level of y < ` (resp. level of y = `, level of y > `). Furthermore, we say a neighbor y of w is a down{neighbor (cross{neighbor,up{neighbor) if wy is a down{edge of w (resp. cross{edge, up{edge).

Corollary 1 x has neighbors only at levels 1,2 and 3. The Construction 2 is given a starting vertex s and two vertices u and v (the neighbors of x at level 1). We now assume the vertices s u and v are correctly guessed. Because of the uniqueness theorem (Theorem 1), the worst that can happen is that in the case of an incorrect guess the resulting graph will not be a cartesian product. The Construction 2 will connect the new vertex x with cross{neighbors (vertices at level 2) and with up{neighbors (vertices at level 3). The graph H obtained by the Construction 2 may be a cartesian product or not. If it is a cartesian product graph we are sure that it is the only possible and hence the correct reconstruction of G. It remains to be proven that the construction will indeed give a cartesian product graph provided s and u v were chosen correctly. We rst consider inserting the cross{edges. Let us recal the color of su is c1 and the color of sv is c2 and, of course, c1 6= c2 . 6

Figure 5: xy 2 E (G) () w 2 E (Gx ).

Lemma 2

1. Each cross{neighbor y of x in G has the following property: y is an up{neighbor of some  2 fu vg and has exactly one more down{neighbor w 62 fu vg. 2. Let y and w be dened as in 1. and let  2 fu vg be the vertex which is not down{neighbor of y. Then w 2 E (Gx ) ( () w 2 E (G)). 3. Let w be a vertex at level 1 and vw 2 E (G). Then xy 2 E (G), where y is the unique vertex closing the product square on edges su and sw.

Proof: Assume y is a cross{neighbor of x, i.e. xy 2 E (G) and dG(y s) = 2. Since dG(y s) = 2, there must be a vertex, say w such that yw 2 E (G) and sw 2 E (G). Claim: y has a down{neighbor w 62 fu vg.

Note that at most one of the vertices u, v can be a down{neighbor of y, because otherwise the squares svxu and svyu would share two edges and, consequently, all their edges including su and sv would be colored by the same color. Now assume u is a down{neighbor of y. Then uxy is a triangle, hence the color of uy must be c2 (the same as the color of ux). But then the edges uy and su span a chordless square with a fourth vertex w, and w 6= v. Hence y must have a down{neighbor w 62 fu vg and the claim is proved. Assume w 62 fu vg. (See Fig.5.) suxyw is a pentagon in G. There must be a diagonal in this pentagon, since otherwise colors c1 and c2 would be equal (which is contradiction to the assumptions.) xw 62 E (G), because otherwise svxw and svxu would share two edges, which is in contradiction with assumption c1 6= c2 . ys 62 E (G) since dG (y s) = 2. Hence uy 2 E (G) or uw 2 E (G). Assume rst uy 2 E (G). Let c be color of the edge xy. uy 2 E (G) implies xuy is a triangle and therefore c = c2 . Now vy 62 E (G) since the opposite would imply c = c1 6= c2 = c. Thus the only diagonal of the pentagon svxyw left possible is vw. (If there is no diagonal in pentagon svxyw, then c1 = c2 by similar reasoning as above.) We remark in passing that in this case uw 62 E (G), because this would again imply c = c1 6= c2 = c. The second case is uw 2 E (G). This implies uw is of color c1 and because of the square property, xy is of color c = c1 and wy is of color c2 . Now considering the pentagon svxyw we conclude that yv 2 E (G). Note that yu 2 E (G) and yv 2 E (G) is not possible, since then there were two squares suxv and suyv sharing two edges, which implies c1 = c2 , contradiction. The next thing we have to show is that there are no more down{neighbors of y besides  and w. If there would be another down{neighbor of y, say w , then considering the squares syw , swyw and syw would result in conclusion c1 = c2 , a contradiction. Hence we proved statements 1. and 2. We now prove statement 3. of the Lemma. Note rst that y is well dened, since svw being a triangle implies color of sw must be c2 , and since color of su is c1 , the two edges must span a unique product square. Assuming xy 62 E (G) implies uywvx is an induced pentagon, which in turn implies c1 = c2 , contradiction. 2 0

0

7

0

Figure 6: Proof of lemma 5.

Figure 7: Proof of lemma 5. We now turn to up{neighbors of x.

Lemma 3 Let y be a vertex at level 3 with at least two down{neighbors in Gx. Then xy 2 E (G) if and only if u v 2 IGx (s y).

Proof: Assume y is at distance dGx (y s) = 3 from s and has at least two down neighbors. First we

prove that xy 2 E (G) implies that there is a down-neighbor of y, say z , such that uz 2 E (G) and there is a down-neighbor of y, say z , such that vz 2 E (G). Let c be the color of the edge xy. c must dier from at least one of the colors c1 , c2 . W.l.o.g. we may assume c 6= c2 . Then, by the square property, there must be a vertex, let us label it z , which closes a product square with vertices u, x and y. Note that z is a down neighbor of y. By assumption, there must be at least one more down-neighbor of y, say z . (See Fig. 6.) Now we show that v must be a neighbor of z and u cannot be a neighbor of z . First, z u 62 E (G) because then this would close a second square with edges ux and xy, which would imply colors c and c2 are equal. Second, if z v 62 E (G), then there must be a vertex, say  , between s and z . But then after checking possible diagonals we see that svxyz  is an induced 6-cycle, which implies c1 = c2 , contradiction. Hence, z v 2 E (G) and u v 2 IGx (s y). Now assume u v 2 IGx (s y). Then y has two down neighbors, say z and z , in G such that uz 2 E (G) and vz 2 E (G). We will prove that then xy 2 E (G). We claim that: uv 62 E (G) (by assumption), yv 62 E (G), yu 62 E (G), ys 62 E (G), zs 62 E (G) and z s 62 E (G) (because dg (s y) = 3, uz 62 E (G) (since uz 2 E (G) would close a second square with edges su and sv), vz 62 E (G) (since vz 2 E (G) would close a second square with edges su and sv), zz 62 E (G) (since zz 2 E (G) would imply zz vsu being an induced 5{cycle and colors c1 and c2 would be equal). Hence zyz vsu is an induced 6{cycle in G. Now we use the fact that the edges of an induced 6{cycle are either all of the same color or are colored with three colors and pairs of opposite edges are colored by 0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

8

Figure 8: Example P4 2P4 .

Figure 9: Example K2 2K22P4 . the same color. This determines the colors of edges of this cycle. But the colors of edges of the 6{cycle zyz vxu are also determined. (See Fig. 7.) Now either all colors of the cycle zyz vxu are equal (and, in particular c1 = c2 ) or zyz vxu has a diagonal. Since all edges but xy were excluded above, we conclude that xy 2 E (G). 2 0

0

0

If there is no vertex at level 3 with at least two down neighbors in Gx , then there may be some vertices at level 3 with only one down neighbor. Before proving relevant lemmas let us consider examples on Figures 8 and 9. Examples show that only information on vertices up to level 3 is not sucient to decide which vertices are to be connected with x. In both examples, it is not possible to determine the neighbors of x without considering the vertex q at level 4. Recalling the characterization of 6] we know that in both examples the reconstruction is unique. Hence we may need to consider more than only the rst three layers in order to determine the set of neighbors Nx. In the following, we show how the information obtained from vertices at higher levels can be used to determine the up{neighbors of x. Before we study the case when up{neighbor of x has only one more down{neighbor in G we need some more denitions. A vertex y at level 3 is a candidate (for being connected to x) if it has down{ degree one in Gx and jIGx (s y)j = 4 and either u or v is in IGx (s y) (i.e. the interval between s and w, the unique down{neighbor of y, is a path in Gx containing u or v). A candidate y is vw{candidate if IGx (s y) = fs v w yg. A vw{candidate y is a good candidate if there is an up{neighbor q of y such that IGx (s q) contains both u and v. A vw{candidate y is a bad candidate if y is not good and there is an up{neighbor z of y such that N (s) \ (IGx (s q) ; fu vg) 6= .

Lemma 4 Assume y is a vertex at level 3 with down{degree 1 in Gx. If y is not a candidate then xy 62 E (G).

Proof: : Assume xy 2 E (G). Then y has exactly two down{neighbors in G, x and, say, w. Since y is at level 3, the vertex w has to have at least one down neighbor, say  . By inspecting the hexagons suxyw 9

and svxyw we see that  has to be either u or v and that jIGx (s y)j = 4. Hence y is a candidate. 2

Lemma 5 If y is a good vw-candidate then xy 2 E (G). Proof: Let z be an up{neighbor of y at level 4 and assume IGx (s z) contains both u and v. Assume

xy 62 E (G). Then IGx (s y) = IG (s y) = fs v w yg. IG (s y) is a path and hence all vertices must be in the same layer because G is a cartesian product graph. z is not in the layer containing s v w and y, because u 2 IG (s z ). Consequently, the subgraph of G induced on IG (s z ) is isomorphic to K22P4 .

(Hint: In a Cartesian product graph, every shortest path between a xed pair of vertices has the same number of edges of each color.) But then IGx (s z ) can not contain u. Contradiction. 2

Lemma 6 At most one vw{candidate is good. Proof: Assume y and y are both good candidates with intervals IGx (s y) = fs v w yg and IGx (s y ) = 0

0

fs v w y g. First note that the edges sv and vw must be of the same color (= c2 ), because of IGx (s w) = fs v wg and the square property. Second, both edge wy and edge wy must be of color c1 (Since xy 2 E (G), the path leading through x contains an edge colored by c1 and therefore c1 has to be there.) Finally, considering the squares spanned (in G) on vwy and on vwy we have c1 = c2 because the two squares share two edges. But c1 6= c2 and therefore y and y can not both be good candidates. 2 0

0

0

0

Lemma 7 If u has an up{neighbor u in Gx such that uu is not of color c2, then there is a good 0

0

vw{candidate.

Proof: Assume that u has an up{neighbor u in Gx and the color c of uu is not c2. Then the edges sv 0

0

and vw (both of color c2 ) and the edges su and uu (both of colors 6= c2 ) by the square property span a subgraph of G which is isomorphic to a product of paths P3 2P3 . x is the central vertex of this product and hence one of the neighbors of w is a good candidate. 2 0

Example: Let G = K32C6 . For any choice of s, u and v, there is no good candidate. 2 Hence, possibly there is no good candidate. In this case, the correct choice is a candidate which is not bad.

Lemma 8 If y is a bad vw{candidate then xy 62 E (G). Proof: We assume xy 2 E (G) and prove that then y can not be a bad candidate.

Let y be a vw{candidate and z be any up{neighbor of y. First we show that the edges xy and yz must be of color c2 . If at least one of edges xy, yz is of color dierent from c2 , then there is a shortest path in G from s to z through u avoiding x. But then u is in IGx (s z ) and y is a good candidate. (Hint: construct a shortest path avoiding x from path uxyz using the square property.) Hence the edges xy and yz must be of color c2 . This implies that any shortest path from s to z has one c1 colored edge and three c2 colored edges. If IGx (z s) \ (N (s) ; fv ug) 6= , there is a shortest path from s to z through s 2 N (s) and s is not u or v. From this shortest path we infer existence of a shortest path from s to z through u avoiding x (Hint: by the square property there is a unique vertex q 0

0

10

Figure 10: All candidates but one are bad. closing the square on edges su and ss . By similar reasoning we can construct a shortest path with rst edge xu and with second edge of color uq.) But then u is in IGx (s z ) and y is again a good candidate. Hence if xy 2 E (G), then y can not be a bad candidate. 2 0

Lemma 9 If there is no good vw{candidate then there is exactly one candidate y, which is not bad. Furthermore, xy 2 E (G).

Proof: Since there is no good candidates among vw{candidates, by Lemma 7 we know there is no up{

neighbor u of u such that the color of edge uu is not c2 . Since no factor of G is isomorphic to K2 there must be a neighbor of s, say s , such that the color of ss is c1 . Now any vw{candidate y, for which xy 62 G clearly has an up{neighbor z with I (s z ) containing s . (Hint: z can be found by repeated application of the square property.) Hence, if y is not bad then xy 2 G. Clearly, there is at least one candidate for which xy 2 E (G) because there is a vertex in G closing the square on x, v and w. On the other hand, there can be at most one candidate, which is neither good nor bad. If there were two such candidates, say y and y , then the square xy wy would imply c1 = c2 , contradiction. (see Fig. 10). 2 0

0

0

0

0

0

00

0

00

Lemma 10 Exactly one vw{candidate is adjacent to x in G. Proof: Combine the lemmas 5,6,8 and 9. 2 CONSTRUCTION 2: Given xed s and u v, the construction of the graph H is done in three phases. 1. (insert cross-edges) 1.1 For any vertex y at level 2 which is a neighbor of u and has exactly one more neighbor, say w, at level 1 do insert edge xv if and only if vw 2 E (Gx ). 1.2 The same for v. 2. (insert up-edges) 2.1. For any vertex y at level 3 with at least two down{edges, insert edge xy if and only if u v 2 IGx (s y). 2.2. For any vertex y at level 3 with exactly one down{neighbor, insert edge xy if y is a good candidate. 2.3 For any vertex y at level 3 with exactly one down{neighbor, say w, insert edge xy if w has no up-neighbor, which is a good candidate and if y is not a bad candidate. 11

3. Check if the new graph is a cartesian product graph. Remark: Construction 2 can be implemented so that in preprocessing a breadth-rst search is done from each vertex s and the useful information on distances and on up{ and down{neighbors is stored. In Step 1. of Construction 2, decisions on cross edges to x can be made in constant time for each vertex at level 2. In Step 2. considering vertices at level 3, a decision on whether a vertex is a good candidate or bad candidate has to be made using information on up{neighbors of candidate. More precisely, for a candidate y all its up{neighbors have to be tested, for example as follows: y is a good candidate () u v 2 IGx (s z ) () dG (z u) = dG (z v) = 3 and y is a bad candidate () (IGx (s z );fu vg)\N (s) 6= () there is no r 2 N (s) ; fu vg with dG (r z ) = 3. Assuming the distances were precomputed, the complexity of checking a vertex for being a good candidate takes time proportional to degree of y while checking a vertex for being a bad candidate takes time proportional to degree of y times degree of s. In Step 3., a factoring algorithm (of complexity O(m log n)) is run for testing whether the resulting graph is a cartesian product. Time complexity of Construction 2 is thus O(C ) + O(2 ) + O(m log n)).

Acknowledgement: The authors wish to thank the anonymous referees for detailed reading of the manuscript. Their comments enabled us to improve the quality of the manuscript considerably, in particular to correct the Lemmas 1 and 2.

References 1] F.Aurenhammer, J.Hagauer, W.Imrich (1992), "Cartesian Graph Factorization at Logarithmic Cost per Edge", Comput. Complexity 2 331-349. 2] W.Dorer (1973), "Some Results on the Reconstruction of Graphs", Colloq. Math. Soc. Janos Bolyai, 10, Keszthely, Hungary, 361-383. 3] J.Feigenbaum, J.Herschberger A.A.Schaer (1985), "A Polynomial Time Algorithm for Finding the Prime Factors of Cartesian{Product Graphs", Discrete Appl. Math. 12 123-138. 4] J.Feigenbaum, R.Haddad (1989), "On Factorable Extensions and Subgraphs of Prime Graphs", SIAM J. Discrete Math. 2 197-218. 5] W.Imrich (1989), "Embedding Graphs into Cartesian Products", Graph Theory and Applications: East and West, Ann. New York Acad. Sci. 576 266-274. 6] W.Imrich, J.Z erovnik (1996), "On the weak Reconstruction of Cartesian{product graphs", Discrete Math. 150 167-178. 7] K.L.MacAvaney (1980), "A conjecture on two{point deleted subgraphs of Cartesian products", Lecture Notes in Math. 829 172{185. 8] G.Sabidussi (1960), "Graph Multiplication", Math. Z. 72 446-457. 9] J.Sims (1976), Stability of the cartesian product of graphs, (M.Sc. thesis, University of Melbourne). 10] J.Sims, D.A.Holton (1978), "Stability of cartesian products", J. Combin. Theory Ser. B 25 258-282. 11] S.M.Ulam (1960), A Collection of Mathematical Problems, Wiley, New York, p.29. 12] R.Wilson (1986), Introduction to Graph Theory (third edition) Longman Scientic & Technical, Harlow. 13] J.Z erovnik (1991), A simple algorithm for factoring a cartesian-product graph, (Arbeitsbericht 5/1991, Institut fuer Mathematik und Angewandte Geometrie, Montanuniversitaet Leoben).

12

Suggest Documents