• Aucun résultat trouvé

Arborescences and Directed Euler Tours

Dans le document Algorithms and Computation in Mathematics • (Page 143-148)

Spanning Trees

4.8 Arborescences and Directed Euler Tours

In this section, we treat the analogue of Theorem4.2.9for the directed case and give an application to directed Euler tours. We begin with a simple characterization of arborescences which we used in Sect. 3.5 already.

Lemma 4.8.1 Let G be an orientation of a connected graph. Then G is a spanning arborescence with rootr if and only if

din(v) = 1 for allv=r and din(r) = 0. (4.4) Proof Condition (4.4) is clearly necessary. Thus assume that (4.4) holds.

ThenGhas exactly|V| −1 edges. As|G|is connected by hypothesis, it is a tree by Theorem 1.2.8. Now letvbe an arbitrary vertex. Then there is a path W inG from rto v; actually, W is a directed path, as otherwisedin(r)1 ordin(u)2 for some vertexu=r onW. Thusris indeed a root forG.

In analogy to the degree matrix of a graph, we now introduce the in-degree matrix D= (dij)i,j=1,...,n for a digraph G= (V, E) with vertex set V ={1, . . . , n}, where

dij=

⎧⎨

din(i) fori=j,

1 forij∈E, 0 otherwise.

We denote the submatrix of D obtained by deleting the i-th row and the i-th column byDi. The following analogue of Theorem4.2.9is due to Tutte [Tut48].

Theorem 4.8.2 Let G= (V, E)be a digraph with indegree matrix D. Then the r-th minor detDr is equal to the number of spanning arborescences ofG with root r.

Proof We may assumer= 1. Note that it is not necessary to consider edges with head 1 if we want to construct spanning arborescences with root 1, and that the entries in the first column of D do not occur in the minor detD1. Thus we may make the following assumption which simplifies the remainder of the proof considerably:G contains no edges with head 1, and hence the first column ofDis the vector having all entries 0. If there should be a vertex i= 1 withdin(i) = 0,Gcannot have any spanning arborescence. On the other hand, thei-th column ofDthen has all entries equal to 0, so that detD1= 0.

Thus our assertion is correct for this case, and we may from now on assume that the condition

din(i)1 for each vertexi= 1 (4.5)

holds. We use induction onm:=din(2) +· · ·+din(n); note m=|E|, because of our assumption din(1) = 0. The more difficult part of the induction here is the induction basis, that is, the casem=n−1. We have to verify that G is an arborescence (with root 1) if and only if detD1= 1. First letG be an arborescence; then condition (4.4) holds for r= 1. As G is acyclic, Ghas a topological sorting by Theorem 2.6.3. After a suitable permutation, we may assume i < j for all edges ij in E. (Note that we have to apply the same permutation to both the rows and columns ofD, so that no sign change will occur for the determinant.) Then the matrixDbecomes an upper triangular matrix with diagonal (0,1, . . . ,1) and detD1= 1.

Conversely, suppose detD1= 0; we have to show thatGis an arborescence (and therefore, actually detD1= 1). It follows from condition (4.5) andm= n−1 thatdin(i) = 1 fori= 2, . . . , n. ThusGsatisfies condition (4.4), and by Lemma 4.8.1 it suffices to show that |G| is connected. In view of Theorem 1.2.8, we may check instead that |G| is acyclic. By way of contradiction, suppose that|G| contains a cycle, say

C: i1 i2 · · · ik i1.

Let us consider the submatrixU ofD1 which consists of the columns corre-sponding toi1, . . . , ik. As each of the verticesi1, . . . , ik has indegree 1,U can have entries= 0 only in the rows corresponding to i1, . . . , ik. Moreover, the sum of all columns ofU is the zero vector, so thatU has rank≤k−1. Thus the columns ofU, and hence also the columns ofD1, are linearly dependent;

but this implies detD1= 0, contradicting our hypothesis. Hence the assertion holds form=n−1.

Now let m≥n. In this case, there has to be a vertex with indegree 2, say

din(n) =c≥2. (4.6)

For each edgee of the forme=jn, let D(e) denote the matrix obtained by replacing the last column ofD by the vectorve=ej+en, whereek is the k-th unit vector; thusvehas entry1 in rowj, entry 1 in rown, and all other entries 0. ThenD(e) is the indegree matrix for the graph G(e) which arises fromGby deleting all edges with headnexcept fore. Because of (4.6),G(e) has at mostm−1 edges; hence the induction hypothesis guarantees that the minor detD(e)1 equals the number of spanning arborescences ofG(e) with root 1. Obviously, this is the number of spanning arborescences ofGwhich have root 1 and contain the edge e. Therefore the number of all spanning arborescences ofGwith root 1 is the sum

detD(e1)1+· · ·+ detD(ec)1,

wheree1, . . . , ecare thecedges ofGwith headn. On the other hand, the last column ofDis the sumve1+· · ·+vec of the last columns ofD(e1), . . . , D(ec).

132 4 Spanning Trees

Thus the multilinearity of the determinant implies detD1= detD(e1)1+· · ·+ detD(ec)1,

and the assertion follows.

Theorem 4.8.2 can be used to obtain an alternative proof for Theo-rem 4.2.9. Even though this proof is not shorter than the proof given in Sect.4.2, it has the advantage of avoiding the use of the theorem of Cauchy and Binet (which is not all that well-known).

Corollary 4.8.3 Let H= (V, E) be a graph with adjacency matrix A and degree matrix D= diag(deg 1, . . . ,degn)−A. Then the number of spanning trees ofH is the common value of all minorsdetDr ofD.

Proof Let G be the complete orientation of H. Then there is a one-to-one correspondence between the spanning trees ofH and the spanning arbores-cences ofGwith rootr. Moreover, the degree matrix D ofH coincides with the indegree matrix ofG. Thus the assertion follows from Theorem4.8.2.

Now letG be a directed Eulerian graph; then Gis a connected pseudo-symmetric digraph by Theorem 1.6.1. The following theorem of de Bruijn and van Aardenne-Ehrenfest [deBA51] gives a connection between the spanning arborescences and the directed Euler tours ofG.

Theorem 4.8.4 LetG= (V, E)be an Eulerian digraph.Fori= 1, . . . , n, let ai denote the number of spanning arborescences of G with root i. Then the numbereG of directed Euler tours of Gis given by

eG=ai× n j=1

din(j)1

!, (4.7)

wherei may be chosen arbitrarily.

Sketch of proof LetAbe a spanning arborescence ofGwith rooti. For each vertex j=i, let ej denote the unique edge inA with head j, and chooseei as a fixed edge with headi. Now we construct a cycleCinGby the method described in the algorithm of Hierholzer, using all edges backward (so that we get a directed cycle by reversing the order of the edges in C). That is, we leave vertex i using edge ei; and, for each vertex j which we reach by using an edge with tail j, we use—as long as this is possible—some edge with head j not yet used to leave j again. In contrast to the algorithm of Hierholzer, we chooseej for leavingj only after all other edges with headj have been used already. It can be seen as usual that the construction can only terminate at the start vertexi, since Gis pseudo-symmetric. Moreover, for

each vertexj, all edges with headj—and hence all the edges ofG—are used exactly once, because of the restriction thatej is chosen last. Thus we indeed get an Euler tour. Obviously, whenever we have a choice of an edge in our construction, different choices will give different Euler tours. But the choice of the edges with headjleads to altogether (din(j)1)! possibilities, so that the product in (4.7) gives the number of distinct Euler tours of Gwhich can be constructed usingA. It is easy to see that distinct arborescences with root ialso lead to distinct Euler tours. Conversely, we may construct a spanning arborescence with rootifrom any directed Euler tour in a similar way.

Corollary 4.8.5 LetGbe an Eulerian digraph.Then the number of spanning arborescences ofG with root iis independent of the choice of i.

From Exercise 2.3.2 we know that the de Bruijn sequences of lengthN=sn over an alphabet S of cardinality s correspond bijectively to the directed Euler tours of the digraph Gs,n defined there. Combining Theorems 4.8.2 and4.8.4, we can now determine the number of such sequences, a result due to de Bruijn [deB46]. See also [vanLi74]; a similar method can be found in [Knu67].

Theorem 4.8.6 The number of de Bruijn sequences of length N=sn over an alphabetS of cardinality sis

bs,n=sn(s!)sn−1. (4.8) Sketch of proof As each vertex ofGs,nhas indegrees, Theorem 4.8.4yields

bs,n=a

(s1)!sn−1

, (4.9)

whereais the common value of all minors of the indegree matrixD ofGs,n. Thus it remains to show

a=ssn−1n. (4.10)

To do this, Theorem 4.8.2 is used. (We have to be a bit careful here, be-cause Gs,n contains loops. Of course, these loops should not appear in the matrixD.) As the technical details of calculating the determinant in question are rather tedious, we will not give them here and refer to the literature cited

above.

We conclude this chapter with some references for the problem of deter-mining an arborescence of minimal weight in a network (G, w) on a digraphG.

This problem is considerably more difficult than the analogous problem of determining minimal spanning trees in the undirected case; for this reason, we have not treated it in this book. A minimal arborescence can be

deter-134 4 Spanning Trees

mined with complexity O(|V|2) or O(|E|log|V|); the respective algorithms were found independently by Chu and Liu [ChuLi65] and Edmonds [Edm67b].

For an implementation, see [Tar77] and [CamFM79], where some details of Tarjan’s paper are corrected, or [GonMi84]. The best result up to now is due in [GabGST86], where Fibonacci heaps are used to achieve a complexity of O(|V|log|V|+|E|).

Dans le document Algorithms and Computation in Mathematics • (Page 143-148)