Finding the Graph with the Maximum Number of Spanning Trees by
GEORGE
MOUSTAKIDES
and
SAMUEL
D. BEDROSIAN
Systems Engineering Department, Moore School of Electrical Engineering, University of Pennsylvania, Philadelphia, Pennsylvania 19104, U.S.A.
The problem is to determine the linear graph that has the maximum number of spanning trees, where only the number of nodes N and the number of branches B are prescribed. We deal with connected graphs G(N, B) obtained by deleting D branches from a complete graph KN. Our solution is for D less than or equal to N.
ABSTRACT:
I. Introduction This problem has been examined by several researchers. A table of the possible subgraphs to be deleted from a complete graph to obtain the graph with the maximum number of trees was presented by Bedrosian (1). Shier (2) gives the answer to the problem for D less N/2. Leggett and Bedrosian in (3) present a method for the general problem based on a theorem with a necessary and sufficient condition for a graph to have the maximum number of trees. Here we will use a corollary of their theorem which is a necessary condition. Specifically, an easier proof is given to Shier’s result and also an extension to include N/2< D 5 N. Furthermore, we give a formula for calculating the maximum number of trees using the generic factors introduced in (4). It should be noted that Kelmans (5) addresses this problem in a somewhat more general way. However, no explicit procedure is presented. His approach can be used to verify our results.
IL Preliminary Discussion We start by recalling the theorem: for a graph to possess the maximum number of spanning trees it is necessary that the degrees of any two nodes differ by no more than one. The proof is not presented here since it can be found in (3). We use this theorem as the point of departure for subgraphs to be deleted from a complete graph to obtain the graph with the maximum number of trees. Based on the theorem, we know that a candidate graph can have nodes with degrees reduced by S or S + 1, where S is some integer. Since each branch includes two nodes, deleting D branches reduces the total degrees by 20. If R is the number of nodes with degrees reduced by S and N-R the number with 0 The
Franklin
Institute
0016-0032/80/1201~343$02.00/00
343
George Moustakides
and Samuel D. Bedrosian
degree reduced by S + 1, the following equality must hold: R - S+(N-R)(S+1)=2D.
(1)
Solving for R in (1) we get R=N(S+l)-20
(2)
U=N-R=2D-NS.
(3)
dS0
Since R and U have to be non-negative numbers, from (2) and (3) we find that S has to satisfy the following condition: 20 -ps2$ When 2DJN
(4)
is not an integer, S has only one value:
where by [ ] we mean the integer part of a number. If 2D/N is an integer, then S has either of two values: S,20_1 N
or
SZD
N’
Observe that these two values reveal that all the nodes have their degree reduced by 2D/N. This can be confirmed by substituting back into (3) and (4). ZII. Generic Factor Approach The representation by generic factors of a graph was first introduced in (4). It is a polynomial of N. The idea is that if we delete from a complete graph I&,, a subgraph with corresponding generic factor 9(N) the number of trees in the complementary incomplete graph is given by T = s(N)
. NN--2-“’
(6)
where m is the order of the polynomial 9(N). Also the generic factor of a graph which is composed of disjoint subgraphs is the product of the generic factors of the individual subgraphs. We consider two cases. Case 1. O
344
[
z
1
=O.
If~=l-+S=OorS=l.
Journal of The Franklin Institute Pcrgamon Press Ltd.
Finding the Graph with the Maximum Number of Spanning Trees Since S = 0 or S = 1 yield the same result we select S = 0. So for this case we always use S = 0. Also R = N - 20 and U = 20 means that we have 20 nodes with degrees reduced by one. The only way to accomplish this is by deleting D disjoint branches. Thus we have a different proof for the result in (2). As an example of this case we note that the generic factor for a distinct branch is (N-2) and since we delete D disjoint branches their generic factor is: 9(N) = (N - 2)D. Hence the maximum number of trees for G(N, B) with I3 = N(Nobtained by
1)/2-D
is
T, = (N- 2)D . NN-2-D. Case 2. NJ2 < D5 N Following the same procedure
as in Case 1 we can find that S = 1. Also that:
R = 2(N- D) nodes with degree reduced by 1, U = 20 -N
nodes with degree reduced by 2.
Now we have to determine what are the best subgraph forms that can be deleted from the complete graph to get the maximum number of trees. Because of (6) comparing the generic factors, properly multiplied by some power of N (to have the same order), the subgraph with the largest 9(N) is the subgraph we seek. Since the subgraphs to be deleted can have nodes with degrees 1 or 2 the possible candidates are the s series, the m series or combinations of them. The two series are shown in Fig. 1. Using the generic factors we can prove that between the disjoint forms in A and B of Fig. 2, deletion of subgraph set B maximizes T. In Fig, 3, we compare four subgraph sets. From any s series (A in Fig. 3) B is preferable, or C or D, depending on whether the number of nodes in A with degree 2 is divisible by 3 or has residue 1 or 2. We can also prove that B, C, and D are preferable to any of the m series. Based on the previous statements we illustrate our method using Fig. 4 (a and b). When a branch joins two nodes
(A) FIG. 1. s and m series subgraphs. Vol. 310, No. 6. December 1980 Printed in Northern Ireland
(B)
FIG. 2. Different s series combinations.
345
George Moustakides
and Samuel D. Bedrosian
(A)
(6)
(C)
(D)
FIG. 3. Four different subgraph sets.
it means that we have deleted this branch from the complete graph KN. As we can see, N can be even or odd. Note that each column represents the set of subgraphs of D branches that may be deleted. The first column of each case is D = [N/2] (the maximum number of disjoint branches that we can delete). By going to the next right adjacent column, D is increased by one. As D approaches N three different cases can occur depending on whether N = 3q +4 (or 5 or 6). In Fig. 5(a, b, c) we can see the corresponding solutions.
--
u
--
u
uu
n
-o--.
u
ZV
V
_A (a)
N = even
a
-
-
V V I/ n A A ...
17 If a A
v a
-7vv17 l
(b)
N =
odd
FIG. 4. Ordered sets of D subgraph branches to be deleted from I&. (a) N = even. (b) N = odd.
346
Journal of The
Franklin Institute Pergamon Press Ltd.
Finding the Graph with the Maximum Number of Spanning Trees D=N-2
Case
D=N-1
(a)
D=N
D=N-1
N = 3q + 4
Case
(b)
D=N-l
D=N
D=N
. .
N = 3q + 5 Case
(c)
. . N = 3q + 6
FIG. 5. The three different cases of subgraph sets as D + N.
IV. Summary of Results For convenience we now summarize the use of generic factors to obtain the desired graph G(N, B) that has the maximum number of spanning trees. Figure 6 indicates the generic factor to be used when a particular subgraph has been deleted from KW Hence we can express the maximum number of trees for G(N, B) by
- L-%W>l”C%W)l=E%W)l”CE 091”[%W)~ . Ng
T, = [% (N)Y where
the exponent
g is given
0 #
of
by
F, (Nl = (N-3)’
b # of
7
Fb(N) = (N-IICN-31
c#of
-
F,(N)
= (N-2)
d # of
:
F,(N)
= (N-2)(N*-4N+2)
e # of
I
Fe (NJ = (N-2)’
f#of
I>\
F,(N)=(N’-5N+512
(N-41
FIG. 6. Specific subgraphs with corresponding generic factors. Vol. 310, No. 6, December 1980 Printed in Northern Ireland
347
George Moustakides
and Samuel D. Bedrosian
Recalling Fig. 5 and also that R = 2(N- D) and U = 20 - N, we have: a. N=3q+4 R>2 a =[U,,3] b=U-3a c=R/2-b d=O e=O f=O
R=2 a=q b=O c=o d=l e=O f=O
R=O a=q b=O c=o d=O e=l f=O
b. N=3q+5 R#O a =[U/3]
c. N=3q+6 a = [U/3] b= U-3a
R=O
a=[U/3]-1
b=U-3a
b=O
c =R/2-b d=O e=O f=O
a=0 d=O e=O f=l
c=R/2-b d=O e=O f=O
As an illustrative example, let N = 25 and B = 280. Find the graph G(N, B) with the maximum number of spanning trees. Since I& has 300 branches, D = 300 - 280 = 20 and 0 c 20 < 25 noting that 25=3x7+4wehavecase(a)withN=3q+4.ThenR=lO, U=15.Because R >2 we find a=5,
b=O,
c=5,
d=O,
e=O,
f=O.
Referring to Fig. 6 we have to delete five disjoint branches and five disjoint triangles from the complete graph. Thus we find the maximum number of trees is T,,, = 235 - 221° * 25’
(1) S. D. Bedrosian, “Minimizing vulnerability in a communication network”, Proc. of 2nd Allerton Co& on Circuits and Systems, pp. 70-82, University of Illinois, 1964. (2) D. R. Shier, “Maximizing the number of spanning trees in a graph with n nodes and m edges”, Journal of Res. of the National Bureau of Standards-B. Math Scien., Vol. 78B, No. 4, Oct.-Nov., 1974. (3) J. D. Leggett and S. D. Bedrosian, “On networks with the maximum numbers of trees”, Proc. of Eighth Midwest Symposium on Circuit Theory, pp. 2.1-2.8, Colorado State University, June 14-15, 1965. (4) S. D. Bedrosian, “Generating formulas for the number of trees in a graph”, J. Franklin Inst., Vol. 277, No. 4, pp. 313-326, Apr. 1964. (5) A. K. Kelmans, “Comparison of graphs by their number of spanning trees”, Discrete Math., Vol. 16, pp. 241-261, 1976.
348
Joumal of The Franklin Institute Pergamon Press Ud.