An efficient algorithm to test forcibly-connectedness of graphical degree sequences

We present an algorithm to test whether a given graphical degree sequence is forcibly connected or not and prove its correctness. We also outline the extensions of the algorithm to test whether a given graphical degree sequence is forcibly $k$-connected or not for every fixed $k\ge 2$. We show through experimental evaluations that the algorithm is efficient on average, though its worst case run time is probably exponential. We also adapt Ruskey et al's classic algorithm to enumerate zero-free graphical degree sequences of length $n$ and Barnes and Savage's classic algorithm to enumerate graphical partitions of even integer $n$ by incorporating our testing algorithm into theirs and then obtain some enumerative results about forcibly connected graphical degree sequences of given length $n$ and forcibly connected graphical partitions of given even integer $n$. Based on these enumerative results we make some conjectures such as: when $n$ is large, (1) almost all zero-free graphical degree sequences of length $n$ are forcibly connected; (2) almost none of the graphical partitions of even $n$ are forcibly connected.


Introduction
A graphical degree sequence of finite length n is a non-increasing sequence of non-negative integers d 1 ≥ d 2 ≥ · · · ≥ d n such that it is the vertex degree sequence of some simple graph (i.e. a finite undirected graph without loops or multiple edges). Given an arbitrary nonincreasing sequence of non-negative integers a 1 ≥ a 2 ≥ · · · ≥ a n , it is easy to test whether it is a graphical degree sequence by using the Erdős-Gallai criterion [7] or the Havel-Hakimi algorithm [11,9]. Seven equivalent criteria to characterize graphical degree sequences are summarized by Sierksma and Hoogeveen [19]. The notion of partition of an integer is well known in number theory, and is defined to be a non-increasing sequence of positive integers whose sum is the given integer. An integer partition is called a graphical partition if it is the vertex degree sequence of some simple graph. Essentially a zero-free graphical degree sequence and a graphical partition are the same thing.
It is often interesting to observe the properties of all the graphs having the same vertex degree sequence. A graph G with degree sequence d = (d 1 ≥ d 2 ≥ · · · ≥ d n ) is called a realization of d. Let P be any property of graphs (e.g. being bipartite, connected, planar, triangle-free, Hamiltonian, etc). A degree sequence d is called potentially P-graphic if it has at least one realization having the property P and forcibly P-graphic if all its realizations have the property P [15]. In this paper we only consider the property of k-connectedness (k ≥ 1 is fixed). Wang and Cleitman [20] give a simple characterization of potentially k-connected graphical degree sequences of length n, through which we can easily test whether a given graphical degree sequence is potentially connected. However, to the best of our knowledge no simple characterization of forcibly k-connected graphical degree sequences has been found so far and no algorithm has been published to test whether a given graphical degree sequence is forcibly connected or forcibly k-connected with given k. Some sufficient (but unnecessary) conditions are known for a graphical degree sequence to be forcibly connected or forcibly k-connected [5,3,6].
In the rest of this paper we will present a straight-forward algorithm to characterize forcibly connected graphical degree sequences and outline the extensions of the algorithm to test forcibly k-connectedness of graphical degree sequences for fixed k ≥ 2. We will demonstrate the efficiency of the algorithm through some computational experiments and then present some enumerative results regarding forcibly connected graphical degree sequences of given length n and forcibly connected graphical partitions of given even integer n. Base on the observations on these available enumerative results we make some conjectures about the relative asymptotic behavior of considered functions and the unimodality of certain associated integer sequences. 2 The testing algorithm 2

.1 Preliminaries
Based on a result of Wang and Cleitman [20], a graphical degree sequence d 1 ≥ d 2 ≥ · · · ≥ d n is potentially k-connected if and only if d n ≥ k and n i=1 d i ≥ 2n − 2 k 2 − 2 + 2 k−1 i=1 d i . Taking k = 1, we get that a zero-free graphical degree sequence d 1 ≥ d 2 ≥ · · · ≥ d n is potentially connected if and only if n i=1 d i ≥ 2n − 2. Note that any graphical degree sequence with a 0 in it can be neither potentially nor forcibly connected. We will design an algorithm to test whether a zero-free graphical degree sequence d is forcibly connected based on the simple observation that d is forcibly connected if and only if it is not potentially disconnected, i.e., it does not have any disconnected realization. Equivalently we need to test whether d can be decomposed into two sub graphical degree sequences. For example, 3,3,3,3,2,2,2 is a potentially connected graphical degree sequence of length 7. It is not forcibly connected since it can be decomposed into two sub graphical degree sequences 3,3,3,3 and 2,2,2. Note also that when a graphical degree sequence can be decomposed into two sub graphical degree sequences, the terms in each sub sequence need not be consecutive in the original sequence. For example, the graphical degree sequence 4,4,3,3,3,2,2,2,1 can be decomposed into two sub graphical degree sequences 4,4,3,3,3,1 and 2,2,2 or into 4,4,3,3,2 and 3,2,2,1. We say that the graphical degree sequence 3,3,3,3,2,2,2 has a natural decomposition because it has a decomposition in which the terms in each sub sequence are consecutive in the original sequence. The graphical degree sequence 4,4,3,3,3,2,2,2,1 is not forcibly connected but does not have a natural decomposition. On the other hand, the graphical degree sequence 6,6,6,5,5,5,5,4,4 is forcibly connected since there is no way to decompose it into two sub graphical degree sequences.

Pseudo-code and the proof of its correctness
In this section we will present the pseudo-code of our Algorithm 1 to test forcibly-connectedness of a given zero-free graphical degree sequence. We then give a proof why it correctly identifies such graphical degree sequences.
We assume the input is a zero-free graphical degree sequence already sorted in nonincreasing order. In case an input that does not satisfy this condition is given, we can still easily test whether it is graphical by the Erdős-Gallai criterion [7] or the Havel-Hakimi algorithm [11,9]. The output will be True if the input is forcibly connected and False otherwise. The output can also include a way to decompose the input in case it is not forcibly connected and such a decomposition is desired.
Algorithm 1: Pseudo-code to test forcibly-connectedness of a graphical degree sequence Input: A zero-free graphical degree sequence d = (d 1 ≥ d 2 ≥ · · · ≥ d n ) Output: True or False, indicating whether d is forcibly connected or not Form all candidate decompositions of d into s 1 and s 2 such that s 1 is taken from d L = (d m ≥ d m+1 ≥ · · · ≥ d n ) of length l and s 2 = d − s 1 is of length n − l and both with even sum. If both s 1 and s 2 are graphical, return False 13 return True Now we show why Algorithm 1 correctly identifies whether d is forcibly connected or not. The conditional test on line 1 works as follows.
• If d 1 ≥ n − 2, then in any realization G of d the vertex v 1 with degree d 1 will be in a connected component with at least n − 1 vertices, leaving at most 1 vertex to be in any other connected component should the input d be non forcibly connected. However, a graph with a single vertex has the degree sequence 0, which contradicts the assumption that d is zero-free. Thus in this case d must be forcibly connected.
• If d n ≥ ⌊n/2⌋, then the vertex v n with degree d n will be in a connected component with at least 1 + ⌊n/2⌋ vertices. Should the input d be non forcibly connected, there will be another connected component not containing v n and also having at least 1 + ⌊n/2⌋ vertices since each vertex in that connected component has degree at least d n ≥ ⌊n/2⌋. This will result in a realization with at least 2 + 2⌊n/2⌋ > n vertices, a contradiction. Thus in this case d must also be forcibly connected.
The conditional test on line 3 works as follows. Let d 1 = d n = d.
• If n is odd, then d must be even since the degree sum of a graphical degree sequence must be even. When we reach line 3, we must have d < ⌊n/2⌋. Now d can be decomposed into two sub graphical degree sequences of length n−1 2 and n+1 2 respectively since d < n−1 2 = ⌊n/2⌋. Thus it is not forcibly connected. • If n is even, we consider two cases.
Case (A): n/2 is even, i.e. n ≡ 0 mod 4. In this case d can be decomposed into two graphical degree sequences of length n/2 since d < ⌊n/2⌋ = n/2. Thus it is not forcibly connected.
Case (B): n/2 is odd, i.e. n ≡ 2 mod 4. Further consider two sub cases. (B1): if d is odd, then d can be decomposed into two graphical degree sequences of length n/2 − 1 and n/2 + 1 respectively since d < n/2 − 1 as a result of d and n/2 being both odd and d < n/2. (B2): if d is even, then d can be decomposed into two graphical degree sequences of length n/2 since d < n/2. Thus in this case d is not forcibly connected.
Lines 5 to 7 try to find if d can be decomposed into two sub graphical degree sequences such that each sub sequence contains terms consecutive in the original sequence d, i.e. if the input d has a natural decomposition. For each given s, the two sub sequences d 1 = (d 1 ≥ d 2 ≥ · · · ≥ d s ) and d 2 = (d s+1 ≥ d s+2 ≥ · · · ≥ d n ) can be tested whether they are graphical by utilizing a linear time algorithm [12] that is equivalent to the Erdős-Gallai criterion. The smallest s that need to be tested is d 1 + 1 since d 1 can only be in a graphical degree sequence of length at least d 1 + 1 and d 1 has length s. The largest s that need to be tested is at most n − d n − 1 since d n can only be in a graphical degree sequence of length at least d n + 1 and d 2 has length n − s. Actually the upper bound of the tested s can be chosen to be at most the largest s such that s < n − d s+1 since d s+1 can only be in a graphical degree sequence of length at least d s+1 + 1. Let s u be the largest integer that satisfies this inequality. Note s u ≥ 2 since s = 2 satisfies the inequality at the point of line 5. Also note that s u ≤ n − d n − 1 because if s u ≥ n − d n then n − d n ≤ s u < n − d su+1 , which leads to d su+1 < d n , a contradiction. Therefore the upper bound of tested s is chosen to be s u . Additional data structures can be maintained to skip the tests of those s for which each of the two sub sequences d 1 and d 2 has odd sum. Clearly a necessary condition for the input d to have a natural decomposition is s u ≥ d 1 + 1. A weaker necessary condition easier to check is n − d n − 1 ≥ d 1 + 1, i.e. d 1 + d n ≤ n − 2.
The for loop starting from line 8 is to test whether the input d can be decomposed into two sub graphical degree sequences of length l and n − l respectively, whether the decomposition is natural or not. At first glance we need to test the range of l in 2 ≤ l ≤ n−2 since the shortest zero-free graphical degree sequence has length 2. By symmetry we do not need to test those l beyond ⌊n/2⌋. Actually we only need to test the range of l from d n + 1 to min{⌊n/2⌋, n − d 1 − 1}. We can start the loop with l = d n + 1 since, should the input d be decomposable, d n must be in a sub graphical degree sequence of length at least d n + 1 and the other sub graphical degree sequence not containing d n must also be of length at least d n + 1 due to all its terms being at least d n . There is no need to test those l > n − d 1 − 1 since, should the input d be decomposable, d 1 must be in a sub graphical sequence of length at least d 1 + 1 and the other sub graphical sequence not containing d 1 must have length at most n − d 1 − 1.
The condition tested on line 9 (d n+1−l < l) is necessary for d to be decomposable into two sub graphical degree sequences of length l and n − l respectively. A zero-free graphical degree sequence of length l must have all its terms less than l. If d is decomposable into two sub graphical degree sequences of length l and n − l respectively, d must have at least l terms less than l and n − l terms less than n − l. Therefore, the l smallest terms of d (d n−l+1 ≥ d n−l+2 ≥ · · · ≥ d n ) must be all less than l and the n − l smallest terms of d (d l+1 ≥ d l+2 ≥ · · · ≥ d n ) must be all less than n − l. These translate to the necessary conditions d n−l+1 < l and d l+1 < n − l for d to be decomposable. The condition d l+1 < n − l has already been satisfied since d 1 < n − l based on the loop range of l on line 8. Lines 10 to 12 first find out the sub sequence d L of d consisting exactly of those terms less than l and then exhaustively enumerate all sub sequences s 1 of d L with length l and even sum, trying to find a valid decomposition of d into s 1 and s 2 = d − s 1 with length n−l, consisting of the terms of d not in s 1 . Note that the l terms of s 1 need not be consecutive in d L . The motivation for the construction of m and d L = (d m ≥ d m+1 ≥ · · · ≥ d n ) is that, should the input d be decomposable into two sub graphical degree sequences of length l and n − l respectively, the sub graphical degree sequence with length l must have all its terms coming from d L . For each such sub sequence s 1 of d L with length l (we can always choose such an s 1 since d L has length n − m + 1 ≥ l due to the definition of m on line 10), let the remaining terms of d form a sub sequence s 2 = d − s 1 of length n − l. If both s 1 and s 2 are graphical degree sequences, then the input d is not forcibly connected since we have found a valid decomposition of d into s 1 and s 2 and we may return False on line 12. The conditional test on line 11 (l ≤ n − m) is added because at this point we know d cannot be naturally decomposed and we can therefore exclude the consideration of l = n − m + 1 since under this condition there is only one possible choice of s 1 from d L and consequently only one possible decomposition of d into two sub sequences of length l and n − l respectively, which is also a natural decomposition. If we remove the natural decomposition test from lines 5 to 7 and also remove the conditional test on line 11, the algorithm would obviously still be correct. If in the for loop from lines 8 to 13 we never return False on line 12, this means there is no way to decompose the input d into two sub graphical degree sequences whatsoever and we should return True on line 14. If we return False on line 4, 7, or 12 then a valid decomposition can also be returned if desired.
Later we will show that there is a computable threshold M(n) given the length n of the input d such that if d 1 is below this threshold the algorithm can immediately return False without any exhaustive enumerations. However, our computational experiences suggest that if the input satisfies d 1 < M(n) then Algorithm 1 already runs fast and it might not be worthwhile to add the computation of the additional threshold M(n) into it.

Extensions of the algorithm
In this section we show how to extend Algorithm 1 to perform additional tasks such as listing all possible decompositions of a graphical degree sequence and testing forcibly kconnectedness of a graphical degree sequence for fixed k ≥ 2.

Enumeration of all possible decompositions
Algorithm 1 can be easily extended to give all possible decompositions of the input d into two sub graphical degree sequences in case it is not forcibly connected. We simply need to report a valid decomposition found on line 3, 6 and 12 and continue without returning False immediately. Such an enumerative algorithm to find all valid decompositions of the input d can be useful when we want to explore the possible realizations of d and their properties.

Testing forcibly k-connectedness of d when k ≥ 2
It is also possible to extend Algorithm 1 to decide whether a given graphical degree sequence d is forcibly biconnected or not. We know that a connected graph is biconnected (nonseparable) if and only if it does not have a cut vertex. This characterization leads us to observe that if in any forcibly connected graphical degree sequence d the removal of any term d i and the reduction of some collection d S of d i elements from the remaining sequence d − {d i } by 1 each results in a non forcibly connected graphical degree sequence d ′ then d is not forcibly biconnected. If no such term and a corresponding collection of elements from the remaining sequence can be found whose removal/reduction results in a non forcibly connected graphical degree sequence, then d is forcibly biconnected. We give a pseudo-code framework in Algorithm 2 to decide whether a given graphical degree sequence d is forcibly biconnected or not. To simplify our description, we call the above mentioned combination of removal/reduction operations a generalized Havel-Hakimi (GHH) operation, notationally We remark that if the d ′ obtained on line 4 of Algorithm 2 is not a graphical degree sequence then the condition on line 5 is not satisfied and the algorithm will not return False at the moment.
Similarly we can test whether a given graphical degree sequence d is forcibly k-connected or not for k ≥ 3 iteratively as long as we already have a procedure to test whether a graphical degree sequence is forcibly (k − 1)-connected or not. Suppose we already know an input d is potentially k-connected and forcibly (k − 1)-connected. We can proceed to choose a term d i and a collection d S of size d i from the remaining sequence d − {d i } and perform a GHH operation on d. If the resulting sequence d ′ is a graphical degree sequence and is non forcibly (k − 1)-connected, then d is not forcibly k-connected. If no such term and a corresponding collection of elements from the remaining sequence can be found whereby a GHH operation Algorithm 2: Pseudo-code to test whether a graphical degree sequence is forcibly biconnected (See text for the description of GHH operation) Input: A zero-free graphical degree sequence d = (d 1 ≥ d 2 ≥ · · · ≥ d n ) Output: True or False, indicating whether d is forcibly biconnected or not 1 if d is not potentially biconnected or forcibly connected then if d ′ is a non forcibly connected graphical degree sequence then 6 return False 7 return True can be performed on d to result in a non forcibly (k−1)-connected graphical degree sequence, then d is forcibly k-connected. We give a pseudo-code framework in Algorithm 3 to decide whether a given graphical degree sequence d is forcibly k-connected or not.
Algorithm 3: Pseudo-code to test whether a graphical degree sequence is forcibly k-connected (See text for the description of GHH operation)

Complexity analysis
We conjecture that Algorithm 1 runs in time polynomial in n on average. The worst case run time complexity is probably still exponential in n. We are unable to provide a rigorous proof at this time, but we will later show through experimental evaluations that it runs fast on randomly generated long graphical degree sequences most of the time.
Now we give a discussion of the run time behavior of Algorithm 1. Observe that lines 1 to 4 take constant time. Lines 5 to 7 take O(n 2 ) time if we use the linear time algorithm from [12] to test whether an integer sequence is graphical. Lines 9 to 11 combined take O(n) time and they are executed O(n) times. So the overall time complexity is O(n 2 ) excluding the time on line 12.
Next consider all candidate decompositions of d into s 1 and s 2 on line 12. The sub sequence s 1 is taken from d L = (d m ≥ d m+1 ≥ · · · ≥ d n ) whose length could be as large as n and the length l of s 1 could be as large as ⌊n/2⌋. Therefore in the worst case we may have up to n n/2 candidate decompositions, which could make the run time of Algorithm 1 exponential in n.
A careful implementation of Algorithm 1 will help reduce running time by noting that d L is a multi-set and provides us an opportunity to avoid duplicate enumerations of s 1 because different l combinations of the indices (m, m + 1, · · · , n) could produce the same sub sequence s 1 . For this purpose, we can assume the input d is also provided in another format (e 1 , f 1 ), (e 2 , f 2 ), · · · , (e q , f q ) where d contains f i copies of e i for i = 1, · · · , q and e 1 > e 2 > · · · > e q > 0. (Clearly d 1 = e 1 and d n = e q .) Now enumerating s 1 of length l from d L can be equivalently translated to the following problem of enumerating all non-negative integer solutions of Equation (1) subject to constraints (2), where k is the number of distinct elements in (e q , f q ) and k satisfies k ≤ q and k ≤ l − d n since all the elements of d L are < l and ≥ d n . In this context m and k vary with l as the for loop from lines 8 to 12 progresses. Each solution of Equation (1) represents a candidate choice of s 1 out of d L with length l by taking x i copies of e q−k+i . Further improvement could be achieved by noting the odd terms among e q−k+1 , e q−k+2 , · · · , e q since we must have an even number of odd terms in s 1 for it to have even sum. We can categorize the x i variables of Equation (1) into two groups based on the parity of the corresponding e i and enumerate only its solutions having an even sum of the x i 's belonging to the odd group. The number of solutions of Equation (1) can be exponential in n. For example, let l = n/2, k = n/4 and let f j = 4 for j = q − k + 1, · · · , q. Then the number of solutions of Equation (1) will be at least n/4 n/8 by taking half of all x 1 , · · · , x k to be 4 and the remaining half to be 0. However in practice we rarely find such a large number of solutions are actually all enumerated before Algorithm 1 returns.
To the best of our knowledge, the computational complexity of the decision problem of whether a given graphical degree sequence is forcibly connected is unknown. The problem is clearly in co-NP since a short certificate to prove that a given input is not forcibly connected is a valid decomposition of the input sequence. But is it co-NP-hard? As far as we know, this is an open problem.
The time complexity of the extension Algorithms 2 and 3 to test whether a given graphical degree sequence d is forcibly k-connected or not for k ≥ 2 is apparently exponential due to the exhaustive enumeration of the candidate collection d S of size d i from the remaining sequence d − {d i } and the ultimate calls to Algorithm 1 possibly an exponential number of times.
The computational complexity of the decision problem of whether a given graphical degree sequence is forcibly k-connected (k ≥ 2) is also unknown to us. Clearly the problem is still in co-NP when k is fixed as to prove that a graphical degree sequence d is not forcibly k-connected is as easy as using a sequence of k − 1 certificates each consisting of a pair (d i , d S ) and a k th certificate being a valid decomposition to show that the final resulting sequence is decomposable after a sequence of k − 1 GHH operations on d, but we do not know if it is inherently any harder than the decision problem for k = 1.

Computational results
In this section we will first present some results on the experimental evaluation on the performance of Algorithm 1 on randomly generated long graphical degree sequences. We will then provide some enumerative results about the number of forcibly connected graphical degree sequences of given length and the number of forcibly connected graphical partitions of a given even integer. Based on the available enumerative results we will make some conjectures about the asymptotic behavior of related functions and the unimodality of certain associated integer sequences.

Performance evaluations of algorithm 1
In order to evaluate how efficient Algorithm 1 is, we aim to generate long testing instances with length n in the range of thousands and see how Algorithm 1 performs on these instances.
Our experimental methodology is as follows. Choose a constant p h in the range [0.1,0.95] and a constant p l in the range of [0.001,min{p h − 0.01, 0.49}] and generate 100 random graphical degree sequences of length n with largest term around p h n and smallest term around p l n. Each such graphical degree sequence is generated by first uniformly random sampling integer partitions with the specified number of parts n and the specified largest part and smallest part and then accept it as input for Algorithm 1 if it is a graphical degree sequence. We run Algorithm 1 on these random instances and record the average performance and note the proportion of them that are forcibly connected. Table 1 lists the tested p h and p l . The largest tested p l is 0.49 since any graphical degree sequence of length n and smallest term at least 0.5n will cause Algorithm 1 to return True on line 2.
We implemented our Algorithm 1 using C++ and compiled it using g++ with optimization level -O3. The experimental evaluations are performed on a common Linux workstation. We summarize our experimental results for the length n = 1000 as follows.
1. For those instances with p h in the range from 0.1 to 0.5, Algorithm 1 always finishes instantly (run time < 0.01s) and all the tested instances are non forcibly connected. This does not necessarily mean that there are no forcibly connected graphical degree sequences of length n = 1000 with largest term around p h n with p h in this range. It only suggests that forcibly connected graphical degree sequences are relatively rare in this range.
2. For each p h in the range from 0.55 to 0.95, we observed a transition interval I t of p l for each fixed p h . See Table 2 for a list of observed transition intervals. All those instances with p l below the range I t are non forcibly connected and all those instances with p l above the range I t are forcibly connected. Those instances with p l in the range I t exhibit the behavior that the proportion of forcibly connected among all tested 100 instances gradually increases from 0 to 1 as p l increases in the range I t . For example, based on the results of Table 2,   Table 2: Transition interval I t of p l for each p h (for n = 1000). the proportions of forcibly connected graphical degree sequences of length 1000 with largest term around 850 (p h = 0.85) and smallest term below around 10 (p l = 0.01) are close to 0. If the smallest term is above around 70 (p l = 0.07) then the proportion is close to 1. When the smallest term is between 10 and 70 (p l in the range from 0.01 to 0.07) then the proportion transitions from 0 to 1. Again these results should be interpreted as relative frequency instead of absolute law.
3. Algorithm 1 is efficient most of the time but encounters bottlenecks at occasions. For p h from 0.80 to 0.95 and p l near the lower end of the transition interval I t , Algorithm 1 does perform poorly on some of the tested instances with run time from a few seconds to more than a few hours (time out). The exact range of p l near the lower end of I t where Algorithm 1 could perform poorly varies. We observed that this range of p l for which the algorithm could perform poorly is quite narrow. For example, when n = 1000, p h = 0.9, this range of p l we observed is from 0.001 to 0.01. We observed that the frequency at which the algorithm performs poorly also varies. We believe that this is because among all possible instances with given length and given largest and smallest terms there is still great variety in terms of difficulty of testing their property of forcibly connectedness using Algorithm 1. In particular, some instances will trigger the exhaustive behavior of Algorithm 1 on line 12, making it enumerate a lot of candidate decompositions without returning.
We have also performed experimental evaluations of Algorithm 1 for the length n = 2000, 3000, ..., 10000 without being able to finish all the same p h , p l choices as for n = 1000 because of shortage of time. The behavior of Algorithm 1 on inputs of these longer lengths is similar to the case of n = 1000 but with different transition intervals I t and varied range of p l near the lower end of the transition interval I t for which it could perform poorly.
To sum up, we believe that the average case run time of Algorithm 1 is polynomial. We estimate that more than half of all zero-free graphical degree sequences of length n can be tested in constant time on line 1. However, its worst case run time should be exponential. As mentioned above, the computational complexity of the decision problem itself is unknown to us.
Currently we have a very rudimentary implementation of Algorithm 2 and do not have an implementation of Algorithm 3 for any k ≥ 3 yet. Algorithm 2 can start to encounter bottlenecks for input length n around 40 to 50, which is much shorter than the input lengths Algorithm 1 can handle. We suspect that to handle input length n ≥ 100 when k = 3 will be very difficult unless significant enhancement to avoid many of those exhaustive enumerations can be introduced.

Enumerative results
In this section we will present some enumerative results related to forcibly connected graphical degree sequences of given length and forcibly connected graphical partitions of given even integer. We also make some conjectures based on these enumerative results. For the reader's convenience, we summarize the notations used in this section in Table 3.
In a previous manuscript [21] we have presented efficient algorithms for counting the number of graphical degree sequences of length n and the number of graphical degree sequences of k-connected graphs with n vertices (or graphical degree sequences of length n that are potentially k-connected). It is proved there that the asymptotic orders of the number D(n) of zero-free graphical degree sequences of length n and the number D c (n) of potentially connected graphical degree sequences of length n are equivalent. That is, lim n→∞ Dc(n) D(n) = 1. In order to investigate how the number D f (n) of forcibly connected graphical degree sequences of length n grows compared to D(n) we conduct computations to count such graphical degree sequences. We do not have any algorithm that can get the counting result without actually generating the sequences. The fastest algorithm we know of that can generate all zero-free graphical degree sequences of length n is from Ruskey et al [18]. We adapted this algorithm to incorporate the test in Algorithm 1 to count those that are forcibly connected. Since D(n) grows as an exponential function of n based on the bounds given by Burns [4] (4 n /(c 1 n) ≤ D(n) ≤ 4 n /((log n) c 2 √ n)) for all sufficiently large n with c 1 , c 2 positive constants), it is unlikely to get the value of D f (n) for large n using an exhaustive generation algorithm. We only have counting results of D f (n) for n up to 26 due to the long running   Table 4. From the table it seems reasonable to conclude that the proportion D f (n)/D(n) will increase when n ≥ 8 and it might tend to the limit 1.
Since our adapted algorithm from Ruskey et al [18] for computing D f (n) actually generates all forcibly connected graphical degree sequences of length n it is trivial to also output the individual counts based on the degree sum N or the largest degree ∆. That is, we can output the number of forcibly connected graphical degree sequences of length n with degree sum N or largest term ∆. In Table 5 we show itemized potentially and forcibly connected graphical degree sequences of length 7 based on the degree sum N. The counts for N < 12 are not shown because those counts are all 0. The highest degree sum is 42 for any graphical degree sequence of length 7. From the table we see that the individual counts based on the degree sum N that contribute to D c (7) (row C 7 [N]) and D f (7) (row F 7 [N]) both form a unimodal sequence. Counts for other degree sequence lengths from 5 to 26 exhibit similar behavior. Based on the available enumerative results we find that for any given n the range of even N for C n [N] and F n [N] to be nonzero respectively are exactly the same (between 2n − 2 and n(n − 1)). In fact, this can be proved as the following Proposition 4.1. An even N has a potentially connected graphical partition with n parts if and only if it has a forcibly connected graphical partition with n parts.   Proof. Sufficiency is obvious by definition. In the following we show the necessity. Suppose an even N has a potentially connected graphical partition with n parts. From the Wang and Cleitman characterization [20] we know that N must be between 2n − 2 and n(n − 1) for it to have a potentially connected graphical partition of n parts. Now construct a partition π of N with n parts as follows. Let the largest part be n−1 and let the remaining n − 1 parts be as evenly as possible. That is, let b = ⌊ N −n+1 n−1 ⌋ and a = N − (n − 1)(b + 1). Then the smallest n − 1 parts of π consist of a copies of b + 1 and n − 1 − a copies of b. With 2n − 2 ≤ N ≤ n(n − 1), we have 0 < b ≤ n − 1 and 0 ≤ a < n − 1. Based on the Nash-Williams condition it is easy to verify that π is a graphical partition of N with n parts and it is forcibly connected since its largest part is n − 1.
In Table 6 we show itemized numbers of forcibly connected graphical degree sequences of length 15 based on the largest degree. The counts for largest degrees less than 6 are not shown because those counts are all 0. From the table we can see that the counts decrease with the largest degree. For other degree sequence lengths from 5 to 26 we observed similar behavior. The table also indicates that there are no forcibly connected graphical degree sequences of length 15 with largest degree less than 6. In fact, if we define M(n) to be the minimum largest term in any forcibly connected graphical sequence of length n. This is, M(n) . = min{∆: ∆ is the largest term of some forcibly connected graphical degree sequence of length n}. Clearly we have M(n) ≤ n/2 since for even n the sequence n/2, n/2, · · · , n/2 of length n is forcibly connected. We can show a lower bound of M(n) as follows. Proof. For the purpose of deriving a contradiction assume there is a forcibly connected graphical degree sequence ß = (d 1 ≥ d 2 ≥ · · · ≥ d n ) of length n with the largest term Let us first consider the case that n is even. Let ß H be the higher half (of length n/2) of ß and ß L be the lower half (of length n/2) of ß. If both ß H and ß L have even sums, then they can shown to be both graphical degree sequences based on the Nash-Williams condition [17,16,19] as follows. Suppose the Durfee square size of ß is s where s ≤ d 1 = M(n) by the definition of Durfee square. Since ß is graphical it satisfies the Nash-Williams condition, which can be represented as s inequalities: where d ′ 1 , · · · , d ′ s are the largest s parts of the conjugate partition of the partition ß (d ′ 1 = n). Now ß and ß H have the same Durfee square size by our assumption that s = o( √ n) and they have the same s largest parts. Let the s largest parts of the conjugate of ß H be d ′′ 1 , · · · , d ′′ s with d ′′ 1 = n/2 by our construction. To show that ß H is graphical, we only need to show that the following s inequalities hold: The first of these inequalities d ′′ 1 − d 1 = n/2 − M(n) ≥ 1 is clearly satisfied since M(n) = o( √ n). We also have the following inequalities, d ′′ j ≥ s and d j ≤ M(n), j = 2, · · · , s, so we have d ′′ j − d j ≥ s − M(n), j = 2, · · · , s. Even if d ′′ j − d j , j = 2, · · · , s are all negative, their sum will be of order o(n) since s ≤ M(n) = o( √ n). Clearly the s inequalities in (3) are all satisfied since d ′′ 1 − d 1 = n/2 − M(n) is of order Ω(n). This shows that ß H is graphical. By the same argument ß L is graphical and we have found that ß can be decomposed into two sub graphical degree sequences ß H and ß L . This contradicts our assumption that ß is forcibly connected.
If both ß H and ß L have odd sums (we cannot have one of them having even sum and the other having odd sum since the sum of all the terms of ß is even), then it must be the case that both ß H and ß L have an odd number of odd terms. Construct two new sequences ß ′ H and ß ′ L from ß H and ß L by removing the largest odd term from ß L and adding it to ß H . Now clearly ß ′ H and ß ′ L is a decomposition of ß into two sub sequences of length n/2 + 1 and n/2 − 1 respectively and both having even sums. Again they are guaranteed to be graphical degree sequences by the Nash-Williams condition using a similar argument as above, which contradicts the assumption that ß is forcibly connected.
The case for n odd can be proved in a similar way. The conclusion that M(n) cannot be of lower order than √ n then follows.
We do not have any theory or algorithm to efficiently obtain M(n) for any given n. Other than recording the minimum largest term while enumerating all forcibly connected graphical degree sequences of length n, a naive approach would be to let ∆ start from 3 upward and test if there is a forcibly connected graphical degree sequence of length n with largest term ∆ and stop incrementing ∆ when we have found one. Obviously this works but is not efficient. Any efficient algorithm for M(n) might be worthwhile to be added into Algorithm 1 so that it can immediately return False if d 1 < M(n). However, while we conduct performance evaluations of Algorithm 1 we do find that a random graphical degree sequence of length n with d 1 ≤ n/2 most likely can be decided instantly by Algorithm 1. Therefore we believe that an efficient algorithm for M(n) will not help much on average. We show the values of M(n) based on our enumerative results in Table 7. The fact that M(15) = 6 agrees with the results of Table 6 where the counts L 15 [j] = 0 for all j < 6. As a side note, the minimum largest term in any potentially connected graphical sequence of length n is clearly 2 since the degree sequence 2, 2, · · · , 2 (n copies) is potentially connected while 1, 1, · · · , 1 (n copies) is not potentially connected. We also investigated the number g f (n) of forcibly connected graphical partitions of a given even integer n. There is a highly efficient Constant Amortized Time (CAT) algorithm of Barnes and Savage [2] to generate all graphical partitions of a given even n. And there are efficient counting algorithms of Barnes and Savage [1] and Kohnert [13] to count the number g(n) of graphical partitions of even n without generating them. It is known from Erdős and Richmond [8] that the number g c (n) of potentially connected graphical partitions of n and g(n) are of equivalent order, i.e. lim n→∞ gc(2n) g(2n) = 1. It is also known from Pittel [14] that the proportion of graphical partitions among all partitions of an integer n tends to 0. Although the order of the number p(n) of unrestricted partitions of n is long known since Hardy and Ramanujan [10], the exact asymptotic order of g(n) is still unknown. We know of no algorithm to count the number g f (n) of forcibly connected graphical partitions of n without generating them. Using a strategy similar to that we employed in computing D f (n), we adapted the algorithm of Barnes and Savage [2] and incorporated the test of forcibly connectedness from Algorithm 1 and then count those that are forcibly connected. The growth of g(n) is quick and we only have numerical results of g f (n) for n up to 170. The results together with the proportion of them in all graphical partitions are listed in Table 8. For the purpose of saving space we only show the results in increments of 10 for n. From the table it seems reasonable to conclude that the proportion g f (n)/g(n) will decrease when n is beyond some small threshold and it might tend to the limit 0.   Like the situation for D f (n) the adapted algorithm from Barnes and Savage [2] to compute g f (n) actually generates all forcibly connected graphical partitions of n so it is trivial to also output the individual counts based on the number of parts or the largest part. In Table 9 we show the individual counts of potentially and forcibly connected graphical partitions of 20 based on the number of parts. Counts for the number of parts less than 5 or greater than 11 are not shown since those counts are all 0. The ranges of the number of parts j for which the number c n [j] of potentially connected graphical partitions of n with j parts and the number f n [j] of forcibly connected graphical partitions of n with j parts are nonzero are exactly the same based on Proposition 4.1. The smallest number of parts j for which c n [j] and f n [j] are both nonzero is the smallest positive integer t(n) such that t(n)(t(n) − 1) ≥ n and this is also the smallest number of parts for which a partition of n with this many parts might be graphical. The largest number of parts j for which c n [j] and f n [j] are both nonzero is n/2 + 1 based on the Wang and Cleitman characterization [20]. In Table 10 we show the individual counts of forcibly connected graphical partitions of 20 based on the largest part. Counts for the largest part less than 3 or greater than 10 are not shown since those counts are all 0. Clearly n/2 is the maximum largest part of any forcibly connected graphical partition of n since n/2, 1, 1, · · · , 1 (n/2 copies of 1) is a forcibly connected graphical partition of n and no graphical partition of n has its largest part greater than n/2. However, similar to the case of M(n), the minimum largest part, m(n), of any forcibly connected graphical partition of n does not seem to be easily obtainable. Clearly m(n) grows at most like √ n since for every large even n it has a graphical partition with about √ n parts and all parts about √ n − 1 and this graphical partition is forcibly connected. In Table 11 we show several values of m(n). They are obtained while we exhaustively generate all graphical partitions of n and keep a record of the minimum largest part. The fact that m(20) = 3 agrees with the results of Table 10 where l 20 [j] = 0 for all j < 3. As a side note, the minimum largest part of any potentially connected graphical partition of n is clearly 2 since 2, 2, · · · , 2 (n/2 copies) is a potentially connected graphical partition of n while 1, 1, · · · , 1 (n copies) is not.

Questions and conjectures
Based on the available enumerative results we ask the following questions and make certain conjectures: 1. What is the growth order of D f (n) relative to D(n)? Note that the exact asymptotic order of D(n) is unknown yet. (Some upper and lower bounds of D(n) are known. See Burns [4]). We conjecture lim n→∞ D f (n) D(n) = 1. That is, almost all zero-free graphical degree sequences of length n are forcibly connected. If this is true, then it is a stronger result than the known result (see [21]) lim n→∞ Dc(n) D(n) = 1 since D f (n) ≤ D c (n) ≤ D(n). Furthermore, we conjecture that D f (n)/D(n) is monotonously increasing when n ≥ 8. Let D c k (n) and D f k (n) denote the number of potentially and forcibly k-connected graphical degree sequences of length n respectively. It is already known from [21] that lim n→∞ D c k (n) D(n) = 1 when k ≥ 2. Clearly we also have lim n→∞ D f k (n) D(n) = 1 when k ≥ 2. What can be said about the relative orders of D c k (n), D f k (n) and D(n) when k ≥ 2?
2. What is the growth order of g f (2n) relative to g(2n)? Note that the exact asymptotic order of g(2n) is unknown yet. We conjecture lim n→∞ g f (2n) g(2n) = 0. That is, almost none of the graphical partitions of 2n are forcibly connected. Furthermore, we conjecture that g f (2n)/g(2n) is monotonously decreasing when n ≥ 5. Let g c k (n) and g f k (n) denote the number of potentially and forcibly k-connected graphical partitions of n respectively. What can be said about the relative orders of g c k (n), g f k (n) and g(n) when k ≥ 2?
3. We conjecture that the numbers of forcibly connected graphical partitions of N with exactly n parts, when N runs through 2n − 2, 2n, · · · , n(n − 1), give a unimodal sequence.
4. Let t(n) be the smallest positive integer such that t(n)(t(n) − 1) ≥ n. We conjecture that the numbers of forcibly connected graphical partitions of n with j parts, when j runs through t(n), t(n) + 1, · · · , n/2 + 1, give a unimodal sequence. 5. What is the growth order of M(n), the minimum largest term in any forcibly connected graphical sequence of length n? Is there a constant C > 0 such that lim n→∞ M (n) n = C? Is there an efficient algorithm to compute M(n)?
6. What is the growth order of m(n), the minimum largest term in any forcibly connected graphical partition of n? Is there a constant C > 0 such that lim n→∞ m(n) √ n = C? Is there an efficient algorithm to compute m(n)?
7. We conjecture that the numbers of forcibly connected graphical partitions of an even n with the largest part exactly ∆, when ∆ runs through m(n), m(n) + 1, · · · , n/2, give a unimodal sequence. 8. We showed all these decision problems to test whether a given graphical degree sequence is forcibly k-connected to be in co-NP for fixed k ≥ 1. Are they co-NP-hard? Is the decision problem for k + 1 inherently harder than for k?

Conclusions
In this paper we presented an efficient algorithm to test whether a given graphical degree sequence is forcibly connected or not and its extensions to test forcibly k-connectedness of graphical degree sequences for fixed k ≥ 2. Through performance evaluations on a wide range of long random graphical degree sequences we demonstrate its average case efficiency and we believe that it runs in polynomial time on average. We then incorporated this testing algorithm into existing algorithms that enumerate zero-free graphical degree sequences of length n and graphical partitions of an even integer n to obtain some enumerative results about the number of forcibly connected graphical degree sequences of length n and forcibly connected graphical partitions of n. We proved some simple observations related to the available numerical results and made several conjectures. We are excited that there are a lot for further research in this direction.