5 Partial Cubes

This is the central chapter of the book. Unlike general cubical graphs, iso- metric subgraphs of cubes—partial cubes—can be effectively characterized in many different ways and possess much finer structural properties. In this chapter, we present what can be called a “micro” theory of partial cubes.

5.1 Definitions and Examples

As cubical graphs are subgraphs of cubes, partial cubes are isometric sub- graphs of cubes (cf. Section 1.4).

Definition 5.1. A graph G is a partial cube if it can be isometrically embed- ded into a cube H(X) for some set X. We often identify G with its isometric image in H(X) and say that G is a partial cube on the set X.

Note that partial cubes are connected graphs. Clearly, they are cubical graphs. The converse is not true. The smallest counterexample is the graph G on seven vertices shown in Figure 5.1a.

z {a,b,c}

x y {a,b} {b,c} a) b) a c u v w { } {b} { }

G s Ø

Figure 5.1. A cubical graph that is not a partial cube.

S. Ovchinnikov, Graphs and Cubes, Universitext, DOI 10.1007/978-1-4614-0797-3_5, 127 © Springer Science+Business Media, LLC 2011 128 5 Partial Cubes

Indeed, suppose that ϕ : G → H(X) is an embedding. We may assume that ϕ(s)= ∅. Then the images of vertices u, v, and w under the embedding ϕ are singletons in X, say, {a}, {b}, and {c}, respectively. It is easy to verify that we must have (cf. proof of Theorem 4.42) ϕ(y) = {b,c}, ϕ(z)= {a,b,c} and [ϕ(x)= {a, b} or ϕ(x)= {a,c}]. We assume that ϕ(x) = {a, b} (see Figure 5.1b); the other case is treated similarly. The graph distance between vertices v and x in G is 3, whereas the distance between their images {b} and {a, b} in H(X) is 1. Therefore, ϕ is an embedding but not an isometric embedding. In Section 4.1 we proved that paths, even cycles, and trees are cubical graphs (cf. Figure 4.1). In fact, they are partial cubes. It is not difficult to prove this assertion directly using constructions from Section 4.1 (cf. Exercise 5.1). It also follows from one of our characterization theorems (see Section 5.4). These theorems can be used to show that all cubical graphs in Figure 4.5 are partial cubes, proving that the graph in Figure 5.1a is indeed the smallest counterexample (cf. Exercise 5.2).

5.2 Well-Graded Families of Sets

Let G be a partial cube on X. Because G is an isometric subgraph of H(X), for any two vertices P and Q of G there is a sequence of vertices of G,

R0 = P, R1,...,Rn = Q such that d(P,Q) = n and d(Ri, Ri+1) = 1 for 0 ≤ i < n, where d is the Hamming distance on H(X). The sequence (Ri) is a shortest path connecting P to Q in G (and in H(X)). Definition 5.2. A family1 F of distinct subsets of a set X is called a well- graded family of sets (wg-family for short) if, for any two distinct subsets P,Q ∈ F, there is a sequence of sets in F

R0 = P, R1,...,Rn = Q such that

|R0 △ Rn| = n and |Ri △ Ri+1| = 1, for all 0 ≤ i < n. (5.1) According to this definition, the vertex set of a partial cube on X is a well-graded family of finite subsets of X. X Let P(X) = K2 be the Cartesian power of K2 (cf. Section 3.5). Any nonempty family F of subsets of X induces a subgraph GF = (F, EF) of P(X), where EF = {{P,Q}∈ F : |P △ Q| = 1}. 1 To avoid trivialities, we assume that families of sets under consideration contain more than one element. 5.2 Well-Graded Families of Sets 129

Theorem 5.3. (i) The graph GF is an isometric subgraph of P(X) if and only if the family F is well-graded. (ii) If F is well-graded, then GF is a partial cube.

Proof. (i) (Necessity.) Suppose that GF is an isometric subgraph of P(X). Because the graph GF is connected, it belongs to a connected component of the graph P(X). Hence, by Lemma 3.5, P △Q is a finite set for any P,Q ∈ F. Because GF is an isometric subgraph, F is a wg-family. (Sufficiency.) Let F be a wg-family and P , Q be two sets in F. It is clear that a sequence (Ri) of vertices of GF is a shortest PQ-path in GF if and only if it satisfies condition (5.1). Therefore the graph GF is an isometric subgraph of P(X). (ii) Let F be a wg-family of subsets of X. Then, by part (i), GF is an iso- metric subgraph of P(X). Let A be a vertex of GF. Because GF is connected, it is a subgraph of the connected component H(A) of P(X). By Theorem 3.9, the graph H(A) is isomorphic to the cube H(X). It follows that GF is a partial cube. 

The converse of claim (ii) does not hold as the following example demon- strates.

Example 5.4. Let GF be a subgraph of the cube Q3 = H({a,b,c}) induced by the family F = {∅, {a}, {a, b}, {a,b,c}, {b,c}}

(see Figure 5.2). Clearly, GF is not an isometric subgraph of Q3. On the other hand, GF is the path P5 and therefore is a partial cube (Exercise 5.1). Thus, GF is a partial cube, but not a partial cube on X = {a,b,c}.

{a,b,c}

{a,c} {a,b} {b,c}

a { } {b} {c}

Ø

Figure 5.2. An induced subgraph of Q3.

Example 5.5. Let F be the family of all subsets of Z in the form (−∞, n]. It is not difficult to see that F is a wg-family of infinite subsets of Z. The graph GF is isomorphic to the double ray Z. Therefore, by Theorem 5.3(ii), Z is an infinite partial cube (cf. Exercise 5.3). 130 5 Partial Cubes

Corollary 5.6. The graph GF is a partial cube on X if and only if F is a wg-family of finite subsets of X.

Sequences of vertices (Ri) satisfying condition (5.1) are shortest paths in the graph P(X). If F is a wg-family, then they are also shortest paths in the graph GF. The next two theorems establish some useful properties of these sequences.

Theorem 5.7. Let F be a wg-family of subsets of a set X and let

P = R0, R1,...,Rn = Q be a shortest path in GF. Then

(i) d(Ri, Rj)= |j − i|. (ii) Ri,...,Rj is a shortest RiRj-path in GF. (iii) d(Ri, Rj)= d(Ri, Rk)+ d(Rk, Rj) for i ≤ k ≤ j. (iv) Ri ∩ Rj ⊆ Rk ⊆ Ri ∪ Rj for i ≤ k ≤ j, where d is the Hamming distance on P(X).

Proof. (i) and (ii) are the results of Lemma 2.5. It remains to note that (iii) follows immediately from (i), and that (iii) and (iv) are equivalent conditions by Theorem 3.22. 

Theorem 5.8. Let F be a wg-family of subsets of a set X and let

P = R0, R1,...,Rn = Q be a shortest path in GF. Then

(i) Either Ri+1 = Ri ∪ {x} for some x ∈ Q \ P , or Ri+1 = Ri \{x} for some x ∈ P \ Q. Equivalently, for any 0 ≤ i < n there is x ∈ P △ Q such that Ri △ Ri+1 = {x}. (ii) For any x ∈ P △ Q there is 0 ≤ i < n such that Ri △ Ri+1 = {x}.

Proof. (i) Inasmuch as |Ri△Ri+1| = d(Ri, Ri+1) = 1, we have Ri△Ri+1 = {x} for some x ∈ X. Hence, either Ri+1 = Ri ∪{x} and x∈ / Ri, or Ri+1 = Ri \{x} and x ∈ Ri. Suppose that Ri+1 = Ri ∪ {x}, x∈ / Ri. By Theorem 5.7(ii), Ri+1 lies between Ri and Rn = Q. Therefore, by Theorem 3.22, Ri+1 ⊆ Ri ∪ Q. Hence, x ∈ Q. Suppose now that Ri+1 = Ri \{x}, x ∈ Ri. Then, by Theorem 5.7(ii), Ri lies between Ri+1 and R0 = P . Therefore, by Theorem 3.22, Ri ⊆ Ri+1 ∪ P . It follows that x ∈ P . (ii) Let x ∈ P △Q. By symmetry, we may assume that x ∈ Q\P . We prove claim (ii) by induction on n = d(P,Q). For n = 1 the statement is trivial. For the induction step, suppose that n > 1 and assume that (ii) holds for paths 5.2 Well-Graded Families of Sets 131 of smaller length. If x ∈ Q \ Rn−1, we are done. Otherwise, x ∈ Rn−1 and the result follows from the induction hypothesis. 

We say that two distinct sets P and Q in a family of sets F are adjacent in F if P ∩ Q ⊆ R ⊆ P ∪ Q and R ∈ F implies R = P or R = Q. In other words, P and Q are adjacent in F if they are the only sets in F that lie between P and Q. One should distinguish two concepts of adjacency for a given family of sets F: adjacency in GF and adjacency in F. Clearly, two vertices P and Q that are adjacent in GF are also adjacent in F. The converse is not true. For instance, the subsets ∅ and {b,c} of the family F in Example 5.4 are adjacent in F but not in GF. Theorem 5.9. A family F of subsets of a set X is well-graded if and only if d(P,Q) = 1 for any two sets P , Q that are adjacent in F. Proof. (Necessity.) Suppose that F is a wg-family and let P and Q be two sets that are adjacent in F. Then there is a sequence (Ri) of sets in F satisfying condition (5.1). By Theorem 5.7(iv), P ∩ Q ⊆ Ri ⊆ P ∪ Q for all 0 ≤ i ≤ n. Because P and Q are adjacent in F, we have Ri ∈ {P,Q}. Hence, d(P,Q)= 1. (Sufficiency.) Let P , Q be two distinct sets in F. We prove by induction on n = d(P,Q) that there is a sequence (Ri) of sets in F satisfying condition (5.1). The statement is trivial for n = 1. Suppose that n> 1 and that the state- ment is true for all k < n. Because d(P,Q) > 1, the sets P and Q are not adjacent in F. Hence there is R ∈ F distinct from P and Q such that P ∩ Q ⊆ R ⊆ P ∪ Q. Then d(P, R)+ d(R,Q) = d(P,Q) and both distances d(P, R) and d(R,Q) are less than n = d(P,Q). By the induction hypothesis, there is a sequence (Ri) ∈ F such that P = R0, R = Rj, and Q = Rn, for some 0

The last theorem in this section is an application of the criterion from Theorem 5.9. Definition 5.10. A family of sets F is said to be an independence system (of sets) if, for any P ∈ F and any Q ⊆ P , the set Q also belongs to F. Theorem 5.11. An independence system F is a wg-family. Accordingly, the graph GF is a partial cube. Proof. Let P and Q be two adjacent sets in F. Because P ∩ Q lies between P and Q, we have either P ∩Q = P or P ∩Q = Q. By symmetry, we may assume that P ⊆ Q. Let x be an element of Q \ R. Because F is an independence system and the sets P and Q are adjacent in F, we have Q = P ∪ {x}; that is, d(P,Q) = 1. The result follows from Theorems 5.9 and 5.3(ii).  132 5 Partial Cubes 5.3 Partial Orders

The main goal of this section is to show that the family of all partial orders on a finite set is well-graded and therefore defines a partial cube. Let us recall (cf. Definition 3.3) that a partial order R on a set X is an irreflexive and transitive on X; that is, (i) (x,x) ∈/ R, and (ii) (x, y) ∈ R and (y, z) ∈ R implies (x, z) ∈ R, for all x, y, z ∈ X. In this section we assume that X is a given nonempty finite set and denote the set of all partial orders on X by PO. Let Y be a nonempty subset of X. An element y ∈ Y is said to be maximal in Y with respect to a partial order R if there is no element x in Y such that (x, y) ∈ R (cf. Exercise 5.4). Likewise, an element z ∈ Y is a minimal element in Y with respect to R if there is no element x in Y such that (z,x) ∈ R. The following lemma is instrumental. Lemma 5.12. Suppose that a partial order P is a proper subset of a partial order Q. Then there exists (a, b) ∈ Q such that R = P ∪ {(a, b)} is a partial order. Proof. Let us define A = {x ∈ X :(x, y) ∈ Q \ P for some y ∈ X} and let a be a maximal element in A with respect to P . This means that (x,a) ∈ P implies that x∈ / A. Equivalently, (x,a) ∈ P implies (x, y) ∈/ Q \ P , for any y ∈ X. (5.2) Furthermore, we define B = {y ∈ X :(a, y) ∈ Q \ P } and let b be a minimal element in B with respect to P . Then, for z ∈ X, (b, z) ∈ P implies (a, z) ∈/ Q \ P. (5.3) Clearly, (a, b) ∈ Q \ P and R = P ∪ {(a, b)} is an irreflexive relation. Let us show that R is a transitive relation; that is, condition (ii) is satisfied for R. There are three possible cases: 1) (x, y) ∈ P and (y, z) ∈ P . Then, by transitivity of P ,(x, z) ∈ P ⊂ R. 2) (x, y)=(a, b). We need to verify that (a, b) ∈ R, (b, z) ∈ R together imply that (a, z) ∈ R. Clearly, (b, z) ∈ P . By (5.3), (a, z) ∈/ Q \ P . Because Q is a transitive relation, (a, z) ∈ Q. It follows that (a, z) ∈ P ⊂ R. 3) (y, z)=(a, b). As in the previous case we need to show that (x, b) ∈ R, (a, b) ∈ R imply (x, b) ∈ R. Obviously, (x,a) ∈ P . By (5.2), (x, b) ∈/ Q \ P ; that is, (x, b) ∈ P ⊂ R, inasmuch as (x, b) ∈ Q, by transitivity of Q.  5.3 Partial Orders 133

Theorem 5.13. The family PO is well-graded.

Proof. By Theorem 5.9, it suffices to show that |P △ Q| = 1 for any two adjacent elements P and Q of PO. Note that P ∩ Q ∈ PO, for any two elements P,Q ∈ PO (cf. Exercise 5.5). Because P ∩ Q lies between P and Q in PO and P and Q are adjacent in PO, we must have either P ⊆ Q or Q ⊆ P . By Lemma 5.12, P △ Q is a singleton. 

It follows that the graph GPO is a partial cube (cf. Theorem 5.3). This graph is depicted in Figure 5.3 for X = {a,b,c}. The central vertex represents the empty partial order; x < y stands for (y,x). For instance, the vertex labeled b

b

b

b

b

a

a

a

a

a

Figure 5.3. The graph of the family of partial orders on X = {a, b, c}.

A linear order on a set X is a complete partial order R on X; that is, it satisfies the completeness condition:

(x, y) ∈ R or (y,x) ∈ R for all x 6= y in X.

Linear orders are represented by the vertices of the “big hexagon” in Fig- ure 5.3. The graph in Figure 5.3 is the Hasse diagram of the set of partial orders on X = {a,b,c} ordered by the inclusion relation. Clearly, linear orders are 134 5 Partial Cubes maximal elements of this ordered set. In fact, this is true for any set X as the following argument demonstrates. For a given partial order P on an arbitrary set X, we define the corre- sponding reflexive partial order P ′ by

(x, y) ∈ P ′ if and only if (x, y) ∈ P or x = y, for all x, y ∈ X. It is easy to see that P ′ is transitive. Suppose that P is not a complete binary relation. Then there are two distinct elements a, b ∈ X such that (a, b) ∈/ P and (b,a) ∈/ P . Let us define a binary relation R on X by

(x, y) ∈ R if and only if (x, y) ∈ P or [(x,a) ∈ P ′ and (b, y) ∈ P ′], for all x, y ∈ X, and show that this relation is a partial order on X properly containing P . Note that (a, b) ∈ R. It is clear that R is irreflexive. (a, b) ∈ R and (a, b) ∈/ P , therefore we have P ⊂ R. Thus it suffices to establish the transitivity property of R. Suppose that (x, y) ∈ R and (y, z) ∈ R for some x, y, z ∈ X. There are four possible cases: (1) (x, y) ∈ P and (y, z) ∈ P . Then (x, z) ∈ P ⊂ R, by transitivity of P . (2) (x, y) ∈ P , (y,a) ∈ P ′, and (b, z) ∈ P ′. Then (x,a) ∈ P ′, by transitivity of P ′. Hence, (x, z) ∈ R. (3) (x,a) ∈ P ′, (b, y) ∈ P ′, and (y, z) ∈ P . Then (b, z) ∈ P ′, by transitivity of P ′. Therefore, (x, z) ∈ R. (4) (x,a) ∈ P ′, (b, y) ∈ P ′, and (y,a) ∈ P ′, (b, z) ∈ P ′. By transitivity of P ′, (b, y) ∈ P ′, (y,a) ∈ P ′ implies (b,a) ∈ P ′, contradicting our assumption that a and b are distinct elements of X with (b,a) ∈/ P . It follows that (x, y) ∈ R,(y, z) ∈ R implies (x, z) ∈ R for all x, y, z ∈ X; that is, R is transitive. We proved that a partial order which is not a linear order is properly contained in another partial order. Assuming that X is a finite set, we immediately obtain the following result. Theorem 5.14. A partial order on a finite set X is contained in a linear order. Equivalently, linear orders are the maximal elements of the poset PO. Actually, the claim of the theorem also holds for infinite sets; see Notes at the end of the chapter.

5.4 Hereditary Structures

Let H be an isometric subgraph of a connected graph G. Then, by definition, we have dH(u,v)= dG(u,v), for u,v ∈ V (H). Graph concepts that are defined in terms of the distance function on G are naturally inherited by the isometric subgraph H. In this section we apply this 5.4 Hereditary Structures 135 general observation to the notions of interval, semicube, the theta relation, and convexity. We use subscripts and superscripts H and G to distinguish subsets and relations on graphs H and G, respectively. By the definition of an interval in a graph, we have

IH (u,v)= {w ∈ V (H): dH (u,w)+ dH(w,v)= dH(u,v)}

= {w ∈ V (G): dG(u,w)+ dG(w,v)= dG(u,v)}∩ V (H)

= IG(u,v) ∩ V (H).

In words, the intervals in H are intersections of intervals in G with the vertex set V (H). Likewise,

H Wab = {x ∈ V (H): dH(x,a) < dH(x, b)} = {x ∈ V (G): dG(x,a) < dG(x, b)}∩ V (H) G = Wab ∩ V (H), so the semicubes of H are intersections of semicubes of G with V (H). Fur- thermore,

ΘH = {(xy, uv) ∈ E(H) × E(H): dH (x, u)+ dH(y,v) 6= dH(x,v)+ dH (y, u)} and

ΘG = {(xy, uv) ∈ E(G) × E(G): dG(x, u)+ dG(y,v) 6= dG(x,v)+ dG(y, u)}.

It is clear that ΘH =ΘG ∩ (E(H) × E(H)), so the relation ΘH is the restric- tion of ΘG to the edge set E(H). We summarize these results in the following theorem. Theorem 5.15. Let H be an isometric subgraph of a connected graph G. Then

(i) IH (u,v)= IG(u,v) ∩ V (H). H G (ii) Wab = Wab ∩ V (H). (iii) ΘH =ΘG ∩ (E(H) × E(H)). Let S be a convex subset of a connected graph G and H be an isometric subgraph of G. By Theorem 5.15(i), for any two vertices u,v ∈ S ∩ V (H), we have IH (u,v)= IG(u,v) ∩ V (H) ⊆ S ∩ V (H). This proves the next theorem. Theorem 5.16. The intersection of a convex subset of the vertex set V (G) of a graph G with the vertex set V (H) of an isometric subgraph H of G is a convex subset of V (H). We now apply the above results to establish two crucial properties of partial cubes. 136 5 Partial Cubes

Theorem 5.17. Let G be a partial cube. Then (i) The semicubes of G are convex subsets of the vertex set V (G). (ii) θ =Θ is an equivalence relation on E(G). Proof. By Theorem 2.22, θ = Θ, and by Theorem 2.25, conditions (i) and (ii) are equivalent. Therefore it suffices to prove (ii). We may assume that G is an isometric subgraph of a cube H(X). By Theo- rem 3.28, ΘH(X) is an equivalence relation on E(H(X)). By Theorem 5.15(iii), Θ=ΘG is an equivalence relation on E(G). This proves (ii). 

Furthermore, by combining the results of Theorems 5.15(ii) and 3.27, we obtain the following useful description of semicubes of a partial cube. Theorem 5.18. Let A and B be two adjacent vertices of a partial cube G on a set X with A △ B = {x}, x ∈ X. We may assume that A = B ∪ {x}. Then

WAB = {R ∈ V (G): x ∈ R} and WBA = {R ∈ V (G): x∈ / R}.

5.5 Characterizations

The theta relations and fundamental sets associated with a given graph were our main tools in analyzing structural properties of bipartite graphs and char- acterizing them in Section 2.3. These structures play a central role in this section. Here we present the key results of this chapter, characterizations of partial cubes. We say that a semicube Wab separates two distinct vertices x and y of a graph G if either x ∈ Wab, y ∈ Wba or x ∈ Wba, y ∈ Wab. In particular, both Wab and Wba separate a and b. By Theorem 2.18, each pair of opposite semicubes {Wab, Wba} in a bipar- tite graph G forms a partition of the vertex set V (G). We orient this partition by calling, in an arbitrary way, one of the two opposite semicubes in each partition a positive semicube. Theorem 5.19. Let G be a connected graph. The following statements are equivalent: (i) G is a partial cube. (ii) G is bipartite and all semicubes of G are convex. (iii) G is bipartite and θ is an equivalence relation on E(G). Proof. By Theorem 5.17, condition (i) implies conditions (ii) and (iii). Con- ditions (ii) and (iii) are equivalent by Theorem 2.25. Thus it suffices to prove that (ii) implies (i). Let us assign to each vertex x of G the set W+(x) of all positive semicubes containing x. In the next two paragraphs we show that x 7→ W+(x) is an + isometry from V (G) onto the well-graded family F = {W (x)}x∈V (G). 5.5 Characterizations 137

Let x and y be two distinct vertices of G and let P be a shortest path connecting x to y. By Theorem 2.12, no two distinct edges of P stand in relation θ (recall that θ = Θ for bipartite graphs). The semicubes of G are assumed to be convex, thus it follows from Theorem 2.24 that distinct edges of P define distinct positive semicubes. By the same Theorem 2.24, each edge e of P defines a unique positive semicube separating ends of e. Clearly, this semicube also separates vertices x and y. On the other hand, any positive semicube separating x and y separates ends of some edge of P . Thus we have one-to-one correspondence between edges of the path P and positive semicubes separating its ends. It is clear that a positive semicube separates vertices x and y if and only if it belongs to W+(x) △ W+(y). Therefore,

d(x, y)= |W+(x) △ W+(y)|; (5.4) that is, x 7→ W+(x) is an isometry from V (G) onto F. + + For two distinct sets W (x), W (y) in F, let x = x0,x1,...,xn = y be a shortest xy-path in G. By (5.4),

+ + + + |W (xi) △ W (xi+1)| =1 and |W (x0) △ W (xn)| = n.

Hence, F is a wg-family. By Theorem 5.3, the graph GF is an isometric subgraph of some Cartesian power of K2. Therefore, by Theorem 3.9, GF is a partial cube. Clearly, graphs G and GF are isomorphic. Hence, G is a partial cube. 

Example 5.20. It was shown in Section 5.1 that the cubical graph G in Fig- ure 5.1a is not a partial cube. This also follows immediately from Theo- rem 5.19. Indeed, the semicube Wsw = {s,u,v,x} is not a convex set be- cause vertices z and y lie between x and v but do not belong to Wsw. By using another equivalence from Theorem 5.19, we note that (xz, sw) ∈ Θ and (sw, vy) ∈ Θ, but (xz,vy) ∈/ Θ. Thus, Θ is not an equivalence relation, so G is not a partial cube.

Example 5.21. Semicubes of a finite path are initial and terminal segments of the path. They are clearly convex. This is also true for both rays. Therefore, all paths are partial cubes.

Example 5.22. It can be easily seen that semicubes of a cycle are convex sets. However, only even cycles are bipartite. By Theorem 5.19, even cycles are partial cubes.

Example 5.23. By Theorem 2.33, a graph G is a if and only if Θ is the identity relation on the edge set of G. By Theorem 5.19, trees are partial cubes. Note also that by Theorem 2.29 and Corollary 2.35, semicubes of a tree are convex sets (cf. Exercise 5.6). 138 5 Partial Cubes

W ba b

Wab Wba a a b Wab

Figure 5.4. Semicubes in the (5 × 4)-grid.

Example 5.24. Typical semicubes in a 2-dimensional grid are depicted in Fig- ure 5.4 for the grid P5  P4. It is clear that all semicubes of this grid are convex (cf. Exercise 5.7). By Theorem 5.19, P5  P4 is a partial cube.

Theorem 5.25. Let G be a connected graph. The following statements are equivalent. (i) G is a partial cube. (ii) G is bipartite and, for all xy, uv ∈ E(G),

(xy, uv) ∈ θ implies {Wxy, Wyx} = {Wuv, Wvu}.

(iii) G is bipartite and, for any pair of adjacent vertices of G, there is a unique pair of opposite semicubes separating these two vertices.

Proof. (i) ⇒ (ii). This implication follows from Theorems 5.19 and 2.24. (ii) ⇒ (i). By (ii) and Theorem 2.23,

(xy, uv) ∈ θ if and only if {Wxy, Wyx} = {Wuv, Wvu}.

Therefore, θ is an equivalence relation. By Theorem 5.19, G is a partial cube. (ii) ⇒ (iii). Suppose that semicubes Wxy,Wyx and Wuv, Wvu separate ends of an edge ab. Then (ab, xy) ∈ θ and (ab, uv) ∈ θ. By condition (ii),

{Wxy, Wyx} = {Wab, Wba} = {Wuv, Wvu}.

(iii) ⇒ (ii). If (xy, uv) ∈ θ, then semicubes Wxy,Wyx separate vertices u and v. Clearly, semicubes Wuv, Wvu also separate u and v. By condition (iii), {Wxy, Wyx} = {Wuv, Wvu}. 

Theorem 5.26. Let G be a connected graph. The following statements are equivalent. (i) G is a partial cube. (ii) G is bipartite and

d(x, u)= d(y,v), d(x,v)= d(y, u), (5.5)

for any edges ab ∈ E(G) and xy, uv ∈ Fab. 5.5 Characterizations 139

Proof. (i) ⇒ (ii). Because θ = Θ and xy, uv ∈ Fab, we have (xy, ab) ∈ Θ and (uv, ab) ∈ Θ. Therefore, (xy, uv) ∈ Θ, by the transitivity property of the relation Θ (cf. Theorem 5.19). By Theorem 2.14, we have equations (5.5). (ii) ⇒ (i). Suppose that G is not a partial cube. Then, by Theorem 5.19, there is an edge ab such that the semicube Wba is not convex. Therefore there are vertices p, q ∈ Wba such that there is a shortest pq-path that intersects the semicube Wab. Let vu be the first edge of P that belongs to Fab and xy be the last edge of P with the same property (cf. Figure 5.5). The vy-segment of P is a shortest path in G, therefore we have d(v, y)= d(v, u)+ d(u,x)+ d(x, y) 6= d(u,x), which contradicts (5.5). It follows that all semicubes of G are convex. By Theorem 5.19, G is a partial cube. 

F u ab v p

x y q

Wab a b Wba

Figure 5.5. Proof of Theorem 5.26.

One can say that four vertices satisfying conditions (5.5) define a “rect- angle” in G (the “opposite” sides and the two “diagonals” are equal). Then Theorem 5.26 states that a connected graph is a partial cube if and only if it is bipartite and for any edge ab, pairs of edges in Fab define rectangles in the graph G (see the drawing in Figure 5.6).

b

Fab a

Figure 5.6. A rectangle in the (7 × 4)-grid.

Cubical graphs were characterized in Section 4.2 in terms of specific edge- colourings called c-valuations. We give a similar criterion for a connected graph to be a partial cube. Theorem 5.27. A connected graph G = (V, E) is a partial cube if and only if there is a colouring E → X such that 140 5 Partial Cubes

(i) Edges of any shortest path in G are of different colours. (ii) In each closed walk in G, every colour appears an even number of times.

Proof. (Necessity.) We may assume that G = GF where F is a wg-family of finite subsets of a set X. For any edge ST of G there is a unique element x ∈ X such that {x} = S △ T . We prove below that the function ST 7→ x defines a required edge-colouring of G. (i) Let P = R0, R1,...,Rn = Q be a shortest PQ-path in G. By Theo- rem 5.8, there is one-to-one correspondence between the edges of this path and the elements of P △ Q. Thus all edges of the path are of different colours. (ii) Let W = R0, R1,...,Rn = R0 be a closed walk in G. If a colour x does not appear in W , we are done. Thus we assume that x occurs in W . Let RiRi+1 be the first edge of W coloured by x ∈ R0. Because x ∈ R0, we must have x ∈ Ri, x∈ / Ri+1. Because W is closed and x ∈ R0, x∈ / Ri+1, there must be another occurrence of x in W . Let RjRj+1 be the first edge after RiRi+1 coloured by x. Because x∈ / Ri+1, we must have x ∈ Rj, x∈ / Rj+1. By repeating this argument, we partition the occurrences of x in W into pairs, so the total number of these occurrences is even. Essentially the same argument shows that the colour x∈ / R0 also appears an even number of times in W . (Sufficiency.) Let E → X be a colouring satisfying conditions (i) and (ii), and let v0 be a fixed vertex of G. For a vertex v of G and a shortest v0v-path P in G, we define

Xv = {x ∈ X : x is a colour of an edge of P } ∅ and set Xv0 = . This set is well defined. Indeed, let Q be another shortest −1 v0v-path. Then PQ is a closed walk. By conditions (i) and (ii), the set Xv does not depend on the choice of P . Let us show that the function ϕ : v 7→ Xv is an isometric embedding of G into the cube H(X). For v, u ∈ V , let P and R be shortest paths from v0 to v and u, respectively, and let Q be a shortest vu-path in G. By condition −1 (ii) applied to the closed walk P QR and condition (i), x ∈ Xv △ Xu if and only if x is a colour of an edge of Q. Hence, d(v, u) = |Xv △ Xu|, so ϕ is an isometric embedding. 

Let us denote by E~ : {(u,v) : uv ∈ E} the set of all arcs of a graph G =(V, E), and define the binary relation L on E~ by

(u,v) L (x, y) if and only if d(u, y)= d(v,x)= d(u,x)+1= d(v, y) + 1.

The relation L is clearly reflexive and symmetric. Moreover, we have

(u,v) L (x, y) if and only if (v, u) L (y,x), (5.6) for all uv, xy ∈ E. The relation L and the theta relation Θ are closely related concepts as the following lemma asserts. 5.5 Characterizations 141

Lemma 5.28. Let {u,v} and {x, y} be two pairs of adjacent vertices of a connected graph G. Then

(u,v) L (x, y) implies uv Θ xy.

If, in addition, the graph G is bipartite, then

uv Θ xy implies [(u,v) L (x, y) or (u,v) L (y,x)].

Proof. The first implication follows immediately from the definition of L , because

d(u, y)+ d(v,x)= d(u,x)+1+ d(v, y) + 1 6= d(u,x)+ d(v, y).

The second implication is the result of Theorem 2.14. 

Lemma 5.29. If G is a partial cube, then

(u,v) L (x, y) if and only if Wuv = Wxy.

Proof. (Necessity.) By Lemma 5.28(i), (u,v) L (x, y) implies uv Θ xy, which in turn implies {Wuv, Wvu} = {Wxy, Wyx}, by Theorem 5.25. Because (u,v) L (x, y), we have d(v,x) = d(u,x) + 1, which implies x ∈ Wuv. Hence, Wuv = Wxy. (Sufficiency.) If Wuv = Wxy, then Wvu = Wyx and

x ∈ Wuv, y ∈ Wvu, u ∈ Wxy, v ∈ Wyx.

Therefore, by Lemma 2.19,

d(u, y)= d(v,x)= d(u,x)+1= d(v, y) + 1, that is, (u,v) L (x, y) (see Figure 5.7). 

u v

Wuv = Wxy Wvu = Wyx x y

Figure 5.7. Proof of Lemma 5.29.

Theorem 5.30. Let G = (V, E) be a connected graph. The following state- ments are equivalent. 142 5 Partial Cubes

(i) G is a partial cube. (ii) G is bipartite and L is an equivalence relation on E~ .

Proof. (i) ⇒ (ii). Let G be a partial cube. It suffices to prove that L is tran- sitive. Suppose that (u,v) L (x, y) and (x, y) L (w, z). Then, by Lemma 5.29, Wuv = Wxy = Wwz. By the same lemma, (u,v) L (w, z), so L is transitive. (ii) ⇒ (i). By Theorem 5.19, it suffices to prove that Θ is a transitive relation on E. Suppose that uv Θ xy and xy Θ wz. By Lemma 5.28,

[(u,v) L (x, y)or(u,v) L (y,x)] and [(x, y) L (w, z)or (x, y) L (z,w)].

There are four possibilities: 1) (u,v) L (x, y) and (x, y) L (w, z). Then, by transitivity of L , we have (u,v) L (w, z), which implies uv Θ wz, by Lemma 5.28. 2) (u,v) L (x, y) and (x, y) L (z,w). Then, as in the previous case, uv Θ zw. Hence, uv Θ wz. 3) (u,v) L (y,x) and (x, y) L (w, z). By (5.6), (y,x) L (z,w). By transitivity of L , we have (u,v) L (z,w), which implies uv Θ wz, by Lemma 5.28. 4) (u,v) L (y,x) and (x, y) L (z,w). The argument from the previous case shows that we again have uv Θ wz. Thus in all four cases we have uv Θ wz, so Θ is transitive. 

5.6 Isometric Dimension

There are usually many ways in which a given partial cube can be isometri- cally embedded into a cube. For instance, the graph K2 can be isometrically embedded in different ways into any cube H(X) with |X| > 2. If a partial cube G is isometrically embeddable into a cube H(X), then it is also isometrically embeddable into any cube H(Y ) with |Y |≥|X| (see The- orem 3.34 and discussion thereafter). Hence there is a cube of the minimum dimension in which G is isometrically embeddable.

Definition 5.31. The isometric dimension dimI (G) of a partial cube G is the minimum dimension of a cube in which G is isometrically embeddable.

It is clear that

dimI (H(X)) = dim(H(X)) = |X| and that dimc(G) ≤ dimI (G), where dimc(G) is the cubical dimension of G (see Section 4.1). 5.6 Isometric Dimension 143

Example 5.32. The isometric and cubical dimensions of the n-dimensional cube are equal: dimI (Qn) = dimc(Qn)= n. On the other hand, it is easy to see that

dimc(P4) = 2 < 3 = dimI (P4), for the path P4. By Theorem 3.28, the set of equivalence classes of the relation θ on the edge set E of a cube H(X) is in one-to-one correspondence with the set X. Therefore, dimI (H(X)) = |E/θ |. The main purpose of this section is to show that this result holds for arbitrary partial cubes. Let G = (V, E) be a partial cube on a set X. By Theorems 2.22 and 5.15(iii), the equivalence relation θ on E is the restriction of the equiva- lence relation ΘH(X) to the set E. Therefore, the equivalence classes of θ are nonempty intersections of the equivalence classes of ΘH(X) with the set E. By Theorem 3.28, |E/θ |≤|X| = dim(H(X)). Clearly, the above inequality holds for any partial cube G =(V, E) that is isometrically embeddable into H(X). Accordingly, |E/θ |≤ dimI (G). To prove that dimI (G)= |E/θ |, it suffices now to construct a set X such that G is isometrically embeddable into H(X) and |E/θ | = |X|. Let F be a family of finite subsets of a set X. The retract of F is the family F′ of intersections of the sets in F with the set X′ = ∪ F \∩ F. Note that F′ satisfies conditions ∩ F′ = ∅ and ∪ F′ = X′ , (5.7) and that any family of sets satisfying these conditions is a retract of itself. It is clear that α : P 7→ P ∩ X′ where P ∈ F is a mapping from F onto F′. For R, S ∈ F, we have

α(R) △ α(S)=(R ∩ X′) △ (S ∩ X′)=(R △ S) ∩ X′ = R △ S.

′ Therefore, α : F → F is an isometry. It follows that the graphs GF and GF′ are isomorphic. As a special case, we obtain the following result.

Theorem 5.33. Partial cubes induced by a wg-family F and its retract F′ are isomorphic.

By Theorems 5.3 and 5.33, any partial cube G =(V, E) is isomorphic to the partial cube GF induced by a wg-family F satisfying conditions (5.7) for some set X. Let PQ be an edge of the cube H(X) with P △Q = {x}. By (5.7), there are sets S and T in F such that x ∈ S and x∈ / T . Because F is well-graded, 144 5 Partial Cubes there is a sequence of sets R0 = S, R1,...,Rn = T satisfying conditions (5.1). Clearly, there is i such that x ∈ Ri and x∈ / Ri+1, so Ri △ Ri+1 = {x} (cf. Theorem 5.8). By Theorem 3.28, the edge RiRi+1 of GF is in relation ΘH(X) to the edge PQ. It follows that the set of equivalence classes of the relation θ on the edge set of GF is in one-to-one correspondence with the set of equivalence classes of ΘH(X). By Theorem 3.28, the cardinality of the latter set is |X|. Hence, |E/θ | = |X|. In summary, we have the following theorem. Theorem 5.34. (i) Let G =(V, E) be a partial cube. Then

dimI (G)= |E/θ |, where E/θ is the set of equivalence classes of the relation θ. (ii) Let GF be a partial cube induced by a wg-family F of finite subsets of a set X satisfying conditions (5.7). Then

dimI (GF)= |X|.

Example 5.35. Let T = (V, E) be a finite tree. By Theorem 2.33, θ is the identity relation on E. Hence, by Theorem 5.19, T is a partial cube and the isometric dimension of T is |V |. In particular, the isometric dimension of the path Pn is n − 1. Let us recall (see Section 4.1) that the cubical dimension of Pn is ⌈log2 n⌉. Therefore, dimc(Pn) < dimI (Pn) for n> 3 (cf. Exercise 5.9).

Example 5.36. The relation Θ on the edge set of an even cycle C2n is an equivalence relation with equivalence classes consisting of pairs of “opposite” edges of C2n (cf. Exercise 5.10). Therefore, C2n is a partial cube of isometric dimension n.

5.7 Cartesian Products of Partial Cubes

Let {(Gi,ai)}i∈I and {(Hi, bi)}i∈I be two families of connected rooted graphs. For each i ∈ I, let ϕi be an embedding Gi → Hi such that ϕi(ai) = bi. For the family ϕ = {ϕi}i∈I , we define

ϕ(u)= {ϕi(ui)}i∈I , for every u ∈ (G,a).

We want to show that ϕ is an embedding of the weak Cartesian product

(G,a)= i∈I (Gi,ai) into the weak Cartesian product (H, b)= i∈I (Hi, bi). For u ∈ (G,a), there is a finite subset J of I such that ui = ai for i ∈ I \ J. Q Q Hence, ϕi(ui)= bi for i ∈ I \J, which implies that ϕ is a well-defined mapping of the vertex set of (G,a) into the vertex set of (H, b). Clearly, ϕ is one-to-one. Furthermore, for an edge uv of (G,a), there is k ∈ I such that ukvk is an edge of (Gk,ak) and ui = vi for i 6= k. Because ϕk is an embedding, ϕ(u)ϕ(v) is an edge of (H, b). Therefore, ϕ is indeed an embedding of (G,a) into (H, b). 5.7 Cartesian Products of Partial Cubes 145

Suppose now that all embeddings in the family ϕ are isometric. Then (cf. Exercise 3.20)

dH(ϕ(u), ϕ(v)) = dHi (ϕi(ui), ϕi(vi)) = dGi (ui,vi)= dG(u,v). i I i I X∈ X∈ for all vertices u, v of the graph (G,a). It follows that ϕ is an isometric embedding of (G,a) into (H, b). A weak Cartesian product of cubes is a cube (cf. Theorem 3.18), thus we have the following result.

Theorem 5.37. A weak Cartesian product of a family of partial cubes is a partial cube.

Example 5.38. Paths are partial cubes, therefore finite Cartesian products of these graphs (grids) are partial cubes. For instance, the (m × n × q)-grid Pm  Pn  Pq is a partial cube.

Example 5.39. By Theorem 5.37, the Cartesian power Zn (n-dimensional in- teger lattice) of the double ray Z is a partial cube.

n Theorem 5.40. Let G = i=1 Gi be the Cartesian product of a family {Gi}1≤i≤n of finite partial cubes. Then Q n dimI (G)= dimI (Gi). i X=1

Proof. We may assume that Gi = GFi , where Fi is a wg-family of subsets of a finite set Xi such that ∩ Fi = ∅, ∪ Fi = Xi, and the sets Xi are pairwise disjoint (cf. Section 5.6). By Theorem 5.34(ii), dimI (Gi)= |Xi|. n n Let F be the family of subsets of X = ∪i=1Xi in the form ∪i=1Ri, where n (R1,...,Rn) is a vertex of G. Clearly, the mapping (R1,...,Rn) 7→ ∪i=1Ri is a bijection from the vertex set of G onto the family F. It is also clear that two vertices are adjacent in G if and only if the corresponding subsets of X are adjacent in GF. Therefore the graphs G and GF are isomorphic. By Theorem 5.34(ii), dimI (G) = |X|, because ∩ F = ∅ and ∪ F = X (cf. Exer- cise 5.16). Because the sets Xi are pairwise disjoint, we have

n n dimI (G)= |X| = |Xi| = dimI (Gi). i i X=1 X=1 The result follows.  146 5 Partial Cubes 5.8 Pasting Together Partial Cubes

Properties of vertex- and edge-pasting operations on cubical graphs were in- vestigated in Section 4.5. In this section we apply these operations to partial cubes. In what follows we use superscripts to distinguish subgraphs of two graphs (2) G1 and G2. For instance, Wab stands for the semicube of G2 defined by two adjacent vertices a, b ∈ V2.

Theorem 5.41. A graph G = (V, E) obtained by vertex-pasting together partial cubes G1 =(V1, E1) and G2 =(V2, E2) is a partial cube.

Proof. (Cf. proof of Theorem 4.18.) Let a = {a1,a2} be the vertex of G obtained by identifying vertices a1 ∈ V1 and a2 ∈ V2. Clearly, G is a . Let xy be an edge of G. Without loss of generality we may assume that xy ∈ E1 and a ∈ Wxy. Note that any path between vertices in V1 and V2 must go through a. Because a ∈ Wxy, we have, for any v ∈ V2,

d(v,x)= d(v,a)+ d(a,x) < d(v,a)+ d(a, y)= d(v, y),

(1) which implies V2 ⊆ Wxy and Wyx ⊆ V1. It follows that Wxy = Wxy ∪ V2 and (1) (1) (1) Wyx = Wyx . The sets Wxy , Wyx and V2 are convex subsets of V . Inasmuch (1) (1) as Wxy ∩V2 = {a}, the set Wxy = Wxy ∪V2 is also convex. By Theorem 5.19, the graph G is a partial cube. 

Theorem 5.42. Let G =(V, E) be a partial cube obtained by vertex-pasting together finite partial cubes G1 =(V1, E1) and G2 =(V2, E2). Then

dimI (G) = dimI (G1) + dimI (G2).

Proof. The isometric dimension of a partial cube is the cardinality of the quotient set of the relation θ, therefore it suffices to prove that there are no edges xy ∈ E1, uv ∈ E2 such that (xy, uv) ∈ θ. Suppose that G1 and G2 are pasted together along vertices a1 ∈ V1 and a2 ∈ V2, and let a = {a1,a2}∈ E. Let xy ∈ E1, uv ∈ E2 be two edges in E. We may assume that u ∈ Wxy. Because a is a cut-vertex of G and u ∈ Wxy, we have

d(u,a)+ d(a,x)= d(u,x) < d(u,a)+ d(a, y).

Hence, d(a,x) < d(a, y), which implies

d(v,x)= d(v,a)+ d(a,x) < d(v,a)+ d(a, y)= d(v, y).

It follows that v ∈ Wxy. Therefore, (xy, uv) ∈/ θ. 

Note that blocks of a partial cube are clearly partial cubes themselves. 5.8 Pasting Together Partial Cubes 147

Corollary 5.43. Let G be a finite partial cube and {G1,...,Gn} be the fam- ily of its blocks. Then

n

dimI (G)= dimI (Gi). i X=1 By Theorem 4.25, the graph G obtained by edge-pasting together two partial cubes G1 and G2 is cubical (and therefore is bipartite). We show that in fact it is a partial cube. The following lemma is instrumental; it describes the semicubes of G in terms of semicubes of graphs G1 and G2.

Lemma 5.44. Let uv be an edge of G. Then (1) (1) (i) For uv ∈ E1, a,b ∈ Wuv implies Wuv = Wuv ∪ V2, Wvu = Wvu . (2) (2) (ii) For uv ∈ E2, a,b ∈ Wuv implies Wuv = Wuv ∪ V1, Wvu = Wvu . (iii) a ∈ Wuv, b ∈ Wvu implies Wuv = Wab.

u a w

v b

G1 G2

Figure 5.8. Proof of Lemma 5.44.

Proof. We prove parts (i) and (iii) (cf. Figure 5.8); proof of (ii) is left to the reader (cf. Exercise 5.17). (i) Any path from w ∈ V2 to u or v contains a or b and a, b ∈ Wuv, thus (1) (1) we have w ∈ Wuv. Hence, Wuv = Wuv ∪ V2 and Wvu = Wvu . θ (1) (1) (iii) (ab, uv) ∈ in G1, thus we have Wuv = Wab , by Theorem 5.25(ii). (2) Let w be a vertex in Wuv . Then, by the triangle inequality,

d(w, u) < d(w,v) ≤ d(w, b)+ d(b,v) < d(w, b)+ d(b, u).

Any shortest path from w to u contains a or b, therefore we have

d(w,a)+ d(a, u)= d(w, u).

Hence, d(w,a)+ d(a, u) < d(w, b)+ d(b, u).

Inasmuch as (ab, uv) ∈ θ in G1, we have d(a, u)= d(b,v), by Theorem 5.26(ii). (2) (2) It follows that d(w,a) < d(w, b); that is, w ∈ Wab . We proved that Wuv ⊆ 148 5 Partial Cubes

(2) (2) (2) Wab . By symmetry, Wvu ⊆ Wba . Because two opposite semicubes form a (2) (2)  partition of V2, we have Wuv = Wab . The result follows.

Theorem 5.45. A graph G obtained by edge-pasting together partial cubes G1 and G2 is a partial cube.

Proof. By Theorem 5.19(ii), we need to show that for any edge uv of G the semicube Wuv is a convex subset of V . There are two possible cases. (1) (2) (i) uv = ab. The semicube Wab is the union of semicubes Wab and Wab that are convex subsets of V1 and V2, respectively. It is clear that any shortest (1) (2) path connecting a vertex in Wab with a vertex in Wab contains vertex a and therefore is contained in Wab. Hence, Wab is a convex set. A similar argument proves that the set Wba is convex. (ii) uv 6= ab. We may assume that uv ∈ E1. To prove that the semicube Wuv is a convex set, we consider two cases. (a) a, b ∈ Wuv. (The case when a, b ∈ Wvu is treated similarly.) By (1) Lemma 5.44(i), the semicube Wuv is the union of the semicube Wuv and the set V2 which are both convex sets. Any shortest path P from a vertex in V2 to (1) (1) a vertex in Wuv contains either a or b. It follows that P ⊆ Wuv ∪ V2 = Wuv. Therefore the semicube Wuv is convex. (b) a ∈ Wuv, b ∈ Wvu. (The case when b ∈ Wuv, a ∈ Wvu is treated similarly.) By Lemma 5.44(ii), Wuv = Wab. The result follows from part (i) of the proof. 

Theorem 5.46. Let G be a graph obtained by edge-pasting together finite partial cubes G1 and G2. Then

dimI (G) = dimI (G1) + dimI (G2) − 1.

Proof. Let θ, θ1, and θ2 be the theta relations on E, E1, and E2, respectively. By Lemma 5.44, for uv, xy ∈ Ei (i ∈ {1, 2}) we have

(uv, xy) ∈ θ if and only if (uv, xy) ∈ θi.

Let uv ∈ E1, xy ∈ E2, and (uv, xy) ∈ θ. Suppose that (uv, ab) ∈/ θ. We may assume that a, b ∈ Wuv. By Lemma 5.44(i), V2 ⊂ Wuv, a contradiction, inasmuch as xy ∈ E2. Hence, uv θ xy θ ab. It follows that each equivalence class of the relation θ is either an equivalence class of θ1, an equivalence class of θ2, or the class containing the edge ab. Therefore

|E/θ| = |E1/θ1| + |E2/θ2|− 1.

The result follows from Theorem 5.34(i).  5.9 Expansions and Contractions of Partial Cubes 149

In conclusion, we outline another proof of Theorem 5.45 given in terms of wg-families. Let X1 and X2 be two sets such that their intersection X1 ∩ X2 is a singleton {z}, and let F1 and F2 be wg-families of finite subsets of X1 and X2, respectively, both containing the empty set ∅ and the set {z} (cf. proof of Theorem 4.25). We want to show that the family F = F1 ∪ F2 is well-graded. Let P and Q be distinct sets in F. If P,Q ∈ F1 or P,Q ∈ F2, then there is a sequence (Ri) satisfying conditions (5.1), for the families F1 and F2 are well-graded. Suppose now that, say, P ∈ F1 and Q ∈ F2. Let us consider two possible cases: (i) P ∩ Q = ∅. The families F1 and F2 are well-graded, therefore there are two sequences of sets satisfying conditions (5.1) connecting P to ∅ in F1 and ∅ to Q in F2. The lengths of these sequences are |P | and |Q|, respectively. By concatenating these sequences at ∅, we obtain a sequence of sets in F satisfying conditions (5.1), because d(P,Q)= |P △ Q| = |P | + |Q|. (ii) P ∩ Q = {z}. As in the previous case, there are two sequences of sets satisfying conditions (5.1) connecting P to {z} in F1 and {z} to Q in F2. The lengths of these sequences are |P |− 1 and |Q|− 1, respectively. By concate- nating these sequences at {z}, we obtain a sequence of sets in F satisfying conditions (5.1), because d(P,Q)= |P △ Q| = |P | + |Q|− 2. It follows that the graph GF is a partial cube. This graph is obtained by edge-pasting together the partial cubes GF1 and GF2 along the edges with ends ∅ and {z}. A similar argument can be used to prove all other statements in this section (cf. Exercise 5.18).

5.9 Expansions and Contractions of Partial Cubes

In this section we investigate properties of (isometric) expansion and contrac- tion operations on graphs and, in particular, prove in two different ways that a graph is a partial cube if and only if it can be obtained from the trivial graph K1 by a sequence of expansions. A remark about notations is in order. In the product {1, 2}× (V1 ∪ V2), ′ i we denote Vi = {i}× Vi and x = (i, x) for x ∈ Vi, where i ∈ {1, 2}. Let us also recall that the disjoint union operation is denoted by + .

Definition 5.47. Let G =(V, E) be a connected graph, and let G1 =(V1, E1) and G2 = (V2, E2) be two isometric subgraphs of G such that G = G1 ∪ G2. ′ ′ ′ The expansion of G with respect to G1 and G2 is the graph G = (V , E ) constructed as follows from G (see Figure 5.9). ′ ′ ′ (i) V = V1 + V2 = V1 ∪ V2 . ′ 1 2 (ii) E = E1 + E2 + M, where M is the matching x∈V1∩V2 {x x }. In this case, we also say that G is a contraction ofSG′. 150 5 Partial Cubes

contraction

‘ v v 2 V2

1 2 V2 x x x

… V1 V2

u u 1

V1 ‘ V1

1 2 expansion

Figure 5.9. Expansion/contraction processes.

′ Example 5.48. Suppose that G1 = G2 = G. It is clear that G = G  K2. By repeatedly applying repeatedly the expansion operation to the trivial graph K1, we obtain the finite cubes Q1 = K2, Q2,Q3,....

The following two examples give geometric illustrations for the expansion and contraction procedures.

Example 5.49. Let a and b be two opposite vertices of the graph G = C4. Clearly, the two distinct paths P1 and P2 from a to b are isometric subgraphs ′ of G defining an expansion G = C6 of G (see Figure 5.10).

a2 a a 1 a 2 expansion P P b2 1 2 a1

P contraction b 1 b 2 1 b expansion P2 b1

Figure 5.10. An expansion of the cycle C4.

Example 5.50. Another isometric expansion of the graph G = C4 is shown in Figure 5.11. Here, the path P1 is the same as in Example 5.49 and G2 = G.

We define a projection p : V ′ → V by p(xi) = x for x ∈ V . Clearly, the ′ ′ ′ restriction of p to V1 is a bijection p1 : V1 → V1 and its restriction to V2 is ′ ′ ′ a bijection p2 : V2 → V2. These bijections define isomorphisms G [V1 ] → G1 ′ ′ and G [V2] → G2. 5.9 Expansions and Contractions of Partial Cubes 151

expansion P1

P1 contraction

expansion

Figure 5.11. Another isometric expansion of the cycle C4.

Let P ′ be a path in G′. The vertices of G obtained from the vertices in P ′ under the projection p define a walk P in G; we call this walk P the projection of the path P ′. It is clear that

′ ′ ′ ′ ′ ′ ′ ℓ(P )= ℓ(P ), if P ⊆ G [V1] or P ⊆ G [V2 ], (5.8) where ℓ(P ) stands for the length of the path P . In this case, P is a path in G ′ ′ and either P = p1(P ) or P = p2(P ). On the other hand, ′ ′ ′ ′ ∅ ′ ′ ′ ∅ ℓ(P ) <ℓ(P ), if P ∩ G [V1 ] 6= and P ∩ G [V2] 6= (5.9) and P is not necessarily a path. We frequently use the results of the next lemma in this section.

1 1 ′ ′ Lemma 5.51. (i) For u ,v ∈ V1 , any shortest path Pu1v1 in G belongs to ′ ′ G [V1] and its projection Puv = p1(Pu1v1) is a shortest path in G. Accordingly,

1 1 dG′ (u ,v )= dG(u,v)

′ ′ ′ and G [V1 ] is a convex subgraph of G . A similar statement holds for vertices 2 2 ′ u ,v ∈ V2 . 1 ′ 2 ′ (ii) For u ∈ V1 and v ∈ V2 ,

1 2 dG′ (u ,v )= dG(u,v) + 1.

′ 1 2 Let Pu1v2 be a shortest path in G . There is a unique edge x x ∈ M such 1 2 that x ,x ∈ Pu1v2 and the segments Pu1x1 and Px2v2 of the path Pu1v2 are ′ ′ ′ ′ 1 2 shortest paths in G [V1] and G [V2], respectively. The projection Puv of Pu v in G′ is a shortest path in G.

′ ′ Proof. (i) Let Pu1v1 be a path in G that intersects V2 . Because G[V1] is an isometric subgraph of G, there is a path Puv in G that belongs to G[V1]. Then −1 ′ ′ p1 (Puv) is a path in G [V1 ] of the same length as Puv. By (5.8) and (5.9),

−1 1 1 ℓ(p1 (Puv)) <ℓ(Pu v ).

′ ′ ′ Therefore any shortest path Pu1v1 in G belongs to G [V1 ]. The result follows. ′ (ii) Let Pu1v2 be a shortest path in G and Puv be its projection to V . By (5.9), 1 2 dG′ (u ,v )= ℓ(Pu1v2 ) >ℓ(Puv) ≥ dG(u,v). 152 5 Partial Cubes

Inasmuch as there is no edge of G joining vertices in V1 \ V2 and V2 \ V1, a shortest path in G from u to v must contain a vertex x ∈ V1 ∩ V2. Because G1 and G2 are isometric subgraphs, there are shortest paths Pux in G1 and Pxv in G2 such that their union is a shortest path from u to v. Then, by the triangle inequality and part (i) of the proof, we have (cf. Figure 5.9)

1 2 1 1 1 2 2 2 dG′ (u ,v ) ≤ dG′ (u ,x )+ dG′ (x ,x )+ dG′(x ,v )= dG(u,v) + 1.

1 2 The last two displayed formulas imply dG′ (u ,v )= dG(u,v)+1. 1 ′ 2 ′ u ∈ V1 and v ∈ V2 , therefore the path Pu1v2 must contain an edge, say x1x2, in M. This path is a shortest path in G′, thus this edge is unique. Then ′ ′ ′ ′ the segments Pu1x1 and Px2v2 of Pu1v2 are shortest paths in G [V1 ] and G [V2], respectively. Clearly, Puv is a shortest path in G. 

Example 5.52. Lemma 5.51 claims, in particular, that the projection of a shortest path in an extension G′ of a graph G is a shortest path in G. In general, the converse is not true. Consider the graph G shown in Figure 5.12 and two paths in G: V1 = abcef and V2 = bde. ′ The graph G in Figure 5.12 is an expansion of G with respect to V1 and V2. The path abdef is a shortest path in G; it is not a projection of a shortest path in G′.

d b 2 d 2

e 2 a f b e a 1 b 1 G 1 ‘ f c G c 1 e 1

Figure 5.12. A shortest path that is not a projection of a shortest path.

1 2 1 2 Let a a be an edge in the matching M = ∪x∈V1∩V2 {x x }. This edge defines five fundamental sets (cf. Section 2.3): the semicubes Wa1a2 and Wa2a1 , the sets of vertices Ua1 a2 and Ua2a1 , and the set of edges Fa1a2 . The next theorem follows immediately from Lemma 5.51. It gives a hint to a connection between the expansion process and partial cubes.

Theorem 5.53. Let G′ be an expansion of a connected graph G and notations are chosen as above. Then ′ ′ ′ (i) Wa1 a2 = V1 and Wa2a1 = V2 are convex semicubes of G . 5.9 Expansions and Contractions of Partial Cubes 153

′ (ii) Fa1a2 = M defines an isomorphism between induced subgraphs G [Ua1a2 ] ′ and G [Ua2a1 ], each of which is isomorphic to the subgraph G1 ∩ G2. The result of Theorem 5.53 justifies the following constructive definition of the contraction operation. Definition 5.54. Let ab be an edge of a connected graph G′ =(V ′, E′) such that ′ (i) Semicubes Wab and Wba are convex and form a partition of V . (ii) The set Fab is a matching and defines an isomorphism between subgraphs ′ ′ G [Uab] and G [Uba].

The graph G obtained from the graphs Wab and Wba by pasting them along ′ ′ ′ subgraphs G [Uab] and G [Uba] is said to be a contraction of the graph G . One can say that, in the case of finite partial cubes, the contraction oper- ation is defined by an orthogonal projection of a cube onto one of its facets (cf. Figures 5.10 and 5.11). ′ ′ ′ By Theorem 5.53, the sets V1 and V2 are opposite semicubes of G . These semicubes are defined by edges of M. Their projections are the sets V1 and V2 that are not necessarily semicubes of G. For other semicubes in G′ we have the following result.

Lemma 5.55. For any two adjacent vertices u,v ∈ Vi,

−1 Wuivi = p (Wuv), where i ∈ {1, 2}. Proof. By Lemma 5.51,

j i j i dG′ (x , u ) < dG′ (x ,v ) if and only if dG(x, u) < dG(x,v), for x ∈ V and i, j ∈ {1, 2}. The result follows. 

Corollary 5.56. If uv is an edge of G1 ∩ G2, then Wu1v1 = Wu2v2 . The following lemma is an immediate consequence of Lemma 5.51. We use it implicitly in our arguments later.

Lemma 5.57. Let u,v ∈ V1 and x ∈ V1 ∩ V2. Then

1 2 x ∈ Wu1v1 if and only if x ∈ Wu1v1 .

The same result holds for semicubes in the form Wu2v2 . In general, the projection of a convex subgraph of G′ is not a convex subgraph of G. For instance, the projection of the convex path b2d2e2 in Figure 5.12 is the path bde that is not a convex subgraph of G. On the other hand, we have the following result. 154 5 Partial Cubes

Theorem 5.58. Let G′ = (V ′, E′) be an expansion of a graph G = (V, E) with respect to subgraphs G1 = (V1, E1) and G2 = (V2, E2). The projection ′ ′ ′ of a convex semicube of G different from V1 and V2 is a convex semicube of the graph G.

Proof. It suffices to consider the case when Wuv = p(Wu1v1 ) for u,v ∈ V1 (cf. Lemma 5.55). Let x, y ∈ Wuv and z ∈ V be a vertex such that

dG(x, z)+ dG(z, y) = dG(x, y).

We need to show that z ∈ Wuv. (i) x, y ∈ V1 (the case when x, y ∈ V2 is treated similarly). Suppose that 1 1 1 ′ z ∈ V1. Then x , y , z ∈ V1 and, by Lemma 5.51, 1 1 1 1 1 1 dG′(x , z )+ dG′ (z , y )= dG′ (z , y ).

1 1 1 x , y ∈ Wu1v1 and Wu1v1 is convex, thus z ∈ Wu1v1 . Hence, z ∈ Wuv. Suppose now that z ∈ V2 \ V1. Consider a shortest path Pxy in G from ′ ′ x to y containing z. This path contains vertices x , y ∈ V1 ∩ V2 such that (cf. Figure 5.13)

′ ′ ′ ′ dG(x,x )+ dG(x , z)= dG(x, z) and dG(y, y )+ dG(y , z)= dG(y, z).

z y y‘

x‘ … x V1 V2 V1 V2

Figure 5.13. Proof of Theorem 5.58.

Pxy is a shortest path in G, therefore we have

′ ′ ′ ′ dG(x,x )+ dG(x , y)= dG(x, y), dG(x, y )+ dG(y , y)= dG(x, y), and ′ ′ ′ ′ dG(x , z)+ dG(z, y )= dG(x , y ). ′ 1 ′1 1 ′ 1 1 Because x,x , y ∈ V1, we have x ,x , y ∈ V1 . Because x , y ∈ Wu1v1 and ′1 ′ ′ Wu1v1 is convex, x ∈ Wu1v1 . Hence, x ∈ Wuv and, similarly, y ∈ Wuv. ′2 ′2 2 ′ 2 Because x , y , z ∈ V2 and Wu1v1 is convex, z ∈ Wu1v1 . Hence, z ∈ Wuv. (ii) x ∈ V1\V2 and y ∈ V2\V1. We may assume that z ∈ V1. By Lemma 5.51,

1 2 dG′ (x , y )= dG(x, y)+1= dG(x, z)+ dG(z, y) + 1 1 1 1 2 = dG′ (x , z )+ dG′ (z , y ). 5.9 Expansions and Contractions of Partial Cubes 155

1 2 1 x , y ∈ Wu1v1 and Wu1v1 is convex, thus z ∈ Wu1v1 . Hence, z ∈ Wuv. 

By using the results of Lemma 5.51, it is not difficult to show that the class of connected bipartite graphs is closed under the expansion and contraction operations. The next theorem establishes this result for the class of partial cubes.

Theorem 5.59. (i) An expansion of a partial cube is a partial cube. (ii) A contraction of a partial cube is a partial cube.

Proof. (i) Let G =(V, E) be a partial cube and G′ =(V ′, E′) be its expansion with respect to isometric subgraphs G1 = (V1, E1) and G2 = (V2, E2). By Theorem 5.19(ii), it suffices to show that the semicubes of G′ are convex. ′ ′ By Theorem 5.53, the semicubes V1 and V2 are convex, so we consider a semicube in the form Wu1v1 where uv ∈ E1 (the other case is treated similarly). Let Px′y′ be a shortest path connecting two vertices in Wu1v1 and Pxy be its projection to G. By Lemma 5.55, x, y ∈ Wuv and, by Lemma 5.51, Pxy is a shortest path in G. Because Wuv is convex, Pxy belongs to Wuv. Let ′ ′ z be a vertex in Px′y′ and z = p(z ) ∈ Pxy. By Lemma 5.51,

′ 1 ′ 1 dG(z, u) < dG(z,v) implies dG′ (z , u ) ≤ dG′ (z ,v ).

′ ′ 1 ′ 1 G is a bipartite graph, thus dG′ (z , u ) < dG′ (z ,v ). Hence, Px′y′ ⊆ Wu1v1 , so Wu1 v1 is convex. (ii) Let G = (V, E) be a contraction of a partial cube G′ = (V ′, E′). By Theorem 5.19(ii), we need to show that the semicubes of G are convex. By Lemma 5.55, all semicubes of G are projections of semicubes of G′ distinct ′ ′  from V1 and V2 . By Theorem 5.58, the semicubes of G are convex.

Theorem 5.60. A finite connected graph is a partial cube if and only if it can be obtained from K1 by a sequence of expansions. Furthermore, the number of expansions needed to produce a partial cube G from K1 is dimI (G).

Proof. By Theorem 5.59(i), a sequence of expansions produces a partial cube from K1. Conversely, by Theorems 5.19(ii) and 2.26, a partial cube admits a contraction that produces, by Theorem 5.59(ii), a partial cube. By applying this procedure repeatedly, we obtain the graph K1. It is clear that the contrac- tion operation reduces the number of equivalence classes of the theta relation by one. By Theorem 5.34, there are exactly dimI (G) expansions needed to produce the partial cube G from K1. 

As shown in Sections 5.2 and 5.6, a finite partial cube is isomorphic to the partial cube GF where F is a wg-family of subsets of some finite set X satisfying conditions ∩ F = ∅ and ∪ F = X. In what follows we present proofs of Theorems 5.59 and 5.60 given in terms of wg-families of sets. 156 5 Partial Cubes

The expansion process for a partial cube GF on X can be described as follows. Let F1 and F2 be wg-families of finite subsets of X such that

F1 ∩ F2 6= ∅, F1 ∪ F2 = F and the distance between any two sets P ∈ F1 \ F2 and Q ∈ F2 \ F1 is greater than one. Note that GF1 and GF2 are partial cubes, GF1 ∩ GF2 6= ∅, and ′ GF1 ∪ GF2 = GF. Let X = X + {p}, where p∈ / X, and

′ ′ ′ F2 = {Q + {p} : Q ∈ F2}, F = F1 ∪ F2.

′ It is quite clear that the graphs GF2 and GF2 are isomorphic and the graph ′ GF is an expansion of the graph GF. Theorem 5.61. An expansion of a partial cube is a partial cube.

Proof. We need to verify that F′ is a wg-family of finite subsets of X′. By Theorem 5.9, it suffices to show that the distance between any two adjacent sets in F′ is one. It is obvious if each of these two sets belongs to one of the ′ ′ families F1 or F2. Suppose that P ∈ F1 and Q + {p}∈ F2 are adjacent; that is, for any S ∈ F′ we have

P ∩ (Q + {p}) ⊆ S ⊆ P ∪ (Q + {p}) implies S = P or S = Q + {p}. (5.10)

If Q ∈ F1, then

P ∩ (Q + {p}) ⊆ Q ⊆ P ∪ (Q + {p}), inasmuch as p∈ / P . By (5.10), Q = P implying d(P,Q + {p})=1. If Q ∈ F2 \ F1, there is R ∈ F1 ∩ F2 such that

d(P, R)+ d(R,Q)= d(P,Q), because F is well graded. By Theorem 3.22,

P ∩ Q ⊆ R ⊆ P ∪ Q, which implies

P ∩ (Q + {p}) ⊆ R + {p}⊆ P ∪ (Q + {p}).

By (5.10), R + {p} = Q + {p}, a contradiction. The result follows. 

It is easy to recognize the fundamental sets (cf. Section 2.3) in an isometric ′ ′ expansion GF of a partial cube GF. Let P ∈ F1 ∩ F2 and Q = P + {p}∈ F2 be two vertices defining an edge in GF′ according to Definition 5.47(ii). ′ Clearly, the families F1 and F2 are the semicubes WPQ and WQP of the graph ′ GF′ (cf. Theorem 5.18) and therefore are convex subsets of F . The set FPQ is 5.10 Uniqueness of Isometric Embeddings 157 the set of edges defined by p as in Theorem 5.18. In addition, UPQ = F1 ∩ F2 and UQP = {R + {p} : R ∈ F1 ∩ F2}. Let G be a partial cube induced by a wg-family F of finite subsets of a set X. As before, we assume that ∩ F = ∅ and ∪ F = X. Let PQ be an edge of G. We may assume that Q = P + {p} for some p∈ / P . Then (see Theorem 5.18)

WPQ = {R ∈ F : p∈ / R} and WQP = {R ∈ F : p ∈ R}.

Let X′ = X \{p} and F′ = {R \{p} : R ∈ F}. It is clear that the graph ′ GF′ induced by the family F is isomorphic to the contraction of GF defined by the edge PQ. Geometrically, the graph GF′ is the orthogonal projection of the graph GF along the edge PQ (cf. Figures 5.10 and 5.11).

Theorem 5.62. (i) A contraction GF′ of a partial cube GF is a partial cube. (ii) If GF is finite, then dimI (GF′ ) = dimI (GF) − 1.

Proof. (i) For p ∈ X we define F1 = {R ∈ F : p∈ / R}, F2 = {R ∈ F : p ∈ R}, ′ and F2 = {R \{p} ∈ F : p ∈ R}. Note that F1 and F2 are semicubes of GF ′ ′ and F2 is isometric to F2. Hence, F1 and F2 are wg-families of finite subsets ′ ′ ′ of X = X \{p}. We need to prove that F = F1 ∪ F2 is a wg-family. By Theorem 5.9, it suffices to show that d(P,Q) = 1 for any two adjacent sets ′ ′ P,Q ∈ F . This is true if P,Q ∈ F1 or P,Q ∈ F2, because these two families ′ ′ are well graded. For P ∈ F1 \ F2 and Q ∈ F2 \ F1, the sets P and Q + {p} are not adjacent in F, because F is well graded and Q/∈ F. Hence there is R ∈ F1 such that P ∩ (Q + {p}) ⊆ R ⊆ P ∪ (Q + {p}) and R 6= P . Inasmuch as p∈ / R, we have

P ∩ Q ⊆ R ⊆ P ∪ Q.

R 6= P and R 6= Q, thus the sets P and Q are not adjacent in F′. The result follows. (ii) If G is a finite partial cube, then

′ ′ dimI (G )= |X | = |X|− 1 = dimI (G) − 1, by Theorem 5.34(ii). 

5.10 Uniqueness of Isometric Embeddings

Let G be the partial cube depicted in Figure 5.14, left. There are different ways of embedding this graph into the cube H({a,b,c})= Q3. (This cube is shown in Figure 5.14, right). 158 5 Partial Cubes

{a,b,c}

{b,c} {a,b} {a,c}

G {b} {c} {a}

Q3 Ø

Figure 5.14. Graph G and the cube Q3.

Two images G1 and G2 of G under isometric embeddings are shown in Figure 5.15. Note that as geometric figures the graphs G1 and G2 are congru- ent; that is, by moving one of them it is possible to superimpose it onto the other so that the two images become identified with each other in all their parts. More formally, there is an automorphism α of the cube Q3 such that α(G1)= G2. Indeed, the automorphism α = σ ◦ α{ac}, where σ is the permu- tation of {a,b,c} transposing elements a and b (for notation, see Section 3.8), maps G1 onto G2. b

{a,b,c} {a,b,c}

{b,c} {a,b} {a,c} {b,c} {a,b} {a,c} G1 G2 {b} {c} {a} {b} {c} {a}

Ø Ø

Figure 5.15. Graph G and the cube Q3.

In this section we show that this claim holds for arbitrary finite-dimensional partial cubes: the image of a finite graph under its isometric embedding into a cube is unique up to an automorphism of the cube. Note that the claim does not hold for infinite graphs. Consider, for in- stance, an infinite set X and let X′ be a proper subset of X of the same cardi- nality. The cube H(X′) is a proper isometric subgraph of the cube H(X) and isomorphic to H(X). However, it is evident that there is no automorphism of H(X) that maps the “smaller” cube onto the “larger” one. It is convenient to formulate the main result of this section in terms of wg–families of X. Theorem 5.63. Let F and G be wg-families of subsets of a finite set X, and let α be an isometry from F onto G. There is an isometry ϕ of P(X) onto 5.10 Uniqueness of Isometric Embeddings 159 itself such that ϕ(F) = G. Moreover, ϕ can be chosen so it is an extension of α; that is, ϕ|F = α.

Some general remarks are in order. A metric space is said to be homoge- neous if for any two points of the space there is an isometry of the space onto itself mapping one of the points into another. Let Y be a homogeneous metric space, A and B be two subspaces of Y , and α be an isometry from A onto B. The isometry α is said to be extendable to an isometry ϕ of Y onto itself if ϕ|A = α. Let c be a fixed point in Y . For a given a ∈ A, let b = α(a) ∈ B. Inasmuch as Y is homogeneous, there are isometries β and γ from Y onto itself such that β(a) = c and γ(b) = c. Then λ = γαβ−1 is an isometry from β(A) onto γ(B) such that λ(c)= c. Clearly, α is extendable to an isometry of Y if and only if λ is extendable. The argument in the foregoing paragraph shows that in Theorem 5.63 we may assume that the wg-families F and G both contain the empty set and ϕ(∅)= ∅. We obtain the result of Theorem 5.63 by proving several lemmas. For a given family F ⊆ Pf (X) we denote by D(F) the union ∪ F and define a function rF : D(F) → N by

rF(x) = min{|R| : x ∈ R, R ∈ F}.

F For k ∈ N a subset Xk of X is defined by

F Xk = {x ∈ X : rF(x)= k}. F F ∅ F Clearly, Xi ∩ Xj = for i 6= j, and ∪kXk = D(F). Note that some of the F sets Xk could be empty for k> 1. Example 5.64. Let X = {a,b,c} and F = {∅, {a}, {b}, {a, b}, {a,b,c}}. We have rF(a)= rF(b) = 1, rF(c) = 3, and F F ∅ F X1 = {a, b}, X2 = , X3 = {c}.

F Lemma 5.65. The set X1 is not empty and, for any nonempty set P ∈ F, there is x ∈ P such that P \{x}∈ F.

Proof. F is well-graded and contains the empty set, thus there is a nested sequence ∅, R1,...,Rk = P of distinct sets in F such that |Ri+1 \ Ri| = 1. F ∅ Because R1 is a singleton, we have X1 6= . Clearly, Rk−1 = P \{x} for some x ∈ P . Thus P \{x}∈ F. 

Lemma 5.66. For P ∈ F and x ∈ P ,

rF(x)= |P | implies P \{x}∈ F. 160 5 Partial Cubes

Proof. By Lemma 5.65, there is y ∈ P such that P \{y}∈ F.

|P \{y}| = |P |− 1 < rF(x), thus we have x∈ / P \{y}. Therefore, y = x and the result follows. 

Let F and G be two wg-families each containing ∅, and α : F → G be an isometry such that α(∅)= ∅. We show that there is a permutation σ : X → X such that α = σ|F, where σ is the automorphism of H(X) defined by σ (see Section 3.8). Because α isb an isometry,b it preserves the betweenness relation. For any two sets P,Q ∈ F, we have

P ⊆ Q if and only if α(P ) ⊆ α(Q), (5.11) inasmuch as P lies between ∅ and Q and α(∅)= ∅. We also have

|α(P )| = |P |, for P ∈ F, (5.12) because |P | = d (∅,P )= d (∅,α(P )) = |α(P )|.

Lemma 5.67. If x ∈ P ∈ F and P \{x} ∈ F, then there is y ∈ α(P ) such that α(P ) \{y} = α(P \{x}).

Proof. By property (5.11), P \{x}⊂ P implies α(P \{x}) ⊂ α(P ). Because d(P \{x},P ) = 1, we have d(α(P \{x}),α(P )) = 1. The result follows. 

Let us define a relation σ ⊆ D(F) × D(G) as follows: (x, y) ∈ σ if and only if x ∈ D(F) and y ∈ D(G) satisfy conditions of Lemma 5.67 for some P ∈ F. By Lemmas 5.66 and 5.67, for any x ∈ D(F) there is y ∈ D(G) such that (x, y) ∈ σ. Conversely, for any y ∈ D(G) there is x ∈ D(F) such that (x, y) ∈ σ. Indeed, it suffices to apply the results of Lemmas 5.66 and 5.67 to the family G and the inverse isometry α−1. We show that the relation σ is a bijection.

F G G Lemma 5.68. If x ∈ Xk and (x, y) ∈ σ, then y ∈ Xk . Conversely, if y ∈ Xk F and (x, y) ∈ σ, then x ∈ Xk .

Proof. Let P ∈ F be a set of cardinality k defining rF(x)= k. Then rG(y) ≤ k, because y ∈ α(P ) and, by (5.12), |α(P )| = k. Suppose that m = rG(y) < k. Then there is Q ∈ G such that y ∈ Q and |Q| = m. By Lemma 5.66, Q \{y}∈ G. By Lemma 5.67,

α(P \{x}) ∩ Q ⊆ α(P ) ⊆ α(P \{x}) ∪ Q.

The isometry α−1 preserves the betweenness relation, thus we have

(P \{x}) ∩ α−1(Q) ⊆ P ⊆ (P \{x}) ∪ α−1(Q). 5.10 Uniqueness of Isometric Embeddings 161

−1 Thus, x ∈ α (Q), a contradiction, because rF(x)= k and, by (5.12),

|α−1(Q)| = |Q| = m

G It follows that rG(y) = k; that is, y ∈ Xk . We prove the converse statement by applying the above argument to the inverse isometry α−1. 

F We proved that for every k ≥ 1 the restriction of σ to Xk is a relation F G σk ⊆ Xk × Xk .

Lemma 5.69. The relation σk is a bijection for every k ≥ 1.

Proof. First we prove that σk is a function. Suppose that there are z 6= y such that (x, y) ∈ σk and (x, z) ∈ σk. Then there are two distinct sets P,Q ∈ F defining y and z, respectively, such that

x ∈ P ∩ Q, k = rF(x)= |P | = |Q|,P \{x}∈ F, Q \{x}∈ F.

By Lemma 5.67,

α(P ) \{y} = α(P \{x}), α(Q) \{z} = α(Q \{x}), for some y ∈ α(P ) and z ∈ α(Q). We have

d (α(P ),α(Q)) = d (P,Q)= d (P \{x},Q \{x}) = d (α(P ) \{y},α(Q) \{z}).

Thus, y, z ∈ α(P ) ∩ α(Q). In particular, z ∈ α(P ) \{y}, a contradiction, because |α(P ) \{y}| = k − 1 but, by Lemma 5.68, rG(z)= k. −1 G By applying the above argument to α , we prove that for any y ∈ Xk F  there is a unique x ∈ Xk such that (x, y) ∈ σk. Hence, σk is a bijection.

F G Let us recall that nonempty sets Xk and Xk form partitions of the sets D(F) and D(G), respectively. Therefore, we established the following result: Corollary 5.70. The relation σ is a bijection from D(F) onto D(G). F and G are finite families of finite sets, therefore the bijection σ can be extended to a permutation of the set X. We denote this permutation by the same symbol σ. Lemma 5.71. α(P )= σ(P ) for P ∈ F. Proof. The proof is by induction on k = |P |. The case k = 1 is trivial, inasmuch b as α({x})= {σ1(x)} for {x}∈ F. Suppose that α(R) = σ(P ) for all R ∈ F such that |R| < k. Let P be a set in F of cardinality k. By Lemma 5.65, P = R ∪ {x} for some R ∈ F and x∈ / R. It is clear that m =brF(x) ≤ k and |R| = k − 1. 162 5 Partial Cubes

If m = k, then α(P )= α(R) ∪ {σ(x)} = σ(P ), by the definition of σ and the induction hypothesis. Suppose that m

S ∩ P ⊆ Q ⊆ S ∪ P, which implies α(S) ∩ α(P ) ⊆ α(Q) ⊆ α(S) ∪ α(P ) Thus, by the induction hypothesis,

σ(S) ∪ {σ(x)} = σ(Q) ⊆ σ(S) ∪ α(P ).

σ(x) ∈/ σ(S), thus we have σ(x) ∈ α(P ). Because α(P ) = σ(R) ∪ {y} for y∈ / σ(R), and x∈ / R, we have y = σ(x); that is, α(P )= σ(P ). 

The claim of Theorem 5.63 follows from the last lemma. The result of The- orem 5.63 holds for some infinite wg-families; see Exercise 5.19. The theorem can be also reformulated as follows.

Theorem 5.72. For any two finite isomorphic partial cubes G1 and G2 on a set X, there is an automorphism of the cube H(X) that maps one of the partial cubes onto the other. Moreover, for any isomorphism α : G1 → G2, there is an automorphism σ : H(X) → H(X) such that σ|G1 = α.

In conclusion, we present a geometric interpretation of Theorems 5.63 and 5.72. Let M be a nonempty family of subsets of a metric space Y . We say that X is M-homogeneous if for any two sets A, B ∈ M and an isometry from A onto B, this isometry can be extended to an isometry of the space Y onto itself. By Theorem 5.72, the cube H(X) is M-homogeneous with respect to the family M of all finite partial cubes on X. When M is the set of all singletons of Y , the space Y is simply called homogeneous (see the text after Theorem 5.63). A metric space Y is said to be fully homogeneous if it is P(Y )-homogeneous. Cubes are homogeneous metric spaces. However, even finite cubes Qn are not fully homogeneous if n ≥ 4, as the following example illustrates.

Example 5.73. Let X = {a,b,c,d}. Consider two families of subsets of X:

A = {∅, {a, d}, {b, d}, {c, d}} and B = {∅, {a, b}, {a,c}, {b,c}}.

Clearly, A and B are isometric. The distance from the set {d} to all sets in A is one. On the other hand, it is easy to verify that there is no subset of X which is on distance one from all sets in B (see Figure 5.16). Thus an isometry from A onto B cannot be extended to an isometry from H(X) onto itself. 5.11 Median Graphs 163

{a,b,c,d}

{a,b,c} {a,b,d} {a,c,d} {b,c,d}

{a,d} {a,b} {a,c} {b,c} {b,d} {c,d}

{a} {b} {c} {d}

«

Figure 5.16. Families A and B in the hypercube Q4 (∅ ∈ A ∩ B).

5.11 Median Graphs

Let us recall (cf. Exercise 2.33) that a median of a triple of vertices {u,v,w} of a connected graph G is a vertex in I(u,v) ∩ I(u,w) ∩ I(v,w). A graph G is a if every triple of vertices of G has a unique median. We denote the median of a triple {u,v,w} in a median graph by hu,v,wi. The goal of this section is to show that the class of median graphs is a proper subclass of the class of partial cubes. Two remarks are in order. First, for any edge uv of a graph, I(u,v) = {u,v}. Therefore, hu,v,wi ∈ {u,v} for any vertex w of a median graph, pro- vided that uv is an edge of the graph. Second, a median graph is bipartite. Indeed, suppose that it is not. Then, by Theorem 2.3, there is an edge uv and a vertex w of the graph such that d(w, u) = d(w,v). It is clear that I(u,v) ∩ I(u,w) ∩ I(v,w)= ∅, a contradiction. To prove that a median graph is a partial cube, we use the characterization of partial cubes established in Theorem 5.25. Specifically, we prove that two edges of a median graph that stand in the relation θ define equal pairs of opposite semicubes (see Theorem 5.25(ii)):

xy θ uv implies {Wxy, Wyx} = {Wuv, Wvu}. (5.13)

We begin by proving a special case of the claim.

Lemma 5.74. Let uv and xy be two edges of a median graph G such that xy θ uv with x ∈ Wuv, y ∈ Wvu, and d(x, u) = 1. Then Wxy = Wuv and Wyx = Wvu. 164 5 Partial Cubes

Note that the vertices u,x and v, y belong to the fundamental sets Uuv and Uvu, respectively (see Figure 5.17), and induce a square in G (cf. Exer- cise 2.16). In what follows, we use the result of Corollary 2.4 implicitly.

W U U W uv uv 1 vu vu x y w 1 1

u 1 v

Figure 5.17. Proof of Lemma 5.74.

Proof. Opposite semicubes are complements of each other in the vertex set, therefore it suffices to show that Wuv ⊆ Wxy. Let w ∈ Wuv. Because d(u,x) = 1, we have either (i) d(w, u)= d(w,x) + 1 or (ii) d(w,x)= d(w, u) + 1. We consider these two cases separately. (i) By applying the triangle inequality to the triples {w,v,y} and {w,y,x}, we have d(w,v) ≤ d(w, y) + 1 ≤ d(w,x) + 2. On the other hand,

d(w,v)= d(w, u)+1= d(w,x) + 2.

It follows that d(w, y)= d(w,x)+1; that is, w ∈ Wxy. (ii) d(w,x) = d(w, u) + 1, thus we have u ∈ I(w,x). Clearly, u ∈ I(w, u) and u ∈ I(x,v) (see Figure 5.17). Thus, u = hw,v,xi. Because d(x, y) = 1, we have

either d(w, y)= d(w,x)+1 or d(w,x)= d(w, y)+1.

Suppose that d(w,x)= d(w, y) + 1. Then y ∈ I(w,x).

d(w,v)= d(w, u)+1= d(w,x)= d(w, y)+1= d(w, y)+ d(y,v), therefore we have y ∈ I(w,v). Clearly, y ∈ I(x,v) (see Figure 5.17). It follows that y is a median of the triple {w,v,x}. Because G is a median graph and y 6= u = hw,v,xi, we have a contradiction. Therefore we must have d(w, y)= d(w,x) + 1, which means that w ∈ Wxy. We proved that any vertex in Wuv is also in Wxy. Hence, Wuv ⊆ Wxy and the result follows.  5.12 Average Length and the Wiener Index 165

Suppose now that d(x, u) > 1 in (5.13) (as in Lemma 5.74, we assume that x ∈ Wuv, y ∈ Wvu). Let u = u0, u1,...,un = x be a shortest ux-path. By the result of Exercise 2.15, this path is a subset of Wuv. The median v1 = hu1,v,yi is in Wvu, inasmuch as I(v, y) ⊆ Wvy (by the same Exercise 2.15). Because v1 ∈ I(v, u1) and d(u1,v) = 2, the quadruple {u, u1,v1,v} induces a square in G. By Lemma 5.74, we have Wu1,v1 = Wuv and Wv1,u1 = Wvu. Clearly, u1v1 θ uv. We apply the construction from the previous paragraph to edges u1v1 and xy resulting in an edge u2v2 with Wu2,v2 = Wu1v1 and Wv2,u2 = Wv1u1 (see Figure 5.18).

x y

Uuv u2 v2

U u1 v1 vu

u v

Figure 5.18. Sequence of squares.

An obvious inductive argument shows that Wxy = Wuv and Wyx = Wvu. Thus, by Theorem 5.25, G is a partial cube. On the other hand, the graph obtained from the cube Q3 by deleting one vertex is a partial cube but not a median graph (cf. Exercise 5.21). This completes the proof of the following theorem.

Theorem 5.75. A median graph is a partial cube. Furthermore, the class of median graphs is a proper subclass of the class of partial cubes.

5.12 Average Length and the Wiener Index

Let G =(V, E) be a finite graph on n vertices. We recall the definitions of the total distance td(G) and the average length ℓav(G) of G (cf. Exercise 3.26):

1 u,v∈V d(u,v) td(G)= d(u,v), ℓav(G)= . 2 n(n − 1) u,v∈V P X

Note that there are n(n − 1) nonzero terms in the sum u,v∈V d(u,v). P 166 5 Partial Cubes

In this section we compute these functions for a partial cube G on n vertices. First, we assume that G = GF for a wg-family F of subsets of a finite set X such that ∪ F = X and ∩ F = ∅. By Theorem 5.18, we can label pairs of opposite semicubes by elements of the set X as follows:

Wx = {R ∈ F : x ∈ R}, W x = {R ∈ F : x∈ / R}, x ∈ X.

χA△B = χA +χB −2 χA ·χB (cf. Exercise 5.29), thus we have the following formula for the Hamming distance:

d(A, B)= (χA(x)+ χB(x) − 2χA(x) · χB(x)). x X X∈ Therefore,

d(A, B)= (χA(x)+ χB(x) − 2χA(x) · χB (x)) A,B F A,B F x X X∈ X∈ X∈ = (χA(x)+ χB(x) − 2χA(x) · χB (x)). x X A,B F X∈ X∈ For a given x, the term in the last sum is nonzero if and only if A △ B = {x}. Note also that this nonzero term is 1. Either A ∈ Wx, B ∈ W x or B ∈ Wx, A ∈ W x, therefore we have

(χA(x)+ χB(x) − 2χA(x) · χB(x)) = 2|Wx||W x|. F A,BX∈ Hence, d(A, B) = 2 |Wx||W x|. x X X∈ We obtained the following result.

Theorem 5.76. Let F be a finite wg-family of subsets of a finite set X such that ∪ F = X and ∩ F = ∅. Then 2 td(GF)= |Wx||W x| and ℓav(GF)= |Wx||W x|, n(n − 1) x X x X X∈ X∈ where n = |F|.

Any finite partial cube G is isomorphic to a partial cube GF for some wg-family F of subsets of a finite set X satisfying conditions ∪ F = X and ∩ F = ∅. By Theorem 5.34, dimI (GF) = |X|, so the above theorem can be reformulated as follows. 5.12 Average Length and the Wiener Index 167

Theorem 5.77. Let G be a finite partial cube. Then

m m 2 td(G)= |Wi||W i| and ℓav(G)= |Wi||W i|, n(n − 1) i=1 i=1 X X where n = |V (G)|, m = dimI (G), and {Wi, W i}1≤i≤m is the family of mutu- ally opposite semicubes of G.

Finite subgraphs of the hexagonal lattice (see Figure 1.15) play an impor- tant role in chemical . In the framework of this theory, the total distance of a graph G is called the Wiener index and denoted by W (G). Thus, by definition, 1 W (G)= d(u,v). 2 u,vX∈V (G) Let C be a cycle of the hexagonal lattice. A benzenoid graph is formed by the vertices and edges of this lattice lying on and in the interior of C. An example of a benzenoid graph is shown in Figure 5.19 (interior edges of the graph are indicated by dashed lines). Note that the hexagonal lattice is a bipartite graph (Exercise 2.3). More- over, we show in Chapter 7 that this lattice is a partial cube. It is clear from the example in Figure 5.19 that a benzenoid graph need not be an isometric subgraph of the hexagonal lattice.

q

p

Figure 5.19. A benzenoid graph.

However, a benzenoid graph is a partial cube. We prove this claim by a geometric argument, assuming that the cells of the underlying lattice are regular hexagons. Let G be a benzenoid graph. A straight line segment S with ends p and q is said to be a cut segment if (i) S is perpendicular to one of the three edge directions, (ii) both p and q are the center of an edge, and (iii) the graph obtained from G by removing all edges intersected by S has exactly two ′ components GS and GS (see Figure 5.19). Let uv be an edge of G and S be a cut segment intersecting this edge. It is clear that the components GS and 168 5 Partial Cubes

′ GS are the semicubes Wuv and Wvu, and that these subgraphs are convex. By Theorem 5.19, G is a partial cube. ′ Because the components GS and GS are opposite semicubes of G, the edges that are intersected by the cut segments S form an equivalence class of the theta relation Θ on E(G). Thus there is one-to-one correspondence between the set of cut segments and the quotient set E(G)/Θ. By Theorem 5.77, we have the following result.

Theorem 5.78. Let G be a benzenoid graph on n vertices and E1,...,Em be the equivalence classes of Θ. For i = 1, . . . , m, let uivi ∈ Ei and ni = |Wuivi |. Then m W (G)= ni(n − ni). i=1 X Theorem 5.78 is particularly useful for finding closed formulas for the Wiener index of some families of benzenoid graphs (cf. Exercise 5.31).

5.13 Linear and Weak Orders

We denote by LO the family of all linear orders on a fixed set X of cardinality n ≥ 2. It is clear that this family is not well-graded if n> 2 (cf. Figure 5.3). Therefore, GLO is not a partial cube. However, there is a graph with the vertex set LO which is a partial cube. Let us denote by G(LO) the graph on the vertex set LO in which a pair LL′ of linear orders is an edge whenever L and L′ are adjacent in the family LO. This graph is a partial cube. We begin by outlining a proof of this claim. Let L0 be a fixed linear order on X and let F = {L ∩ L0 : L ∈ LO} be the family of all intersections of linear orders in LO with L0. First, we show that the assignment L 7→ L ∩ L0 defines a one-to-one correspondence between families LO and F. Second, we prove that F is a wg-family. Finally, we prove that the assignment L 7→ L ∩ L0 defines a graph isomorphism from G(LO) onto GF.

′ ′ Lemma 5.79. Let L0, L, and L be linear orders. If L ∩ L0 = L ∩ L0, then L = L′. Proof. The proof is by contradiction. Suppose that L 6= L′. Then there is an ordered pair (x, y) such that (x, y) ∈ L and (x, y) ∈/ L′. Accordingly, (y,x) ∈/ L ′ and (y,x) ∈ L . Note that either (x, y) ∈ L0 or (y,x) ∈ L0. ′ ′ If (x, y) ∈ L0, then (x, y) ∈ L ∩ L0 = L ∩ L0, which implies (x, y) ∈ L , a contradiction. ′ If (y,x) ∈ L0, then (y,x) ∈ L ∩ L0 = L ∩ L0 implying (y,x) ∈ L, again a contradiction. 

By Lemma 5.79, the assignment L 7→ L ∩ L0 defines a bijection from LO onto F. 5.13 Linear and Weak Orders 169

Let L be a linear order on X. Then there is a sequence called permutation x1,x2,...,xn of elements of X such that, for any x 6= y in X, (x, y) ∈ L if x = xi, y = xj with i

Proof. Let X = {x1,...,xn} be the enumeration of X defined by L. We cannot ′ ′ have (xk,xk+1) ∈ L for all 1 ≤ k < n, for otherwise we would have L = L, ′ ′ because L is a linear order. Hence, there is k such that (xk,xk+1) ∈/ L . The result follows for x = xk, y = xk+1, because xk covers xk+1 in L and ′ (xk+1,xk) ∈ L . 

Lemma 5.81. Let L be a linear order on X. For (x, y) ∈ L, the relation

L′ =(L \{(x, y)}) ∪ {(y,x)} is a linear order if and only if x covers y in L. Furthermore, in this case y covers x in L′. Proof. (Necessity.) Suppose that L′ is a linear order and there is z ∈ X such that (x, z) ∈ L and (z, y) ∈ L. Then (x, z) ∈ L′ and (z, y) ∈ L′, because z 6= x and z 6= y. By transitivity of L′, we have (x, y) ∈ L′, a contradiction. Hence, x covers y in L. (Sufficiency.) Suppose that x covers y in L. Then, for some k, we have ′ x = xk, y = xk+1 in the permutation x1,...,xn defined by L. Let L be a linear order defined by the permutation x1,...,xk+1,xk,...,xn. For any xi and xj with i

Now we are ready to prove the second claim in our outline.

Theorem 5.82. The family F = {L ∩ L0 : L ∈ LO} is well-graded. Proof. We use the criterion from Theorem 5.9. Let

′ ′ P = L ∩ L0 and P = L ∩ L0 170 5 Partial Cubes be two adjacent elements of F. By Lemma 5.80, there are x, y ∈ X such that x covers y in L and (y,x) ∈ L′. By Lemma 5.81, the relation

L′′ =(L \{(x, y)}) ∪ {(y,x)} is a linear order. Clearly, L ∩ L′ ⊆ L′′ ⊆ L ∪ L′. Therefore,

′ ′ ′′ ′ ′ P ∩ P = L ∩ L ∪ L0 ⊆ L ∩ L0 ⊆ (L ∪ L ) ∩ L0 = P ∪ P ;

′′ ′′ ′ that is, P = L ∩ L0 lies between P and P in F. We have

′′ ′′ P = L ∩ L0 = [(L ∩ L0) \ ({(x, y)}∩ L0)] ∪ ([{(y,x)}∩ L0] P \{(x, y)}, if (x, y) ∈ L , = 0 (P ∪ {(y,x)}, if (x, y) ∈/ L0.

Thus, the Hamming distance d(P,P ′′) = 1. Inasmuch as P ′′ 6= P and the relations P and P ′ are adjacent in F, we must have P ′′ = P ′. By Theorem 5.9, the family F is well-graded. 

The next lemma describes edges of the graph G(LO).

Lemma 5.83. Two linear orders L and L′ are adjacent in LO if and only if there are x, y ∈ X such that x covers y in L and

L′ =(L \{(x, y)}) ∪ {(y,x)}.

Proof. (Necessity.) Let L and L′ be two linear orders that are adjacent in LO. By Lemma 5.80, there are x, y ∈ X such that x covers y in L and (y,x) ∈ L′. By Lemma 5.81, the relation

L′′ =(L \{(x, y)}) ∪ {(y,x)} is a linear order. Clearly, L′′ lies between L and L′ and is distinct from L. Hence, L′′ = L′. (Sufficiency.) We need to show that L and L′ = (L \{(x, y)}) ∪ {(y,x)} are adjacent in LO. Let L′′ be a relation lying between L and L′; that is,

L ∩ L′ = L \{(x, y)}⊆ L′′ ⊆ L ∪ {(y,x)} = L ∪ L′.

L \{(x, y)} and L ∪ {(y,x)} are not linear orders, therefore we must have either L′′ = L or L′′ = L′. The result follows. 

Finally, we prove that graphs G(LO) and GF are isomorphic.

Theorem 5.84. The assignment L → L ∩ L0 defines a graph isomorphism from G(LO) onto GF. 5.13 Linear and Weak Orders 171

Proof. By Lemma 5.79, L → L ∩ L0 is a one-to-one correspondence between LO and F. Thus we need to prove two claims: (1) for any two linear orders L ′ ′ and L adjacent in LO, the relations L ∩ L0 and L ∩ L0 are adjacent in F, ′ and (2) for any two relations L ∩ L0 and L ∩ L0 that are adjacent in F, the linear orders L and L′ are adjacent in LO. (1) Let L and L′ be two linear orders adjacent in LO. By Lemma 5.83, there are x, y ∈ X such that x covers y in L and L′ =(L \{(x, y)}) ∪ {(y,x)}. Then

′ L ∩ L0 = [(L ∩ L0) \ ({(x, y)}∩ L0)] ∪ ([{(y,x)}∩ L0] (L ∩ L ) \{(x, y)}, if (x, y) ∈ L , = 0 0 ((L ∩ L0) ∪ {(y,x)}, if (x, y) ∈/ L0.

′ Therefore, the relations L ∩ L0 and L ∩ L0 are adjacent in F. ′ (2) Let L ∩ L0 and L ∩ L0 be two relations adjacent in F. By symmetry, we may assume that

′ L ∩ L0 =(L ∩ L0) \{(x, y)}, (5.14) for some (x, y) ∈ L ∩ L0. Let (u,v) be an ordered pair in L different from (x, y). There are two possible cases: ′ i) (u,v) ∈ L0. Then, by (5.14), (u,v) ∈ L , inasmuch as (u,v) 6=(x, y). ′ ′ ii) (u,v) ∈/ L0. Suppose that (u,v) ∈/ L . Then (v, u) ∈ L ∩ L0. By (5.14), (v, u) ∈ L. This contradicts our assumption that (u,v) ∈ L. Therefore, (u,v) is in L′. We proved that any ordered pair (u,v) in L distinct from (x, y) (which is also in L) belongs to L′. Because L′ is distinct from L and these relations are linear orders, we conclude that L′ = (L \{(x, y)}) ∪ {(y,x)}. It follows that L and L′ are adjacent in LO. 

Now we consider another class of binary relations that is of importance in applications. A partial order W on a set X is called a weak order if it is negatively transitive; that is, (x, y) ∈ W implies (x, z) ∈ W or (z, y) ∈ W , for any x, y, z ∈ X. As before, we assume that X is a given set of cardinality n ≥ 2. We denote by WO the set of all weak orders on X. This set is partially ordered by the inclusion relation. The graph in Figure 5.20 is the Hasse di- agram of WO for X = {a,b,c} (cf. the graph in Figure 5.3). It is clear that the family WO is not well-graded. For instance, there is no weak order on Hamming distance one from the empty weak order. The result of the following lemma can be used as a constructive definition of a weak order on X. The proof is left as an exercise (cf. Exercise 5.35). Lemma 5.85. A binary relation W on X is a weak order if and only if there is a partition X = X1 ∪···∪ Xk, 1 ≤ k ≤ n, such that (x, y) ∈ W if and only if x ∈ Xi, y ∈ Xj for some i

b

b

a

a

a

Figure 5.20. The graph of the family of weak orders on X = {a, b, c}.

Example 5.86. The linear order c

If X = X1 ∪···∪ Xk is a partition defining a weak order W , we say that W is a weak k-order, denote it by W = hX1,...,Xki, and call it an ordered partition. For instance, weak n-orders are linear orders, and the only weak 1-order is the empty weak order. The set of all weak k-orders on X is denoted by WO(k). As in the case of linear orders, we introduce a graph on the vertex set WO by defining its edges to be pairs W W ′ of weak orders that are adjacent to each other in WO, and denote this graph by G(WO). Our goal is to show that this graph is a partial cube. For this we need some structural properties of weak orders. The proofs of the next two lemmas and corollary are omitted (cf. Exercise 5.36).

Lemma 5.87. Two weak orders W and W ′ are adjacent in WO if and only if either

′ W = hX1,...,Xki and W = hX1,...,Xi ∪ Xi+1,...,Xki or ′ W = hX1,...,Xki and W = hX1,...,Xi ∪ Xi+1,...,Xki, for some 1 ≤ i

In words, one of two weak orders that are adjacent in WO is obtained from the other by joining two consecutive elements of its ordered partition. Note that, for i = k − 1, we have hX1,...,Xk−1 ∪ Xki in the above formulas.

′ Lemma 5.88. A weak order W = hX1,...,Xki contains a weak order W if and only if j1 j2 k ′ W = Xi, Xi,..., Xi , i=1 i=j1+1 i=jm+1 D [ [ [ E for some sequence of indices 1 ≤ j1 < ···

One can say that W ′ ⊆ W if elements of the ordered partition W ′ are “enlargements” of the consecutive elements of the ordered partition W .

Corollary 5.89. Two weak orders are adjacent in WO if and only if they are adjacent in the Hasse diagram of the poset WO. Accordingly, the graph G(WO) is the Hasse diagram of WO.

For a weak order W ∈ WO, we denote by JW the set of all weak 2-orders that are contained in W :

JW = {U ∈ WO(2) : U ⊆ W } and denote by F the family of all such subsets of WO(2):

F = {JW : W ∈ WO}.

To prove that G(WO) is a partial cube, we first show that posets G(WO) and F are isomorphic. Then we prove that F is a wg-family.

Theorem 5.90. A weak order admits a unique representation as a union of weak 2-orders; that is, for any W ∈ WO there is a unique set J ⊆ WO(2) such that W = U. (5.15) U J [∈ Furthermore, J = JW in (5.15).

Proof. If W is the empty weak order then it has a unique representation in the form (5.15) for J = ∅. Thus we may assume that W = hX1 ...,Xki where k ≥ 2. By Lemma 5.88, each weak order in JW is in the form

i k Wi = Xj , Xj , 1 ≤ i

J ⊆ JW = {W1,...,Wk−1}.

Suppose that there is Wp ∈/ J. For any x ∈ Xp, y ∈ Xp+1, we have (x, y) ∈ W and (x, y) ∈/ Wi for i 6= p. This contradicts our assumption that (5.15) holds for W . It follows that J = JW . 

By Theorem 5.90, the correspondence W 7→ JW establishes an isomor- phism between the posets WO and F.

Theorem 5.91. The family F is an independence system. Accordingly, the graph GF is a partial cube (cf. Theorem 5.11).

Proof. We need to show that the family F is closed under taking subsets. Let ′ ′ ′ F W = U∈J U for some subset J of JW ∈ . As the union of negatively transitive relations, the relation W ′ itself is negatively transitive (cf. Exer- cise 5.37).S It is a partial order, because W ′ ⊆ W . Therefore, W ′ is a weak ′ order. By Theorem 5.90, J = JW ′ ∈ F. 

F is a wg-family (cf. Theorem 5.11), therefore the graph GF is the Hasse diagram of F. Because posets WO and F are isomorphic, their Hasse dia- grams are also isomorphic. By Corollary 5.89 and Theorem 5.91, we have the following result.

Theorem 5.92. The graph G(WO) is a partial cube.

Notes

Isometric embeddings of graphs into cubes were first studied by Firsov (1965) (cf. Notes to Chapter 4). The term “partial cube” was coined by Hans-J¨urgen Bandelt and appeared for the first time in Imrich and Klavˇzar (1998) (see also Imrich and Klavˇzar, 2000). The concept of a well-graded family of sets was introduced by Falmagne and Doignon (1997) in connection with studies in the area of stochastic evo- lution of preference structures (see also Falmagne, 1997). It plays a key role in media theory (see Eppstein et al. (2008) and Chapter 8 of this book). Under a different name, wg-families were introduced earlier in Kuzmin and Ovchinnikov (1975) and Ovchinnikov (1980). The well-gradedness property of the family of partial orders on a finite set (Theorem 5.13) was established by Kenneth P. Bogart (1973). The result of Theorem 5.14 for arbitrary partial orders is known as Szpilrajn’s Extension Notes 175

Theorem. It was established by the Polish mathematician Edward Szpilrajn (later known as Edward Marczewski). In Szpilrajn (1930) he attributes it to S. Banach, M. Kuratowski, and A. Tarski. As isometric subgraphs of cubes, partial cubes inherit many fine metric properties of cubes (cf. Section 5.4). The metric structures of partial cubes expressed in terms of fundamental sets are the main tools in studying these graphs. Unlike cubical graphs, partial cubes can be effectively characterized. Historically, the first characterization (Theorem 5.19 in Section 5.5) was ob- tained by Dragomir Djokovi´c(1973) who also introduced the relation θ. Part (iii) of Theorem 5.19 for the relation Θ is due to Peter Winkler (1984). The results of Theorems 5.25 and 5.26 are found in Ovchinnikov (2008c). For more characterizations of partial cubes and related problems see Avis (1981), Roth and Winkler (1986), and Chepoi (1988, 1994). The relation L is called the like relation of a graph in Eppstein et al. (2008), where it appears in the context of media theory (see Chapter 8). Metric structures of partial cubes allow for ef- fective recognition algorithms for these graphs; see Imrich and Klavˇzar (2000) and Eppstein (2008). Theorem 5.34 in Section 5.6 was established in Djokovi´c (1973). Pasting (gluing) together two spaces is a standard technique in topology; see, for instance, Bourbaki (1966) and Munkres (2000). In the context of graph theory, this concept was adopted in Ovchinnikov (2008c). Mulder (1980) introduced graph expansions in his studies of median graphs. Specifically, he proved that finite median graphs can be obtained from the graph K1 by a sequence of convex expansions. For partial cubes, this re- sult (cf. Theorem 5.60) was obtained by Chepoi (1988) (see also Chepoi, 1994) who used isometric expansions (cf. Definition 5.47). In the context of the ori- ented matroid theory, the result of Theorem 5.60 was obtained by Fukuda and Handa (1993). An isometric embedding of a graph into a cube is unique up to an auto- morphism of the cube (Theorem 5.72). This property of partial cubes is also known as ℓ1-rigidity of partial cubes; see Deza and Laurent (1997). Median graphs have a long history and an extensive list of applications. The term “median graph” was coined by Ladislav Nebesk´y(1971). The reader is referred to the books by Mulder (1980) and Imrich and Klavˇzar (2000), and the survey by Bandelt and Chepoi (2008), where additional references to the pertinent literature on median graphs are found. Benzenoid graphs are of importance in chemistry where they repre- sent benzenoid hydrocarbons. For more information about this applied area see Gutman and Cyvin (1989). Klavˇzar et al. (1995) proved that benzenoid graphs are partial cubes. The family PO of all partial orders on a given set is well-graded (The- orem 5.13) and therefore can be modeled as a partial cube. Some proper subfamilies of PO are also well-graded. They are studied in Chapter 7. The families LO and WO of linear and weak orders, respectively, are examples of families of sets that are not well-graded, but still can be modeled as partial 176 5 Partial Cubes cubes. These constructions require many fine structural properties of these orders. In Section 5.13, some of these properties are presented as exercises. The reader who is inclined to learn more about these relations is referred to the books by Fishburn (1985), Mirkin (1979), Roberts (1979), and Trotter (1992).

Exercises

5.1. Use embeddings from Section 4.1 to show that paths, even cycles, and trees are partial cubes.

5.2. Let G be a cubical graph on seven vertices that is not a partial cube. Show that G is isomorphic to the graph in Figure 5.1a.

5.3. Represent the double ray Z as a partial cube on some set X.

5.4. Let R be a partial order on a finite set X. Show that there is at least one maximal element in X with respect to R. Give an example of a partial order for which there is more than one maximal element in X.

5.5. Show that the intersection of two partial orders is a partial order.

5.6. Show that semicubes of a tree are convex sets.

5.7. Let G be the (m × n)-grid. a) Show that the semicubes of G are convex. b) Describe the relation θ and show that it is an equivalence relation on the edge set of G. c) Show that dimI (G)= m + n − 2.

5.8. Give an example of a partial cube G different from Q3 for which dimc(G) = dimI (G)=3.

5.9. Prove that ⌈log2 n⌉ < n − 1 for n> 3.

5.10. Let C2n = v0,v1,...,v2n−1,v2n = v0 be an even cycle. Show that (vivi+1,vj,vj+1) ∈ Θ for 0 ≤ i

5.11. Prove that an isometric subgraph of a partial cube is a partial cube.

5.12. Prove that a semicube of a partial cube is a partial cube.

5.13. Show that the colouring in Theorem 5.27 is proper. Exercises for Chapter 5 177

5.14. Give an example of a connected graph G that has two edges uv, xy such that (uv, xy) ∈ Θ, but ((u,v), (x, y)) ∈/ L and ((u,v), (y,x)) ∈/ L (cf. Lemma 5.28).

5.15. Show that a connected bipartite graph in which every edge is contained in at most one cycle is a partial cube.

5.16. Let {Xi}i∈I be a family of pairwise disjoint sets and, for every i ∈ I, let Fi be a family of subsets of Xi such that ∩ Fi = ∅ and ∪ Fi = Xi. We denote by F the family of all subsets R of the set X = ∪i∈I Xi such that R ∩ Xi ∈ Fi for all i ∈ I. Show that ∩ F = ∅ and ∪ F = X.

5.17. Prove Lemma 5.44(ii).

5.18. Prove theorems in Section 5.8 using wg-families of sets.

5.19. Let F and G be isometric wg-families of finite subsets of a set X such that |∪ F | = |∪ G | and |X \∪F | = |X \∪G | and let α be an isometry from F onto G. Show that there is an isometry ϕ : F → G such that ϕ|F = G (cf. Theorem 5.63).

5.20. Let X be a metric space whose points are the six vertices of the trun- cated equilateral triangle shown in Figure 5.21 and distances between the points are the Euclidean distances in the plane. a) Show that for any two isometric subsets of X there is an isometry of X that maps one of the subsets onto another. b) Show that X is not fully homogeneous. (Hint: Let Y = {a, b} in Figure 5.21. The isometry ϕ : Y → Y defined by ϕ(a) = b, ϕ(b) = a is not expandable to an isometry of X onto itself.)

a

b

Figure 5.21. Exercise 5.20. 178 5 Partial Cubes

5.21. Let X = {a,b,c} and F = P(X) \{∅}. Show that GF is a partial cube but not a median graph.

5.22. Prove that trees are median graphs.

5.23. Show that cycles are not median graphs.

5.24. Show that fundamental sets Uab in a median graph induce convex sub- graphs. Is this true for partial cubes?

5.25. Let A, B, and C be vertices of a cube. Show that a unique median of the triple {A,B,C} is given by

hA,B,Ci =(A ∩ B) ∪ (A ∩ C) ∪ (B ∩ C).

5.26. Let u = (u1,...,un), v = (v1,...,vn), and w = (w1,...,wn) be three vertices of the cube Qn with the vertex set {0, 1}n. Show that the triple {u,v,w} has a unique median c =(c1,...,cn) where

ci =(ui ∧ vi) ∨ (vi ∧ wi) ∨ (wi ∧ ui), i ∈ {1,...,n}

(cf. Exercise 5.25). For notations ∧ and ∨, see Section 3.3.

5.27. Let u =(u1, u2), v =(v1,v2), and w =(w1,w2) be three vertices of the lattice Z2 with the vertex set Z2. Show that the triple {u,v,w} has a unique median c =(c1,c2), where

ci =(ui ∧ vi) ∨ (vi ∧ wi) ∨ (wi ∧ ui), i ∈ {1, 2}

(cf. Exercise 5.26). 5.28. Let c be a median of a triple of vertices {u,v,w} of a graph. Show that the sum d(x, u)+ d(x,v)+ d(x,w) attains its minimum value at x = c.

5.29. Let X be a set. Prove the following properties of characteristic functions: a) χA∪B = χA + χB − χA · χB , b) χA∩B = χA · χB , c) χA△B = χA + χB − 2 χA · χB , d) χA¯ = 1 − χA, where A, B ⊆ X and A¯ = X \ A.

5.30. Let G be the graph shown in Figure 5.22. a) Show that G is a partial cube. b) Find the isometric dimension of G. c) Find td(G) and ℓav(G). Exercises for Chapter 5 179

Figure 5.22. Exercise 5.30.

5.31. Let Hk be the kth benzenoid graph from the so-called coronene/circum- coronere series. The first three graphs of this series are displayed in Fig- ure 5.23. Show that the Wiener index of Hk is given by 164k5 − 30k3 + k W (Hk)= 5 (Gutman and Klavˇzar, 1996; Imrich and Klavˇzar, 2000).

H1 H2 H3

Figure 5.23. Exercise 5.31.

5.32. Let C be a cycle of the square lattice Z2 and G be the graph formed by the vertices and edges of the lattice lying on and in the interior of C (see Figure 5.24). Prove that G is a partial cube. The geometric figure formed by the squares of G is called a polyomino (Golomb, 1994).

Figure 5.24. Exercise 5.32. 180 5 Partial Cubes

5.33. Let X be a finite set of cardinality n ≥ 2, and let L be a linear order on X. An element u ∈ X is a minimum element with respect to L if (x, u) ∈ L for all x ∈ X \{u}. a) Show that there is a unique minimum element in X with respect to L. b) Show that the restriction of L to a nonempty subset Y of X is a linear order on Y . c) Show that there is an enumeration X = {x1,...,xn} such that (x, y) ∈ L if and only if x = xi and x = xj for i

5.34. Let L be a linear order on X and let P ⊆ L be a partial order. Prove that P = L ∩ L′ for some linear order L′ if and only if L \ P is a partial order (Eppstein et al., 2008, Theorem 3.5.8).

5.35. Prove Lemma 5.85. (Hint: Show that, for a given weak order W , the relation IW defined by

(x, y) ∈ IW if and only if (x, y) ∈/ W and (y,x) ∈/ W is an equivalence relation on X. Then use the equivalence classes of IW .)

5.36. Prove Lemmas 5.87, 5.88, and Corollary 5.89.

5.37. Show that the union of a family of negatively transitive relations is itself negatively transitive.

5.38. Let X be a set of cardinality n. Prove that a) |WO(2)| = 2n − 2. b) |WO(n − 1)| = n!(n − 2)/2. n c) |WO| = k=1 S(n,k)k!, where S(n,k) is the Stirling number of the second kind (cf. Stanley, 1997). P 5.39. Let X be a set of cardinality n. Show that

n!n(n − 1) ℓ (LO)= ∼ 0.25(n2 − 1), av 4(n! − 1) where ℓav is the average length function (Section 5.12) and ∼ stands for “asymptotically equivalent”.

5.40. Let X be a finite set, n = |X|, and f(n)= |WO| (cf. Exercise 5.38). a) Show that, for n = 3, ℓav(WO) = 30/13. b) Show that

n−1 n 2 k=1 k f(k)f(n − k)[f(n) − f(k)f(n − k)] ℓav(WO)= . f(n)(f(n) − 1) P