An Efficient Algorithm to Test Potentially Bipartiteness of Graphical Degree Sequences

As a partial answer to a question of Rao, a deterministic and customizable efficient algorithm is presented to test whether an arbitrary graphical degree sequence has a bipartite realization. The algorithm can be configured to run in polynomial time, at the expense of possibly producing an erroneous output on some"yes"instances but with very low error rate.


Introduction
Given an arbitrary graphical degree sequence d d 1 g d 2 g ¥ g d n , let Rd denote the set of all of its non-isomorphic realizations. As usual, let χG and ωG denote the chromatic number and clique number of a finite simple undirected graph G respectively. It is known from Punnim [12] that for any given d the set χG ¢ G b Rd is exactly a set of integers in some interval. Define Xd to be maxχG ¢ G b Rd and χd to be minχG ¢ G b Rd. These two quantities can be interesting for the structural properties of all the graphs in Rd.
Good lower and upper bounds on Xd are known from Dvořák and Mohar [3] in terms of Ωd maxωG ¢ G b Rd, which can be easily computed for any given d using the algorithm from Yin [18]. For example, Xd g Ωd, Xd f 4 5 Ωd 1 5 maxd 1 and Xd f 6 5 Ωd 3 5 . It appears computationally intractable to compute χd for any given zero-free d. In this paper we are concerned with the related, somewhat easier, decision problem of whether χd 2. Clearly, this is equivalent to decide whether d has a bipartite realization, which is actually the first listed unsolved problem in Rao [13] to characterize potentially bipartite graphical degree sequences and which remains unsolved to our knowledge. We will try to design an efficient algorithm to decide whether the answer is "yes" or "no". In case one is interested in an actual bipartite realization when the answer is "yes", then one can construct it easily from what our designed algorithm computes together with other known methods. We will briefly explain this later.
Note that the input d is a single sequence of vertex degrees. A related problem is to decide, given two sequences of positive integers a 1 , a 2 , ¥, a m ; b 1 , b 2 , ¥, b n , where a 1 g a 2 g ¥ g a m and b 1 g b 2 g ¥ g b n and P m i 1 a i P n i 1 b i , whether there is a bipartite graph whose two partite sets have a a 1 , a 2 , ¥, a m and b b 1 , b 2 , ¥, b n as their respective degree sequences. This problem can be easily solved by applying the Gale-Ryser theorem [6,15], which states that the answer is "yes" if and only if for each k 1, . . . , m, which is also equivalent to for each k 1, . . . , n, Using the standard concept of conjugate integer partition in number theory and the dominance relation between a pair of partitions of the same integer, one can easily see that the Gale-Ryser inequalities stated above can be represented in an equivalent and concise way. The conjugate partition p p 1 , p 2 , . . . , p p 1 of a partition p p 1 , p 2 , . . . , p n with p 1 g p 2 g . . . g p n can be defined as p i Sj S1 f j f n, p j g iS for 1 f i f p 1 , which can be verified through the Ferrers diagram of the partition p. Here we use the common definition of dominance (sometimes also called majorization) ordering between two partitions of the same integer: a partition p p 1 , p 2 , ¥ dominates a partition q q 1 , q 2 , ¥, denoted p q or q p, if P ª i 1 p i P ª i 1 q i , P j i 1 p i g P j i 1 q i for each j 1, 2, ¥. By convention, p j 0 for j e p, where p denotes the number of parts in the partition p. The reader may refer to [1,16] for more details about these concepts. With these notations, the Gale-Ryser condition above can be represented as a b or b a . We also use SpS to denote the weight of the partition p, that is, the sum of all the parts of p. The multiplicity of a part p i in a partition p is denoted µp i . Krause [9] gives an alternative proof of the Gale-Ryser theorem, which actually provides a procedure to construct a bipartite realization of any bigraphic pair a, b (i.e. a pair a, b that satisfies the Gale-Ryser condition). If one is interested in a bipartite realization of the input d that is potentially bipartite, this procedure can be used since our designed algorithm will compute a bigraphic pair a, b from the input d in case the algorithm decides the answer is "yes".
The rest of the paper is organized as follows. Section 2 describes the algorithm to decide whether a given d has a bipartite realization. Section 3 gives a time complexity analysis of the algorithm. Section 4 presents some experimental results. Section 5 discusses alternative designs of the algorithm and comments on the complexity of the decision problem. Section 6 concludes with further research directions.

Description of the Algorithm
Clearly, to decide whether any zero-free graphical degree sequence d d 1 g d 2 g ¥ g d n with weight SdS P n i 1 d i has a bipartite realization, we first need to determine whether it has a bipartition into a and b of equal weights SdS~2 (for convenience, we call such bipartitions of d candidate bipartitions). Whether there exists a candidate bipartition can be decided with a standard dynamic programming algorithm for the subset sum problem, which runs in pseudo-polynomial time OnT where n is the number of given integers and T is the target sum to be found. Since every term in d of length n is less than n, our target T SdS~2 is On 2 so this decision can made in On 3 time. In fact, many inputs admit a large number of candidate bipartitions. Now we can see that the decision problem boils down to checking whether d has at least one candidate bipartition a, b that satisfies the Gale-Ryser condition (i.e. a b or b a ).
A naive algorithm can simply enumerate all candidate bipartitions of d and check each of them against the Gale-Ryser condition. Such an algorithm necessarily runs in exponential time in the worst case. Our algorithm is more sophisticated than that. It has two phases. The first phase utilizes up to seven rules that can all be easily checked to reach a conclusion for many inputs so that exhaustive enumeration can be avoided. As a matter of fact, in Section 4 we will show that most of the inputs can be resolved by this phase alone. The second phase is the enumeration phase, in which we perform "brute-force" search in a clever way.
In describing and justifying the seven rules in the first phase, we seek a candidate bipartition of d into the left side a and the right side b in such a way that at least half of the largest terms in d appear in a, without loss of generality. For example, for any input d of length 50 with the largest term 34 whose multiplicity is 5 (i.e. there are exactly 5 copies of 34 in d), we will seek a candidate bipartition such that the left side a contains at least 3 copies of 34. Rule 1. If d does not have a candidate bipartition, then it is not potentially bipartite.
Proof. This rule is obvious. As mentioned above, this rule can be easily implemented through dynamic programming for the PARTITION problem. Proof. Based on Mantel's theorem [10], any simple undirected bipartite graph on n vertices has at most n 2 4 edges. So the degree sum cannot exceed n 2 2 for any d that is potentially bipartite.  Proof. As mentioned in the proof of Rule 3, the left partite set has at most n d 1 vertices.
Clearly, the degree sum SaS of the left side a is impossible to exceed P nd 1 i 1 d i . Therefore, P nd 1 i 1 d i must be at least SdS 2 for d to be potentially bipartite.
, then d is not potentially bipartite.
Proof. As shown in the proof of Rule 3, each of the right side degrees in b is at most n d 1 . Therefore, every degree larger than n d 1 must be in the left side a and the sum of such degrees should not exceed SdS 2 for any d that is potentially bipartite. For the following rule, we will need the concept of residue of a finite simple undirected graph G or a graphical degree sequence d introduced in Favaron et al. [5] and we use RG and Rd to indicate this function. We also use d to denote the complementary graphical degree sequence of d: n 1 d n g n 1 d n1 g ¥ g n 1 d 1 , which is the degree sequence of the complementary graph of any realization of d. The residue Rd of a graphical degree sequence d d 1 g d 2 g ¥ g d n is the number of zeros obtained in the last step by the iterative procedure consisting of deleting the largest term d 1 from d, subtracting 1 from the d 1 following terms (i.e. d 2 , d 3 , . . . , d d 1 1 ) and sorting the new sequence in weakly decreasing order. This iterative procedure is actually Havel and Hakimi's method [8,7] to decide whether an arbitrary weakly decreasing sequence of non-negative integers is a graphical degree sequence, which says the answer is "yes" if and only if a sequence consisting entirely of zeros is obtained in the end. The reader can easily verify the residue of the graphical degree sequence 4, 4, 3, 3, 2, 2 is 2.
Rule 6. If Rd g 3, then d is not potentially bipartite.
Proof. As proved in [5], the residue Rd of a graphical degree sequence d is a lower bound on the independence number of any realization of d. Then clearly Rd is a lower bound on the clique number of any realization of d. The result follows because any graph with a clique of size at least 3 is not bipartite.
The following is a similar rule that uses the concept of Murphy's bound introduced in Murphy [11], denoted βG or βd here, which is also a lower bound on the independence number of any realization G of d. Murphy's bound βd of a graphical degree sequence otherwise.
The reader can verify that Murphy's bound of the graphical degree sequence 6, 6, 5, 5, 3, 2, 2, 2, 1 is 3. Note that both Rd and βd can be calculated easily based on their definitions.
Rule 7. If βd g 3, then d is not potentially bipartite.
If the input d passes the tests of all of the above seven rules and cannot be resolved as a "no" instance, then our algorithm will enter the second phase called the enumeration phase. From Rule 5 we know that by now we must have SdS 2 g P d i end 1 d i . In the special case that equality holds, which means the left side a must contain exactly those degrees that are larger than n d 1 should d be potentially bipartite, our algorithm can immediately stop based on the result of the Gale-Ryser conditional test on this candidate bipartition of d. Otherwise, our algorithm continues with S SdS 2 P d i end 1 d i e 0, which is the sum of the additional degrees that need to be in the left side a besides those that are larger than n d 1 . For convenience, we use a f to denote the subsequence of d consisting of those degrees that are larger than n d 1 . Note that a f is an empty sequence when n g 2d 1 .
The second phase will then enumerate candidate bipartitions of d into a, b by specifying which degrees will be in the left side a, which also automatically specifies b d a. As we already know, we need to choose a subsequence of d a f (i.e. from those degrees in d that are at most n d 1 ) with sum S and concatenate a f with this subsequence of degrees to form a based on the above discussion. Several restrictions regarding a (recall we use a to denote the number of terms in a) can be put on the left side a for the candidate bipartitions a, b to possibly satisfy the Gale-Ryser conditional test so that our algorithm will enumerate as few candidate bipartitions as possible.
Restriction 1. The number of degrees a in the left side a cannot exceed n d 1 . This is because the right side b contains at least d 1 degrees.
Restriction 2. Let l 1 be the maximum number of degrees in d with sum at most SdS 2 . Then the number of degrees a in the left side a cannot exceed l 1 . This is because the degrees in the left side a must have sum SdS 2 .
Restriction 3. Let d m be the minimum largest degree in any subsequence of d with sum at least SdS 2 . Then the number of degrees a in the left side a must be at least d m . This is because the largest degree in the right side b must be at least d m and the conjugate of a should dominate b.
Restriction 4. Let l 2 be the minimum number of degrees in d with sum at least SdS 2 . Then the number of degrees a in the left side a must be at least l 2 . The reason is similar to that for Restriction 2.
It's not hard to see that d m , l 1 and l 2 can all be easily calculated with greedy algorithms. The above discussion shows we can enumerate all subsequences a of d that satisfies the following three requirements: 1. it includes all degrees in a f (i.e. those degrees in d that are greater than n d 1 ).

it has sum SaS SdS
2 .
3. its number of degrees a should satisfy maxd m , l 2 f a f minn d 1 , l 1 .
In order to find a successful (i.e. satisfying the Gale-Ryser condition) candidate bipartition a, b of d, our intuition is to include a suitable number of large degrees from d a f and as many small degrees of d a f as possible into a without violating the inequalities in requirement 3 mentioned above. In this way b d a will not include many of the largest degrees in d while a will still include enough number of degrees, which makes it more likely for the conjugate of a to dominate b.
Following this intuition we calculate a maximum index x 0 b 1, 2, ¥, n such that a cannot include all d 1 , d 2 , ¥, d x 0 , d x 0 1 in order for its conjugate to dominate b. This index x 0 can be easily calculated as follows. Starting from x 1, if for some x, when we include all d 1 , d 2 , ¥, d x in a and include from d d 1 , d 2 , ¥, d x as many smallest degrees as possible into a while still maintaining the correct sum SaS SdS 2 , and when the number of degrees a in a starts to fall below maxd m , l 2 , then x 0 can be chosen to be x 1.
After x 0 has been calculated, we will try to find out if we can include a subsequence d S of d 1 , d 2 , ¥, d x 0 into a together with some degrees in d d S such that the conjugate of a dominates b. Without loss of generality, this subsequence d S can be chosen to be some largest terms of d 1 , d 2 , ¥, d x 0 . Or, equivalently, we can remove some smallest terms from d 1 , d 2 , ¥, d x 0 one at a time to obtain these subsequences. For each such subsequence 2 , a f f x f x 0 since d S has to include all degrees in a f and we insist that a include at least half of the largest terms of d according to the above discussion, we perform the following two enumerative steps to fully construct a: 1. starting from the largest possible, choose some degree d y from dd S and include some copies of d y into a. We also stipulate that no degree larger than d y from d d S will be included into a. Here d S is defined as follows. If d S includes all µd x copies of d x from d, then d S includes d S together with all copies of the degree from d which is immediately smaller than d x . If d S does not include all µd x copies of d x from d, then d S includes d S together with all the remaining copies of d x from d. The motivation for such a definition is that we don't want d y to equal a degree we have just excluded from a previous consideration of d S when x is being reduced starting from x 0 .
2. include some small terms that are all less than d y from d d S d y into a, where d y is the subsequence of d consisting of all µd y copies of d y . We can generate a number of possible combinations of small terms with each combination summing to a suitable value based on the choice of d S and the choice in the enumerative step (1) and having a suitable number of terms so that a satisfies the inequalities in the above requirement 3. An appropriate procedure can be designed for this purpose such that those combinations with more smaller terms are generated first and each combination can be generated in On time.
Note that both of these steps are enumerative steps.
Step (1) must be exhaustive by trying each possible distinct d y from d d S and each of the possible number of copies up to its multiplicity µd y in d.
Step (2) can be non-exhaustive, which means we can impose a limit l c on the number of possible combinations of small terms to be included into a. This parameter l c is the place where our algorithm is customizable and in reality we can choose l c to be a constant or a low degree polynomial of n. This non-exhaustive enumeration step does open the possibility of our algorithm making an error on some "yes" input instances if the specified limit l c will cause our algorithm to skip some of the possible combinations. However, this step will not introduce any error on "no" input instances. We also note that some of the choices in these two steps can be pruned during the enumerative process to speed up the enumeration phase when they will cause a to fail to satisfy the inequalities in the above requirement 3. In fact, the lower bound on a can be dynamically increased during the process as x is being reduced starting from x 0 so that the largest degree in b dynamically increases.
The reader may have noticed that these enumerative steps are more sophisticated and complicated than the simple naive scheme of enumerating all possible subsequences of d a f with sum S. We will discuss several alternative enumeration schemes later in Section 5. The presented enumeration scheme above is the fastest we found through experiments.
During the enumeration phase, the algorithm will stop and output "yes" if a successful candidate bipartition a, b is found. Otherwise, it will stop enumeration and output "no" when the index x falls below max µd 1 2 , a f . We note that the enumeration phase can be easily parallelized with respect to the different choices of d S . However, it may not be worth it in practice given the good run time performance of the serial version unless the input is long and hard (say when n d e 500).
See the following sections for run time complexity analysis and experimental evaluations.

Analysis of Run Time Complexity
The seven rules in the first phase can all be checked in polynomial time. It can be easily verified that the total run time of these rules is On 3 .
In the second phase, the three quantities d m , l 1 and l 2 can all be computed in On time. The maximum index x 0 can be calculated in On 2 time. The number of choices for d S is On. For each choice of d S , the number of choices for d y and its number of copies to be included in a in the enumerative step (1) is On. The maximum number l c of combinations of the remaining small terms to be included in a in the enumerative step (2) can be chosen to be O1, On, etc. Each combination can be generated in On time. Whenever a full left side a has been constructed, the Gale-Ryser conditional test on the candidate bipartition a, b can be performed in On time. Overall, we can see that the second phase runs in On 5 time when l c is On or On 4 time when l c is O1. Note this run time complexity is achieved at the expense of the algorithm possibly producing an erroneous output on some "yes" instances due to the fact that when l c is limited the enumerative step (2) may skip some candidate bipartitions a, b. However, the observed error rate is so low that we consider the limit on l c worthwhile for the sake of efficiency. On the other hand, if no limit is placed on l c , then our algorithm will always produce a correct output, at the expense of possibly running in exponential time in the worst case.
In summary, our algorithm can be customized to run in polynomial time with satisfactory low error rates (see Section 4 for some evidence of error rates). Also note that it is a deterministic instead of a randomized algorithm.

Experiments
We mainly tested our C++ implementation of the decision algorithm with the parameter l c customized as l c f n d. In certain situations when n is small, unlimited l c is chosen to estimate approximately how large l c should be for the algorithm to make no errors. The implementation is compiled with a reasonably recent g++ compiler with -O3 optimization and tested under typical Linux workstations with at least 16GB memory. We first show the low error rates of the algorithm and then show the good run time performance.

Error Rates
We first demonstrate the somewhat surprising power of the seven rules in the first phase. In Table 1 we show the number rn of all zero-free graphical degree sequences of length n that can be resolved by one of these rules and their proportion among all Dn zero-free graphical degree sequences of length n. Based on the description of the rules, these rn instances that can be resolved in phase one are all "no" instances. The function values rn are obtained through a program that incorporates our decision algorithm into the algorithm to enumerate all degree sequences of a certain length from Ruskey et al. [14]. Let Bn be the number of zero-free potentially bipartite graphical degree sequences of length n. Clearly Bn f Dn rn since some of the "no" instances are resolved in the second phase.
It looks safe to conclude from this table that rn Dn tends to 1 as n grows towards infinity and so Bn Dn tends to 0. Note that these are just empirical observations. Rigorous proofs of the asymptotic orders of these functions or their relative orders might require advanced techniques [17] and are out of our reach at this moment.
In fact, those instances that can be resolved by one of the seven rules are not the only ones that can avoid the enumeration phase of our algorithm. For example, those instances that have S SdS 2 Sa f S 0 can also be resolved immediately following the tests of the seven rules according to our description in Section 2. Next we demonstrate the low error rates of our algorithm. In Table 2 we show the number B w n of all zero-free potentially bipartite graphical degree sequences of length n that will be incorrectly reported as a "no" instance if we set l c 1 (the smallest possible chosen limit on the number of combinations) and their proportion among all Bn zero-free potentially bipartite graphical degree sequences of length n. Even with this smallest possible l c , our algorithm makes very few errors on the "yes" instances. In fact, if we set l c n, then our algorithm makes no error on all zero-free graphical degree sequences of length n f 23.
However, the observed trend suggests that the limit l c need to grow with n for our algorithm to always produce correct outputs. For example, l c must be at least 19 for all instances with n f 23 to be correctly decided and must be at least 91 for n f 28. We do not have more data like this for n g 29 since exhaustive enumeration when n g 29 will become too timeconsuming and we are unable to prove whether there is any polynomial of n to bound l c such that our algorithm can always give correct outputs or the error rate is always below some constant. If l c grows faster than every polynomial of n or is unlimited, then our algorithm could run more than polynomial time in the worst case. Table 2: The number Bn of zero-free potentially bipartite graphical degree sequences of length n, and the number B w n of them that will be misidentified as "no" instances if l c is set to 1. We note that the error rates reported in Table 2 are with respect to the Bn "yes" instances. The error rate will be much lower if they are computed with respect to all Dn zero-free instances of length n because, as we know from Table 1, by far the majority of the "no" instances have already been correctly detected by the seven rules. For example, Bw23 D23 ¤ 1.9 ! 10 6 at the setting of l c 1, which is a lot lower than Bw23 B23 . Plus, increasing l c from O1 to On also further reduces the error rate. For example, Bw23 D23 0 at the setting of l c 23.
Regarding error rates of our algorithm for larger n, say n g 50 or n g 100, we do not have direct numeric estimates. However, we have reason to believe it will still be quite low. See the next subsection.

Run Time Performance
In the last subsection we demonstrated the low error rates of our algorithm mainly through exhaustive testing on inputs with small n. Run time performance test for small n is not informative since each individual input can always be decided almost instantly when n f 50.
For larger n we resort to testing randomly generated instances. Basically, what we observe is that varied inputs might have quite different run times. The run time of our algorithm reported in this subsection are all obtained under the setting of l c n.
We have already shown in Section 3 that our algorithm runs in polynomial time if l c is bounded by a polynomial of n. We want to generate random graphical degree sequences of specified length n, largest term d 1 and smallest term d n . The control of the largest term d 1 and smallest term d n allows us to be able to mainly focus on hard instances since, according to the seven rules used in phase one, random instances with d 1 and d n in certain ranges are more likely to be resolved in phase one, which will be uninteresting since phase one can always be finished almost instantly for n f 500.
Tested random graphical degree sequences are generated by first sampling uniform random integer partitions of specified length n, largest term d 1 and smallest term d n with an adaptation of a sampling algorithm in appendix A of Burns [2]. Such random partitions are then chosen as inputs to our algorithm if they pass the Erdős-Gallai conditional test [4], which is a criterion to decide whether an integer partition is a graphical degree sequence. We do not believe these random inputs to our algorithm will continue to follow the uniform distribution like those before they pass the Erdős-Gallai conditional test. However, they are still varied enough for us to observe a diverse range of run time behavior.
We use an automatic tester program and tested a total of 20000+ random instances. Each single run of the automatic tester program allows us to specify n, d 1 , d n and the number of random instances to test. For a wide range of n f 500, we found that the hardest instances for our algorithm are approximately in the range of 0.5n f d 1 f 0.6n and 1 f d n f 0.1n. The random instances in these ranges are the most likely to cause our algorithm to enter the enumeration phase. However, even the hardest instances we found in our random tests for n f 500 can be finished within about a couple of minutes, which are necessarily those inputs reported as "no" instances that also undergo the entire enumeration phase without any successful candidate bipartition being found. All the tested "no" instances that are decided in the first phase can be finished almost instantly, which agrees with the run time complexity analysis in Section 3. All of the tested "yes" instances detected in the enumeration phase can be decided in at most tens of seconds due to the empirical evidence that most of these "yes" instances have a successful candidate bipartition that can be found even if l c were set to 1 (because our implementation additionally reports the number C of combinations actually used in enumerative step (2) when a successful candidate bipartition is found for a "yes" instance). This further strengths our belief that the algorithm has a low error rate for large n under the setting of l c n because, if a "yes" instance is to be erroneously reported as a "no" instance, the actual number of combinations used in enumerative step (2) must exceed l c n. However, no reported "yes" instance in our tested random inputs with n g 100 was ever observed to use an actual number C of combinations in enumerative step (2) with 1 d C f n, which suggests "yes" instances that require l c e n to be detected by our algorithm are probably quite rare. We do believe that such rare "yes" instances exist. They are only hard to be found through our random generation process.
In summary, our random tests of long inputs not only demonstrate good run time performance of our algorithm, but also give some heuristic evidence that error rates will continue to be low when n becomes large.
We mentioned in Section 2 that our algorithm is customizable through the limit l c in the enumerative step (2). In this section we describe several alternative designs of the enumeration phase that we have considered and their consequences. We also comment on the complexity of the decision problem itself.

Alternative Designs of the Algorithm
We note that the alternative designs we presented here are experimentally verified to be less efficient than the version in Section 2. The reader may skip this part if not interested.
In the enumerative step (1) we have chosen d y from the largest possible value to smallest. Instead, we can choose d y from the smallest possible value to largest. On average, we found that the former has better run time performance.
In the enumerative step (2) we prefer to enumerate the combinations of smallest terms first. Instead, we can choose to enumerate those of largest terms first. On average, we still found that the former has better run time performance.
The enumerative steps (1) and (2) can even be combined into one step to make the enumeration phase simpler. That is, we can exhaustively enumerate all possible combinations of terms from d d S with an appropriate sum subject to the restrictions in the requirement 3 about the number of terms a in a. (Or, to make it more naive, we could exhaustively enumerate all possible combinations of terms from d a f with the sum S.) With these schemes we still face the choice of enumerating largest terms first or smallest terms first. On average, the choice of "smallest terms first" still enjoys better run time performance. However, in order to achieve similar low error rates in these alternative schemes with this choice of "smallest terms first," the limit on the number of combinations to be generated will usually have to be much larger than the chosen limit l c in our design in Section 2, causing these alternatives to have much worse run time performance on those instances that require the second phase to decide. If no limit is placed on the number of combinations to be generated, these alternatives will all produce correct outputs always. Nevertheless, the run time performance could become terrible. For example, for some hard instances with length n from 100 to 300, it could take days to detect a successful candidate bipartition for "yes" instances and tens of days to decide for "no" instances when no limit on l c is imposed, a clear evidence of exponential run time behavior. For longer hard instances in the range 300 f n f 500, these more naive enumeration phases with unlimited l c might take years or longer time to finish.
As mentioned before, our algorithm always produces a correct conclusion for "no" instances. But it could give an incorrect output for some "yes" instances depending on the limit l c set in the enumeration phase. This kind of behavior can be contrasted with some randomized decision algorithms. The error our algorithm might produce is fixed and it comes from the fact that not all potentially bipartite graphical degree sequences exhibit the kind of pattern that can be captured by the particular "limited" enumeration process of our algorithm. Simply put, our algorithm is deterministic. If it makes an error on an "yes" input under a particular setting of l c , it always outputs an erroneous answer on that input under the same setting. If a randomized decision algorithm makes an error on an input, then it could produce a correct output the next time it runs on the same input. And usually the probability of correct output of a randomized decision algorithm is greater than one half and can be analyzed or estimated.

Regarding Problem Complexity
Now we comment on the complexity of the decision problem of potential bipartiteness of graphical degree sequences. It is obviously in N P since a successful candidate bipartition a, b can be verified in polynomial time with the Gale-Ryser condition. We don't know whether it is in co-N P or in P , nor do we know whether it is N P -complete since a reduction to prove its NP-hardness is not found.
In this paper we dealt with the decision problem of whether χd 2. In the case that d is not potentially bipartite (i.e. χd e 2) and it is desired to compute χd, we can decide, for each successive fixed k g 3, whether there is a k-colorable realization of d, until the answer becomes "yes." Each of these decision problems for fixed k g 3 is clearly also in N P and we conjecture them to be N P -complete.

Summary and directions for future research
We presented a fast algorithm to test whether a graphical degree sequence is potentially bipartite. The algorithm works very well in practice. It remains open whether the decision problem can be solved in polynomial time. The complexity of the decision problem of whether χd f k for fixed k g 3 also remains to be resolved.