ON THE HAVEL-HAKIMI RESIDUE OF DEGREE SEQUENCES AND ITS RELATION TO THE INDEPENDENCE NUMBER

The Havel-Hakimi residue (or residue) of a graph is the number of zeros left after iteratively applying the Havel-Hakimi algorithm to a degree sequence. Favaron, Mahéo, and Saclé showed that the residue is a lower bound on the independence number. Determining how good of a bound this is remains an open question, including in what cases the bound is realized. This dissertation looks to help answer when the bound is realized by examining the Maxine heuristic, which reduces a graph G, to an independent set of size M(G). It has been shown that given a graph G, M(G) is bounded between the independence number and the residue of a graph. We find a class of graphs characterized by a list of forbidden subgraphs, an improvement on a list from Barrus and Molnar, such that M(G) is equal to the independence number for all graphs in the class. Furthermore, to help understand the relationship between the independence number and the residue, the number of reorderings required in the Havel-Hakimi algorithm is found for all regular sequences. It is known that threshold degree sequences, a well known family of degree sequences, have independence number equal to the residue. This dissertation shows that threshold degree sequences require no reorderings and thus begs the question if the number of reorderings is related to the difference in the bound between the independence number and the residue. Then the cases of one reordering and a maximum number of reorderings is determined and analyzed.


Introduction to graphs
Graph theory is the study of a collection of objects and the connections between said objects, represented by a graph. The popularity of graph theory has increased in the last century because of the wide breadth of applications in mathematics and other disciplines, as most any application can be modeled with a graph.
Note that the contents of this section can be found in any graph theory textbook; in this dissertation Reinhard Diestel's book on graph theory was used [1]. A graph G = (V, E) is a set of edges E, and vertices V , where an edge is an unordered pair of vertices representing a connection between those vertices. In this dissertation we will only consider simple graphs, that is graphs in which there can be no repeated edges and edges must only exist between distinct vertices (i.e. no loops).
Oftentimes results made about simple graphs can be generalized to include graphs that contain multiple edges and loops.
We say that for u, v ∈ V , u and v are adjacent if [u, v] ∈ E (i.e. that a connection between the vertices exists). We will denote adjacency between u and v with u ∼ v and non-adjacency between vertices with u v. The neighborhood of a vertex v ∈ V is the set of adjacent vertices to v, denoted N (v). The size of the neighborhood of v, |N (v)| is said to be the degree of that vertex. Given a set of vertices U ⊆ V , we have that the neighborhood of U , denoted N (U ) is defined to be the set of all vertices of G \ U adjacent to vertices in U . We say that a vertex v dominates a set of vertices U if every vertex in U is adjacent to v. Likewise, a vertex v is isolated from a set of vertices U if every vertex in U is non-adjacent to v.
Oftentimes we will only be interested in a certain part of a graph. We will call the graph H = (V , E ) a subgraph of G = (V, E) if V ⊆ V and E ⊆ E.
Given a specific subset of vertices U ⊆ V , we have the induced subgraph of G on U , denoted G[U ] is the subgraph consisting of the vertex set U and whose edge set consists of elements [u, v] ∈ E such that both u and v are vertices of U .
Sometimes it is useful to describe a graph by subgraphs that are absent. Given a graph H, we say that a graph G is H-free (that is G forbids H) if H is not an induced subgraph of G. Moreover, given a family of graphs S, we say a graph G is S-free if no graph in S appears as an induced subgraph of G.
We will give special names to well known graphs that are used consistently through this dissertation. We will call a path on n vertices (consisting of n − 1 edges) P n and a cycle on n vertices, C n . A graph on n vertices with every possible edge present is known as the complete graph, denoted K n . We will reference a complete set of vertices of a graph as a clique. A bipartite graph is one in which no odd cycle (C 2n−1 ) is present as a subgraph of the graph, and a complete bipartite graph, denoted K m,n is a graph with two sets of vertices of A and B of size m and n respectively with every possible edge between them, but with no edge present within A or B.
The complement of a graph G, denoted G, has the same vertex set as G, but whose edge set is the complement of that of G. So for example, in Figure 1 we can see C 6 and C 6 both pictured.
The independence number of a graph, denoted α(G) is said to be the size of the largest set of pairwise non-adjacent vertices in G. An open problem in graph theory is to find a computationally easy way to determine α(G) for any graph, or to bound α(G) in an optimal way, as finding α(G) is NP-hard [2]. In fact, this open problem can be translated to fit many different parameters of a graph.  . . , v n } (i.e. the list of integers represents the degrees of a graph). The graph corresponding to the degree sequence is said to be a realization of the degree sequence. In this case it is said that the list of integers is graphic. In order for an integer sequence to be graphic, the sum of the entries must be even, as each edge must be counted twice when summing up the degrees. This result is often known as the Handshaking Lemma [1].
Starting in the 1950's, there have been many characterizations of graphic sequences. In this dissertation we will reference those built by Erdős and Gallai [3], Havel [4], and Hakimi [5] and focus specifically on the algorithm constructed independently by Havel and Hakimi, detailed in Section 1. 3.

Theorem 1 (Erdős-Gallai Inequalities [3]).
A list (d 1 , . . . , d n ) of non-negative integers in non-increasing order is graphic if and only if its sum is even and, for each integer k with 1 ≤ k ≤ n, A graphic degree sequence can have more than one realization. One example of this is the degree sequence (2, 2, 2, 1, 1) which has two distinct realizations, shown in Figure 2. Note that for degree sequences with all single digit entries, we will omit the commas, hence (2, 2, 2, 1, 1) will be written as (22211). Figure 2: The two distinct realizations of (22211).
A type of degree sequence that will be studied heavily is a threshold sequence, which is the degree sequence of a threshold graph. There are many characterizations of threshold graphs, but we will define a threshold graph G to be one that can be built by adding a sequence of isolated or dominating vertices to an isolated vertex [6]. Another characterization of threshold sequences involves the Erdős-Gallai inequalities.

The Havel-Hakimi Algorithm
Havel in 1955 [4] and Hakimi in 1962 [5] independently introduced an algorithm used to determine if an integer sequence is graphic or not.  . . , d n ) is a graphic integer sequence.
We will call the reduction of the integer sequence d, seen in Theorem 3, a Havel-Hakimi step. As long as the resulting integer sequence has non-negative entries with positive first entry, we can iterate the Havel-Hakimi step. We will let the i th application of the Havel-Hakimi step on d be labelled as H i (d), and the j th entry of said integer sequence, H i j (d).
After repeated applications of Havel-Hakimi steps, we will eventually return either an integer sequence with negative integers or a sequence of zeros. Since a degree sequence must contain only non-negative entries, if negative entries appear we must have that the original degree sequence is not graphic. Furthermore, a list of zeros is graphic as it can be realized by a set of isolated vertices of degree zero and once we have a list of zeros the algorithm terminates as the first entry is not positive. Thus we have, The residue is of interest because of its connection to the independence number of a graph, α(G). In 1988, the conjecture-making computer program Graffiti [8] proposed the following theorem, Theorem 4 ( [9]). For every graph G, R(G) ≤ α(G).

This result was proven by Favaron et al. in 1991 and improved upon by
Griggs and Kleitman [10], Triesch [11], and Jelen [12] in the 1990's. Determining the independence number is NP-hard [2], but since it takes only O(E) steps to determine the residue where E is the number of edges in a graph, it is of interest to know how well R(G) approximates α(G) and when the bound is realized.
The bound has been shown to be arbitrarily weak by considering the example K n,n , the complete bipartite graph on 2n vertices. The independence number of K n,n is n while the residue is 2. Thus as n gets large, the difference in α(K n,n ) and R(K n,n ) gets large.
It is often useful to consider a graphic realization of a degree sequence in relation to the Havel-Hakimi algorithm. Let G be a realization of a degree sequence d, and let v ∈ V (G Maxine heuristic reduces a graph to an independent set of size M . It has been shown that given a graph G, M is bounded between the independence number and the residue of a graph for any application of the Maxine heuristic. We improve upon a forbidden subgraph classification of graphs such that M is equal to the independence number given by Barrus and Molnar in 2015.

Introduction
We will be considering simple graphs and we will let N (v) represent the neighborhood of a vertex v in a graph, and let u ∼ v represent that u and v are adjacent in the graph. For such a graph G and subset of vertices U in the graph, let G[U ] be the induced subgraph on the set U . For a set of graphs S, a graph G is said to be S-free, if no graph in S appear as an induced subgraph in G. of zeros. The number of these zeros is said to be the residue of the degree sequence, and the residue of a graph G, denoted R(G), is the residue of the degree sequence of G. The residue is of interest because of its connection to the independence number of a graph, α(G). In 1988, the conjecture-making computer program Graffiti [3] proposed the following theorem, For every graph G, R(G) ≤ α(G).

This result was proven by Favaron et al. in 1991 and improved upon by
Griggs and Kleitman [5], Triesch [6], and Jelen [7] in the 1990's. Determining the independence number is NP-hard [8], but since it takes only O(E) steps to determine the residue where E is the number of edges in a graph, it is of interest to know how well R(G) approximates α(G) and when the bound is realized.
To further illustrate the relationship between the residue and the independence number, we can consider the Maxine heuristic, which is the process of iteratively deleting vertices of maximum degree until an independent set of vertices is realized [5]. We will call M the size of the independent set achieved by the Maxine heuristic and note that this is clearly a lower bound on the independence number. Note that the heuristic depends on our choice of deleted vertices and M can vary accordingly.
It was shown by Griggs and Kleitman [5] that Thus if R(G) = α(G) for some G, then every application of the Maxine heuristic must achieve a maximum independent set.
A vertex in a graph is said to have the Havel-Hakimi property if it is of maximum degree and its neighbors are of maximal degree, i.e. the deletion of said vertex corresponds to the reduction in the degree sequence by one step of the Havel-Hakimi algorithm. Not every graph has a vertex with this property, but every degree sequence has a realization that has such a vertex [9]. If at each step of the Maxine heuristic, a vertex with the Havel-Hakimi property is deleted, then R(G) = M . To find when M = α(G) we will consider graphs with certain conditions.
A vertex v in a non-empty graph G is said to have maximum degreeindependence conditions (or MDI conditions) if it is has maximum degree and is a part of every maximum independent set. Also we will say that a non-empty graph G has maximum degree-independence conditions (or MDI conditions), if there exists a vertex v ∈ V (G) that has MDI conditions.
In 2016, Barrus and Molnar found that if a vertex v in G has MDI conditions, then G must contain an induced subgraph of C 4 (the cycle on 4 vertices) containing v or an induced subgraph of P 5 (the path on 5 vertices) with v as the center vertex [10]. From this it can be quickly shown that The Maxine heuristic always produces a maximum independent set when applied to a {C 4 , P 5 }-free graph.

Preliminary lemmas
We will work to strengthen Theorem 7 by examining the case where v with MDI conditions is in an induced copy of C 4 , since C 4 does not have MDI conditions itself. Since we will only strengthen the condition on C 4 , we will assume that all graphs considered have no subgraph isomorphic to P 5 in which the center vertex has MDI conditions. We will call a graph P * 5 -free when referring to the condition that the center vertex must have MDI conditions, as we will not restrict the existence of an induced P 5 in general. We will allude to the aforementioned MDI conditions as the maximum degree condition and independence condition separately. To start, we will prove a few lemmas to reduce our search of induced subgraphs needed to strengthen the C 4 condition.

Lemma 1.
If v ∈ V (G) has MDI conditions and is a part of more than one maximum independent set, then there is a nonempty induced subgraph of G in which v also has MDI conditions and there is only one maximum independent set.

Proof.
Let v belong to maximum independent sets I 1 , I 2 , ..., I n . Then we can consider the subgraph induced by deleting n i=2 I i \ I 1 .
Because v is of maximum degree in G and G is nonempty, v must have a neighbor in G, and since no vertices adjacent to v were deleted, v still has a neighbor and hence G \ n i=2 I i \ I 1 is nonempty as well. Furthermore, the maximum degree condition is not violated since none of the deleted edges were adjacent to v, and there is exactly one maximum independent set in the induced subgraph.
Because of Lemma 1, we will now only consider a graph G with one maximum independent set I including a vertex v such that v has MDI conditions.
where I is the lone maximum independent set. Then G \ {x} has MDI conditions as well. Proof. Deleting x does not change the degree of v and thus the maximum degree condition is unaffected. Furthermore, since x is not in I, the independent set is unaffected as well.
Thus v still has MDI conditions in G \ {x}.
If α(G) = 1, G must be a complete set of vertices, and if there is only one maximum independent set, then G must be an isolated vertex. Furthermore, if α(G) = 2 with unique maximum independent set {u, v}, then N (v) = N (u) must form a clique and thus every element of N (v) must have strictly larger degree than both u and v. Since we require some element of the maximum independent set to have maximum degree, N (v) must be empty and G must be the graph of two isolated vertices. Hence, if G has MDI conditions and α(G) ≤ 2, then every application of the Maxine heuristic vacuously produces a set of size α.
Thus we will now assume that the size of I is 3 and that I = {u, v, w} where v is the vertex with MDI conditions and where v has MDI conditions and x is not adjacent to any other element in I, the maximum independent set, then we have another maximum independent set (I \{v})∪{x}. Thus, in considering an induced subgraph of G of minimal size with MDI conditions and same independence number of G, we only need to consider the vertices in N (v) ∪ I having neighbords in I . We will then partition N (v) into three sets: Q u , Q w , and N . Let Q u and Q w be the sets of vertices in N (v) whose neighbors in I are only u and w respectively. We will call Q = Q u ∪ Q w .
Let N be the set of vertices in N (v) that are adjacent to both u and w. Since the independence number of G must be 3 and I is the unique independent set of size 3, we have that Q u and Q w must have independence number at most 1; hence Q u and Q w are cliques, since otherwise there would exist another independent set of size 3. Similarly, N must have independence number at most 2. Then since G must be P * 5 -free, we have that Q must form a clique as every vertex in Q u must dominate Q w and vice versa as otherwise there exists q u ∈ Q u and q w ∈ Q w non-adjacent; hence {u, q u , v, q w , w} induce P 5 with v as the center vertex. In Figure 3, the sets Q u , Q w , and N are diagrammed, with a bold line signifying that all possible adjacencies are present.   3. |Q | = 2, G[N ∪ Q ] ∼ = P n where the elements of Q are the endpoints of P n in the complement.
Proof. We will first consider the case where |Q| = 0. First note that if |N | = 0, then N (v) is empty and G is only the independent set and we have a contradiction as G has MDI conditions and thus must be nonempty. Thus we will assume that N is non-empty. We have that every vertex in N has at least two non-neighbors in N as Q is empty and every vertex in N is also adjacent to u, v, and w, otherwise v We will next consider the case where |Q| = 1. We will call q the lone vertex in Q. If |N | = 0, then q has larger degree than v, which is a contradiction so we will assume that N is non-empty. Note that every vertex in N has to have at least 2 non-neighbors in N ∪ Q otherwise v is not of maximum degree, as every vertex in N is also adjacent to u, v, and w. If q dominates N then deg(q) > deg(v) which is a contradiction. Thus there exists a non-neighbor of q in N ; call it x 0 , and call the other guaranteed non-neighbor of x 0 , x 1 . Similarly, x 1 is guaranteed to have another non-neighbor in N ∪ Q as x 1 ∈ N and must have at least two nonneighbors in N ∪ Q. If this other non-neighbor is q then we have that {q, x 0 , x 1 } induce C 3 and we are done. Thus we will assume that the other non-neighbor is in N , call it x 2 . Inductively this creates a sequence of non-neighbors in N , {x i }, as each x i must be adjacent to q otherwise we are done as C i+1 is induced on {q, x 1 , . . . , x i }. Furthermore each x i must be adjacent to {x 0 , . . . , x i−2 } otherwise we have an induced copy of C n in N for some n. Since we have a finite graph, this sequence must terminate at x m for some m, and thus we have that x m must be non-adjacent to either q or some vertex in {x 0 , . . . , x m−2 } giving the result.
Finally we will show the result if |Q| ≥ 2. We will proceed by induction on the size of Q. We will now consider the base case where |Q| = 2, calling the two vertices q 1 , q 2 . Note that q 1 ∼ q 2 as Q forms a clique. Similar to the case |Q| = 1, if N is empty then q 1 has strictly larger degree than v which is a contradiction. Thus we will assume that N is non-empty. Each of the vertices in Q has at least one non-neighbor in N ; if they have the same non-neighbor then those three vertices induce the desired P 3 and we are done. Thus we will assume that they have different non-neighbors, call them x 1 and x 2 respectively. If x 1 x 2 , then the four vertices induce the desired P 4 and we are done, so assume that x 1 ∼ x 2 . Each of these vertices has another non-neighbor in N ; if they share a non-neighbor then the five vertices induce the desired P 5 , so assume that x 1 and x 2 have different non-neighbors call them x 3 and x 4 respectively. Inductively, we have that the pair of vertices x 2i+1 , x 2i+2 are the new non-neighbors of x 2i−1 and x 2i . Note that x 2i+1 and x 2i+2 must be adjacent to q 1 and q 2 respectively otherwise there is an induced complement of a cycle and we are done. Furthermore x 2i+1 must be adjacent to each x j for j odd and at most 2i − 3 and x 2i+2 must be adjacent to each x j for j even and at most 2i − 2, otherwise we have an induced complement of a cycle in N .
Then x 2i+1 must be adjacent to each x j for j odd, and x 2i+2 must be adjacent to each x j for j even, otherwise we have the desired induced complement of a path.
We thus have that both x 2i+1 and x 2i+2 must have another non-neighbor in N .
Since we have a finite graph, this process must terminate in either odd indexed or even indexed x's containing a cycle complement, or there being an edge from some vertex x 2j+1 to some vertex x 2k which yields a path-complement hence yielding the result.
We will now show that if |Q| > 2, G has one of the desired induced subgraphs above. We will proceed by induction on |Q|, noting that the base case of |Q| = 2 is done above. Assume the result is true for |Q| < k and consider the case with |Q| = k. We will label the vertices of Q, {q 1 , q 2 , . . . , q k }. Each of these has a nonneighbor in N , call it x i for each q i . Note that these are distinct otherwise we have an induced copy of P 3 with two elements of Q has endpoints in the complement.
Furthermore q i ∼ x j for all i = j as otherwise we have an induced P 4 . Then there exists another non-neighbor of x 1 in N , call it y 1 . We have that • y 1 ∼ q j for all j > 1 otherwise {q 1 , x 1 , y 1 , q j } induce P 4 .
We then have that y 1 must have another non-neighbor in N , call it y 2 . Inductively let y k be the other non-neighbor of y k−1 where each y i for 1 ≤ i < k dominates all preceding vertices except y i−1 . Then we have that • y k ∼ q j for all j > 1, otherwise {q 1 , x 1 , y 1 , . . . , y k , q j } induce P k+3 .
• y k ∼ x j for all j > 1, otherwise {q 1 , x 1 , y 1 , . . . , y k , x j , q j } induce P k+4 • y k ∼ y i for all i < k otherwise inductively there is an induced complement of a cycle.
Thus y k has another non-neighbor in N . Since our graph is finite, this process must terminate and the result holds.

2.4
The case with independence number greater than 3 We will now extend the result to graphs with independence number greater than 3. In this section we will refer to Q as the set of vertices adjacent to v and exactly one other element of the maximum independent set. Furthermore, we will refer to N as the set of vertices adjacent to v and exactly 2 other vertices of the maximum independent set.
Theorem 9. Let G have MDI conditions with α(G) = k such that k > 3. Then the result from Theorem 8 holds as well. Namely that, G has at least one of the following induced subgraphs where Q is a subset of Q and N a subset of N : 3. |Q | = 2, G[N ∪ Q ] ∼ = P n where the elements of Q are the endpoints of P n in the complement.
Proof. We will assume the contrary, that there exists such a graph without the desired induced subgraphs and derive a contradiction.
for some i, j ∈ I . We will first show that Q k−1 must be empty.
Let q ∈ Q k−1 . We will show that q must have at most one non-neighbor in Suppose that q has two such non-neighbors: x and y.
First suppose x ∼ y. If x and y have distinct neighbors in I , call them u and w respectively, such that x w and y u, then {q, x, y} induce P 3 in G u,w .
Otherwise, without loss of generality, (N (x) ∩ I ) ⊆ (N (y) ∩ I ), and we must have that N (x) ∩ I is non-empty, so it contains an element u, and there exists Then suppose that x y. We must have that x and y cannot each have a neighbor in I (say a and b respectively) to which the other is non-adjacent, as otherwise {x, v, y, a, b} would induce P * 5 . Then x and y share a neighbor in I , call it u and note that both x, y cannot belong to Q 1 , as Q 1 forms a clique. Thus, without loss of generality, we can say that y has another neighbor, w, in I , and We thus have that, for each q ∈ Q k−1 , q must have at most one non-neighbor in N (v) \ Q k−1 , and thus must have at least 2 non-neighbors in Q k−1 . As in the proof of Theorem 8, we can arrange a smallest cycle complement of non-neighbors and thus we have an induced C n in G u,w where u, w are some two members of I . This is a contradiction, and thus Q k−1 must be empty.
We will then proceed by induction to show that Q i is empty for 3 ≤ i ≤ k − 1.
We will assume that Q i is empty for all i > , and we will show that Q is empty as well.
Let q ∈ Q , and assume that q has two non-neighbors in N (v) \ Q , call them x and y. If any pair of {x, y, q} have distinct neighbors in I not adjacent to the other vertex, then we have an induced P * 5 , as seen above. Thus we must have that, without loss of generality, (N (x) ∩ I ) ⊆ (N (y) ∩ I ), and since q has the most Then we argue, in the same way as in the base case of Q k−1 , that q can only have at most one non-neighbor in N (v) \ Q .
Thus, q has at least − 1 non-neighbors in Q as Q i is empty for all i > , and as above this means that we have an induced C n , a contradiction. Thus we have that Q must be empty. Hence by induction we have that Q i is empty for all i > 2.
Note that N (v) must be non-empty, as we cannot have an edgeless graph, and Q 2 cannot be empty as Q 1 forms a clique, and each element of Q 1 must have at least one non-neighbor in N (v). Then let q ∈ Q 2 . If q has two non-neighbors in Q 1 , adjacent to distinct u and w respectively in I , then q must also be adjacent to u and w, otherwise we have an induced P * 5 . If q has two non-neighbors in Q 1 both adjacent to u, then those vertices induce P 3 in G u,w where w is any other vertex in I . Thus the three vertices induce P 3 in G u,w where w is any other vertex in I . Then assume that q has exactly one non-neighbor in Q 1 , call it x and a non-neighbor in Q 2 , call it y. We must have that q, y share the same neighbors in I , otherwise we have an induced P * 5 , and likewise the neighbor of x in I is shared by both q and y. We then have that if x y, we have that {x, y, q} induce C 3 .
We will thus assume that x ∼ y.
Then if all q ∈ Q 2 have two non-neighbors in Q 2 , we must have an induced copy of C n in Q 2 . Suppose then that there are two vertices in Q 2 , q and q that have a non-neighbor in Q 1 , and choose these vertices such that the distance between them in Q c 2 is as small as possible. Note that there must exist a chain of vertices in Q 2 such that q q 1 q 2 · · · q , such that q i does not have a non-neighbor in Q 1 . Furthermore, q, q , and q i must share the same neighbors in I , otherwise we have an induced copy of P * 5 . If q and q have the same non-neighbor in Q 1 , call it x, then {x, q, q , q 1 , . . .} induce C n . If q and q have different non-neighbors, x and x in Q 1 , then {x, x , q, q , q 1 , . . .} induce P n . This is a contradiction, and thus for every graph G with conditions and α(G) = k > 3, we have the result.
For ease, we will call the families of induced subgraphs in Theorem 8, F. We wanted to improve the C 4 condition introduced by Barrus and Molnar as C 4 itself was not MDI. By construction, each graph in F is itself MDI alongside P 5 . We then have the immediate corollary, The Maxine heuristic always produces a maximum independent set when applied to a {F, P 5 }-free graph.

Open questions
Barrus and Molnar used their results to show that if a graph is It can be expected that this class of graphs can be expanded with the strengthened conditions shown in this paper. We pose the following open questions/problems: • Can we fully classify the graphs in which the Maxine heuristic produces a maximum independent set?
• What other conditions, other than forbidding MDI conditions, can be considered to guarantee that the Maxine heuristic produces a maximum independent set?
• Can we fully classify the graphs in which the Maxine heuristic produces a graph with an independent set the same size as the residue? Note that graphs with the strong Havel-Hakimi property introduced in [10] are a subset of these graphs.
• Can we fully classify the graphs in which the residue equals the independence number?
List of References Abstract. Given a degree sequence, the Havel-Hakimi algorithm reduces the sequence to a list of R zeroes, where R is deemed the residue of said sequence.
Each step of the algorithm requires that the terms in the degree sequence be listed in non-increasing order, and thus sometimes a reordering of the terms is required.
In this manuscript, the number of reorderings of all regular degree sequences is determined.

Introduction
Given a degree sequence d = (d 1 , d 2 , . . . , d n ), an iterative step in the Havel-Hakimi algorithm, developed independently by Havel [1] and Hakimi [2], reduces d After reordering the terms to be non-increasing, the algorithm iterates until no positive entries are present. The algorithm arose to determine when an integer sequence is graphic: that is a list of integers d is graphic if and only if the Havel-Hakimi algorithm terminates in a list of zeros. The number of these zeros is said to be the residue of the degree sequence, and the residue of a graph G, denoted R(G), is the residue of the degree sequence of G. The residue is of interest because of its connection to the independence number of a graph, α(G). In 1988, the conjecture-making computer program Graffiti [3] proposed the following theorem.

This result was proven by Favaron et al. in 1991 and improved upon by
Griggs and Kleitman [5], Triesch [6], and Jelen [7] in the 1990's. Determining the independence number is NP-hard [8] but since it takes only O(E) steps to determine the residue, where E is the number of edges in a graph, it is of interest to know how well R(G) approximates α(G) and when the bound is realized.
Given two degree sequences, d = (d 1 , . . . , d n ) and e = (e 1 , . . . , e n ) with Regular degree sequences (which are a special case of semi-regular degree are of a simple form and thus are often easier to work with than an arbitrary degree sequence. Because of this and their relation to the majorization partial order and hence Havel-Hakimi residue, this manuscript will focus primarily on regular degree sequences only with the intent that results can be expanded to that of semi-regular degree sequences in general and then arbitrary degree sequences.
During certain iterations of the Havel-Hakimi algorithm, a reordering of the terms must occur in order to ensure that the terms are listed in non-increasing order. Our goal is to track how many reorderings are needed in the Havel-Hakimi algorithm given a certain degree sequence, in particular a regular degree sequence.
For example, consider the Havel-Hakimi steps in reducing (5 14 ) to (0 3 ). Note in Figure 4 that the term in bold is to be laid off and will decrease the underlined terms by 1, a convention that will be used throughout this dissertation.
We will relate the process of the Havel-Hakimi algorithm conducted on a regular degree sequence to the Josephus Problem, which dates back to the 1st  (5 14 ) century. The problem is attributed to Flavius Josephus, and states that forty-one Jews escaped a city-seige and were hiding in a cave. They decided to kill themselves to evade capture, and decided to do so in a way that every third man would be killed by his companions until there was one left. The Josephus problem is stated in a way that given n people, and an integer k < n, in what position will the last remaining man be situated if the k th person is eliminated each time [11].
Similar to the Josephus problem, we will consider a group of n people sitting in a circle with the same objective as the Josephus problem. We can think that each person has been assigned the same positive number a. The first person is eliminated, and the next a people (as that is the label of the person eliminated) have their number reduced by one. The next person is then eliminated and the process repeats, until all members have a label of 0. Consider the example, seen in Figure 5 of fourteen people sitting in a circle with a label of 5 given to all of them. Unlike the Josephus problem, there may be more than one person left at the end. The number of people left at the end will be the residue of the degree sequence (a n ). The cyclic nature of the Josephus problem will be useful as any reordering of a semi-regular degree-sequence can be seen as a cyclic rotation of the degree sequence.
In the Havel-Hakimi algorithm, all terms of maximum degree will be laid off or reduced before any terms of smaller degree as once a term is reduced by one it will not be laid off or reduced again until all other remaining terms are affected. Thus we can think of the laying off/reduction of terms in a graphic regular sequence as cyclically laying off/reducing through the indices [n], in order, until all the terms have been laid off or reduced to zero (akin to the Josephus problem diagrammed in Figure 5).
Managing diagrams as in Figure 4 and Figure 5 is time consuming and impractical for larger ordered degree sequences. We will introduce another diagram that will help identify the number of reorderings in regular degree sequences. In Figure 6, each term of the initial degree sequence corresponds to a column in a table. The columns are headed by the term indices 1, . . . , 14. We represent and record laid off terms during the algorithm in shaded boxes. Then the appropriate number of unshaded boxes following the laid off term correspond to the sequence terms that the algorithm reduces by 1. The column immediately following these corresponds to the next laid off term in the algorithm.
Consider a regular degree sequence d = (a n ) with a > 0, noting that n ≥ a+1.
Let q and r be non-negative integers such that n − 1 = q(a + 1) + r − 1 and 0 ≤ r − 1 ≤ a and hence n = q(a + 1) + r. For the rest of this section, we will refer to the terms d 1 , . . . , d n using two systems of indexing. The terms will continue to be indexed by their subscripts from [n] corresponding to their initial location in the degree sequence. When considering the steps in the Havel-Hakimi algorithm, we will not reorder the terms as to preserve their original indices from {1, . . . , n} and  Figure 6: The Havel-Hakimi algorithm applied to (5 14 ) and the corresponding X a−j sets will retain their index from [n] throughout. For the second indexing system, we will partition the terms d 1 , . . . , d n into q disjoint blocks of a + 1 consecutive terms and one block containing the remaining r terms. If k = q (a+1)+r with 1 ≤ r ≤ a+1, then we will also refer to the k th term d k using the ordered pair (q , r ) as an index.
We will say that the (q , r )-entry has remainder r . The ordered pair indices of d = (a n ) are ordered lexicographically when listed in sequence, and note that in the cyclic reduction interpretation of the Havel-Hakimi algorithm, before a term having index (i, j) is laid off by the Havel-Hakimi algorithm, the terms with indices before (i, j), and not already laid off, will be 1 less than the (i, j)-term and later terms that are not already laid off. Let X a−j be the set of ordered pair indices of terms having value a − j the moment they are laid off for 0 ≤ j ≤ a.
Proof. We will first show the backwards implication. If d 1 is dominating, then in a Havel-Hakimi step, all terms will be reduced by one, hence preserving the non-increasing order. Thus no reordering is needed.
, then d 1 = B will be laid off and the next B terms will be reduced. Since the next B terms are all of the remaining terms with degree B, then the subsequent degree sequence will be ((B − 1) n−1 ), which does not require any reordering as it is a regular degree sequence. Now we will show the forwards implication. If n − 1 > A > B + 1, then there will necessarily be a term of degree B which is not reduced and thus a reordering will be required, as shown below where the term in bold is laid off and the underlined entries are reduced by 1.
If A < B + 1, then there will necessarily be a term of degree B − 1 which is reduced and thus a reordering will be required.
Thus if A = B + 1 and A = n − 1, then we have a reordering and the result follows.
As shown in the proof of Lemma 3 a regular degree sequence will only yield Now we will focus on counting the number of regular sequences that appear in the Havel-Hakimi algorithm. All of the results will involve the division algorithm and modular arithmetic, and we will first need a lemma that relates the greatest common divisor to the division algorithm (that gives n − 1 = q(a + 1) + (r − 1)). Proof. If t and have a common factor, then m and must also have a common factor as we must be able to divide both sides of the equality by that number.
Then the contrapositive of this statement yields the result.
To count the number of regular sequences that appear in the Havel-Hakimi algorithm, we will consider the value of a term at the moment it is deleted; we will determine the structure of X a−j for all 0 ≤ j ≤ a. In Lemma 5 we will show that X a−j has a uniform structure for a fixed j, with the second coordinate of the ordered pair index the same for all entries.
Lemma 5. Suppose that gcd(a + 1, n − 1) = 1 and 0 ≤ j ≤ a. Let x a−j = 1 + (−j(r − 1) mod a + 1), then Proof. We will prove this result by induction on j. Note that by Lemma 4, since gcd(n − 1, a + 1) = 1, we have gcd(r − 1, a + 1) = 1. Consider first the base case of the induction with j = 0 and the first step of the Havel-Hakimi algorithm lays off the (0, 1)-term, so (0, 1) ∈ X a where x a = 1. Since this term has degree a, the next a entries will each be reduced by one, and the next term to be laid off will be the (1, 1)-term. Similarly, we have that the (i, 1)-term will be laid off for all i ∈ {0, . . . , q} as we are laying off terms of degree a each time. Thus . . q} as the next term after the (q, 1)-term to be laid off must necessarily be one that has already been reduced once before, concluding the base case.
Then we will assume that j ≥ 1 and X a− is of the desired form for all < j.
We want to show that every entry in X a−j is of the form (i, x a−j ). We will set k = x a−(j−1) .
Note that if k = a + 1, then the indices (q − 1, k + 1) through (q − 1, a + 1) are omitted. We will show that of the terms corresponding to those indices, j have already been laid off before laying off terms with value a − j (that is in j−1 =0 X a− ), and a − (j − 1) will be reduced by 1. Then since gcd(r − 1, a + 1) = 1, x a− for < j are distinct as, given 1 , for any < j. Thus the next index (0, k − (r − 1)) will be the index of the next term to be laid off, where k − (r − 1) = x a−j as desired.
In referring to the remainders, we will use the notation [y, z] to mean the set of remainders greater than or equal to y and less than or equal to z, noting that all values in [y, z] will be integers. Of the a + 1 indices listed above, observe that those with remainder in [1, r] appear twice, those with remainder in [r + 1, k − r] ∪ [k + 1, a + 1] appear once, and those with remainder in [k − r + 1, k] do not appear. We will call the remainders of the terms already laid off D = {x a− | 0 ≤ ≤ j − 1}, and we will partition D into We will now show that there is a bijective correspondence between M 2 and M 0 . Suppose that there exists an x a−i ∈ M 2 for some 0 < i < j − 1. Then Then, of the next a + 1 entries, j have already been laid off and a − (j − 1) will be reduced yielding (0, k − r + 1) as the index of the next term to be laid off (as it has not already been laid off), and hence (0, k − (r − 1)) ∈ X a−j .
Then in the following (a + 1) entries, j are already laid off and a − j will be reduced giving (1, k − (r − 1)) ∈ X a−j . Similarly we can show that is satisfied for this case.
If k = 2r, then the last entry in X a−(j−1) is (q − 1, k). Consider the ordered pair indices of the next a + 1 terms in d: (q − 1, k + 1), · · · , (q − 1, a + 1), (q, 1) · · · , (q, r), (0, 1) · · · , (0, k − r) . Of the a + 1 indices listed above, observe that those with remainder in [1, k − r] appear twice, those with remainder in [k + 1, a + 1] appear once, and those with remainder in [k − r + 1, k] do not appear. We will call the remainders of the terms already laid off D = {x a− | 0 ≤ ≤ j − 1}, and we will partition D into The same argument works for this case as Case 1, as the only difference is the size of M 1 which does not affect the argument.
Of the a + 1 indices listed above, observe that, those with remainder in [1, k − r] appear twice, those with remainder in [k − r + 1, r] ∪ [k + 1, a + 1] appear once, and those with remainder in [r + 1, k] do not appear. We will call the remainders of the terms already laid off D = {x a− | 0 ≤ ≤ j − 1}, and we will partition D into We will now show that there is a bijective correspondence between M 2 and Then, of the next a + 1 entries, j have already been laid off and a − (j − 1) will be reduced yielding (0, k − r + 1) as the index of the next term to be laid off (as it has not already been laid off), and hence (0, k − (r − 1)) ∈ X a−j .
Then in the following (a + 1) entries, j are already laid off and a − j will be reduced giving (1, k − (r − 1)) ∈ X a−j . Similarly we can show that The result is satisfied for this case.
Of the a + 1 indices listed above, observe that those with remainder in [k + 1, r] appear twice, those with remainder in [1, k] ∪ [r + 1, (a + 1) − (r − k)] appear once, and those with remainder in [(a + 1) − (r − k) + 1, a + 1] do not appear. We will call the remainders of the terms already laid off D = {x a− | 0 ≤ ≤ j − 1}, and we will partition D into We will now show that there is a bijective correspondence between M 2 and Then, of the next a + 1 entries, j have already been laid off and a − (j − 1) will be reduced yielding (0, k − r + 1 mod a + 1) = (0, (a + 1) − (r − k) + 1) as the index of the next term to be laid off (as it has not already been laid off), and Then in the following (a + 1) entries, j are already laid off and a − j will be reduced giving (1, (a + 1) − (r − k) + 1)) ∈ X a−j . Similarly we can show that either depending on if (a + 1) − (r − k) + 1 is less than or equal to r or greater than r. The result is satisfied for this case.
Proof. We will order the terms as described in the proof above, and use the notation for X a−j and x a−j . We will have a new regular degree sequence only after laying off the (q − 1, r + 1)-term, as then the index of the next term to be laid off will be (0, 2) (because r + 1 − (r − 1) ≡ 2 (mod a + 1)). Since (0, 1) is the index of the first term to be laid off, we have that (0, 2) is the index of the first remaining term at this point and thus the degree of all remaining terms are equal to b where Thus we have that 1−(b−1)(r−1) ≡ (r−1)+2 (mod a+1) and hence −b(r−1) ≡ 1 (mod a + 1). Hence a − b ≡ a − (r − 1) −1 (mod a + 1) as desired, noting that this exists as gcd(r − 1, a + 1) = 1.
We will enumerate all terms by their placement in the lexicographic order, that is (0, 1) = 0, (0, 2) = 1, . . ., (q, r) = n − 1. Note that the difference in the lexicographic order between consecutive elements in X a−j is a + 1 for all j, and there are a + 2 terms between the last element of X a−j and the first element of X a−(j+1) (consecutively laid off terms of different degrees) if 0 is preceded by n − 1 in order.
Since we lay off the (0, 1)-term first for every degree sequence, we will then consider only the distance in regards to the remaining n − 1 terms 1, . . . , n − 1.
Note that doing this preserves the difference between consecutive terms within X a−j but changes the number of terms between consecutively laid off terms of different degrees to a + 1 as (0, 1) = 0 was included in the counting previously.
Thus we have that the p th term to be laid off will have index (p − 1)(a + 1) (mod n − 1).
To see the results of Theorem 12, we will examine the degree sequence (4 13 ).
We have that 12 = 7(1) + 5 and hence r − 1 = 5. The inverse of −5 (mod 7) (i.e., −(r − 1) −1 (mod a + 1)) is 4 = k, and the inverse of 7 (mod 12) (i.e., (a + 1) −1 (mod n − 1)) is 7 = (the same values as before). Thus the next regular sequence following (6 13 ) is ((6 − 4) 13−7 ) = (2 5 ). In Theorem 13 we will show that as long as a + 1 and n − 1 are large enough, we can iteratively apply Theorem 12 with the same values of k and . After a certain point (in the preceding example at (2 5 )) we can still apply Theorem 12 but the values of k and will change. Now let's show that this iterative process will yield the same values of k and for large enough (a + 1) and (n − 1).
Theorem 13. Let = (a + 1) −1 (mod n − 1) and k = −(r − 1) −1 (mod a + 1) and let j be the maximum value such that a > jk and n > j . Then in the first j steps of the Havel-Hakimi algorithm, the regular sequences that appear are ((a − ik) n−i ) Proof. We will proceed by induction on i, noting that the base case was considered in Theorem 12, and so we will now assume the result for i and show the result for i + 1.
Next we will show that the remainder of n−1−i (mod a+1−ik) is r −1−iv.

Lemma 6.
Let gcd(a + 1, n − 1) = 1 with (a + 1) ≡ 0 (mod n − 1) where 0 < < n − 1. By Lemma 4, gcd(r − 1, a + 1) = 1 and thus there exists 0 < < a + 1 minimal such that (r − 1)k ≡ 0 (mod a + 1). We have the following Proof. We will first show that the result for (a) follows from the proof of Lemma 5 using induction on j. The only possible issue is if x a−(j−1) = r for some j. That is and j(r − 1) ≡ 0 (mod a + 1). The value of k is minimal such that k(r − 1) ≡ 0 (mod a + 1) and since j < k this cannot happen. Thus the result follows the proof of Lemma 5.
Finally we will show (c). We will again follow the proof of the previous lemma; however, because X a−k does not include the term (0, 2), special care needs to be taken. We will again proceed by induction on j, noting that we can use j = k as the base case (proven above in part (b)) as x a−k = 1−k(r −1)+1 ≡ 2 (mod a+1).
We will assume the result for values less than j and show it is true for j. We will consider the 4 cases as in Lemma 5 based on the relationship between p = x a−(j−1) and r, noting that p = r because x a−(k−1) = r and j is assumed to be at least k + 1.
We will show that of the terms corresponding to those indices, j have already been laid off before laying off terms with value a − j (that is in j−1 =0 X a− ), and a − (j − 1) will be reduced by 1. We then want to show that the next term with index (0, p − (r − 1)) has not already been laid off. If it were, then we would . This would then mean that either (j − i)(r − 1) ≡ 1 (mod a + 1) which cannot happen as r − 1 does not have an inverse modulo a + 1 or (j − i)(r − 1) ≡ 0 (mod a + 1) which cannot happen as j − i < k and k is minimal such that k(r − 1) ≡ 0 (mod a + 1).
Thus the next term with index (0, p − (r − 1)) will be the next term to be laid off, where p − (r − 1) = x a−j as desired.
Of the a + 1 indices listed above, observe that, those with remainder in [1, r] \ {2} appear twice, those with remainder in {2} ∪ [r + 1, p − r] ∪ [p + 1, a + 1] appear once, and those with remainder in [p − r + 1, p] do not appear. We will call the remainders of the terms already laid off D = {x a− | 0 ≤ ≤ j − 1}, and we will partition D into We will now show that there is a bijective correspondence between M 2 and M 0 . Suppose that there exists an x a−i ∈ M 2 for some 0 < i < j − 1. Note that Then, of the next a + 1 entries, j have already been laid off and a − (j − 1) will be reduced yielding p − r + 1 as the remainder of the next term to be laid off (as it has not already been laid off), and hence (0, p − (r − 1)) ∈ X a−j .
Then in the following (a + 1) entries, j are already laid off and a − j will be reduced giving (1, p − (r − 1)) ∈ X a−j . Similarly we can show that is satisfied for this case.
Of the a+1 indices listed above, observe that those with remainder in [1, p−r]\{2} appear twice, those with remainder in {2} ∪ [p + 1, a + 1] appear once, and those with remainder in [p − r + 1, p] do not appear. We will call the remainders of the terms already laid off D = {x a− | 0 ≤ ≤ j − 1}, and we will partition D into The same argument works for this case as in Case 1, as the only difference is the size of M 1 which does not affect the argument.
Of the a+1 indices listed above, observe that those with remainder in [ We will now show that there is a bijective correspondence between M 2 and x a−(j−1) ∈ M 0 , we have that |M 2 | = |M 0 |. Thus we have that number of already laid off terms of the next a + 1 entries is Then, of the next a + 1 entries, j have already been laid off and a − (j − 1) will be reduced yielding p − r + 1 as the remainder of the next term to be laid off (as it has not already been laid off as shown in Case 1), and hence (0, p − (r − 1)) ∈ X a−j .
Then in the following (a + 1) entries, j are already laid off and a − j will be reduced giving (1, p − (r − 1)) ∈ X a−j . Similarly we can show that The result is satisfied for this case.
Of the a + 1 indices listed above, observe that, those with remainder in [p + 1, r] Then since x a ∈ M 2 and x a−(j−1) ∈ M 0 , we have that |M 2 | = |M 0 |.
Thus we have that number of already laid off terms of the next a + 1 entries is Then, of the next a + 1 entries, j have already been laid off and a − (j − 1) will be reduced yielding (a + 1) − (r − p) + 1 as the remainder of the next term to be laid off (as it has not already been laid off as shown in Case 1), and hence Then in the following (a + 1) entries, j are already laid off and a − j will be reduced giving (1, (a + 1) − (r − p) + 1) ∈ X a−j . Similarly we can show that depending on if (a + 1) − (r − p) + 1 is less than or equal to r or greater than r.
The result is satisfied for this case.
Therefore, all cases are satisfied and the result follows by the principle of mathematical induction.
Proof. We will order the terms as described in the proof of Lemma 6, and use the notation for X a−j and x a−j . We will have a new regular degree sequence only after laying off the (q − 1, r + 1)-term, as then the next term to be laid off will have index (0, 2) (since r + 1 − (r − 1) = 2). Because the (0, 1)-term is the first term to be laid off, we have that (0, 2) is the index of the first remaining term at this point (as the (0, 2)-term was not laid off in X a−k even though x a−k = 2) and thus the degree of all remaining terms are equal to a − b where x a−(b−1) ≡ r + 1 (mod a + 1).
We have that if b = 2k, then The previous Lemma showed that all of the x a−j values are unique for j ∈ [0, 2k−1], and thus b = a − 2k as desired.
We will enumerate all terms by their placement in the lexicographic order, that is (0, 1) = 0, (0, 2) = 1,. . ., (q, r) = n − 1. Note that the difference between  ) consecutive elements in X a−j is a+1 for all j, and there are a+2 terms between the last element of X a−j and the first element of X a−(j+1) (consecutively laid off terms of different degrees), except that of X a−(k−1) and X a−k in which the difference is a + 3.
Since the (0, 1)-term is laid off first for every degree sequence, we will then consider only the difference in regards to the remaining n − 1 terms 1, . . . , n − 1.
Note that doing this preserves the difference between consecutive elements within X a−j but changes the number of terms between consecutively laid off terms of different degrees to a + 1 as (0, 1) = 0 was included in the counting previously and a + 2 for X a−(k−1) and X a−k . Thus we have that the p th term to be laid off will have index (p − 2)(a + 1) + (a + 2) ≡ (p − 1)(a + 1) + 1 (mod n − 1).
First consider the case where p = (that is t = 1). We have x a−(k−1) = r and we can find how many terms must be laid off (p ) before laying off the term with index (q, r) = n − 1. From Lemma 6, we have the same differences discussed above (without the exception) and hence (p )(a + 1) ≡ n − 1 hence p = . We then have that p = , and is thus equal to 2 . Thus m ≡ n − 2 as desired. 3.5 The number of reorderings that appear in the Havel-Hakimi algorithm when gcd(a + 1, n − 1) = d Now that we know what the next regular sequence will be in the Havel-Hakimi algorithm, we will now show all regular sequences that appear in the algorithm.
Using this information we will then be able to predict the number of reorderings required in the Havel-Hakimi algorithm.
Lemma 7. Let gcd(a + 1, n − 1) = d with k, ∈ N minimal such that k(r − 1) ≡ 0 (mod a + 1) and (a + 1) ≡ 0 (mod n − 1) and let s, t ∈ N such that (a + 1) = s(n − 1) and k(r − 1) = t(a + 1). Then = n−1 d , s = a+1 d , k = a+1 d , and t = r−1 d . Proof. We have that n−1 d (a + 1) ≡ 0 (mod n − 1) as a+1 d ∈ N, and thus we need to show that n−1 d is minimal. Suppose that < n−1 d . Then (a + 1) < n−1 d (a + 1) = a+1 d (n − 1), hence s < a+1 d . Furthermore, we must have that s(n−1) a+1 = Since gcd n−1 d , a+1 Proof. We will proceed by induction on i, noting that the base case was taken care of in the result above, that being that the next regular sequence that appears in the Havel Hakimi algorithm is ((a − 2k) n−2 ). Then assume that the only regular sequences that appear in the first 2i steps of the Havel-Hakimi algorithm are those of the correct form and show the result for i + 1. We then have that after 2i steps we have the regular degree sequence ((a − 2ik) n−2i ), and we will show that the next regular degree sequence to appear is ((a − 2(i + 1)k) n−2(i+1) ).
Next we will show that the value of minimal such that (a + 1 − 2ik) ≡ 0 (mod n−2i ) is equal to , and the minimal k such that k (r −1) ≡ 0 (mod a+1− 2ik) is equal to k. To do this, first we will show that (a + 1 − 2ik) = s(n − 1 − 2i ), and then we will show that is minimal.
We will now show that is minimal. Assume there exists an such that (a + 1 − 2ik) = s (n − 1 − 2i ) with < and we will show a contradiction. Then Hence s < s = a+1 d . Furthermore, we must have that = a + 1 divides s , and thus s = (a + 1)α for some α ∈ N. However since s = (a + 1)α > a+1 d = s, this is a contradiction and thus = = n−1 d . Next we will show that k(r − 1 − 2it) = t(a + 1 − 2ik), and then we will show that k is minimal.
Next we will show that k is minimal. Assume there exists a k such that k (r − 1 − 2it) = t (a + 1 − 2ik) with t < t and we will show a contradiction. Then Hence t < t = r−1 d . Furthermore, we must have that = r − 1 divides t , and thus t = (r − 1)α for some α ∈ N. However since t = (r − 1)α > r−1 d = t, this is a contradiction and thus k = k = a+1 d . We then have for i < d−1 2 , the next regular sequence is ((a−2(i+1)k) n−2(i+1) ), and the result follows by induction.
Then note in the proof above we have that the d−1 2 th regular sequence to appear in the Havel-Hakimi algorithm is necessarily ((a − (d − 1)k) n−(d−1) ) with 2 ) = 1. Thus to find the rest of the regular degree sequences that appear in the algorithm, we can apply Theorem 13.

Open questions
The goal of understanding the number of reorderings is to understand the difference between the independence number and the residue. This leads to some open questions and possibilities of further research.
• Is there a closed formula for the number of reorderings of all regular degree sequences?
• What are the number of reorderings of semi-regular degree sequences and how does this relate to that of regular degree sequences?
• What are the number of reorderings of an arbitrary degree sequence?

Introduction
Whether or not an integer sequence has a graphic realization or not can be determined by the Erdős-Gallai inequalities: Theorem 16. The number of these zeros is said to be the residue of the degree sequence, and the residue of a graph G, denoted R(G), is the residue of the degree sequence of G.
The residue is of interest because of its connection to the independence number of a graph, α(G). In 1988, the conjecture-making computer program Graffiti [4] proposed the following theorem, Theorem 17. [5] For every graph G, R(G) ≤ α(G).

This result was proven by Favaron et al. in 1991 and improved upon by
Griggs and Kleitman [6], Triesch [7], and Jelen [8] in the 1990's. Determining the independence number is NP-hard, but since it takes only O(E) steps to determine the residue where E is the number of edges in a graph, it is of interest to know how well R(G) approximates α(G) and when the bound is realized.
Given two degree sequences, d = (d 1 , . . . , d n ) and e = (e 1 , . . . , e n ) with After understanding the case of zero reorderings, it is logical to then consider the case of one reordering and to analyze what happens to the difference in the independence number and residue of the degree sequence.
Finally, on the other end of the spectrum, we can consider the case of a maximum number of reorderings. Again, this case can be analyzed to help determine the difference in the bound of the residue and independence number.

Zero reorderings
Theorem 20. A degree sequence has no reorderings in the Havel-Hakimi algorithm if and only if the degree sequence is threshold.
Proof. We will first consider the forward implication and let d = (d 1 , . . . , d n ), with n ≥ 1, be a degree sequence requiring no reorderings in the Havel-Hakimi algorithm and proceed by induction on n. If n = 1, there is only one possible degree sequence, namely (0), which trivially has no reorderings in the Havel-Hakimi algorithm, and is trivially threshold. We will then assume that any degree sequence of length less than n, where n is at least 2, that has no reorderings must be threshold. Since d has no reorderings, H(d) must also not have any reorderings, and by the inductive hypothesis, H(d) must be threshold. From The resulting graph (and hence d) is threshold, and the result follows by induction.
We will now consider the reverse implication and again proceed by induction on n. If n = 1, there is only one degree sequence (0) which is threshold and trivially has no reorderings in the Havel-Hakimi algorithm. Let n ≥ 2 and assume that any degree sequence of length less than n that is threshold must have no reorderings in the Havel-Hakimi algorithm. Let d be a threshold sequence. Since  In this case we must have that d 2 −1 = d b+1 −1, and hence d 2 = d b+1 . Because d n > 1, we have that H(d) i > 0 for all i. Since H(d) is threshold, it satisfies the k th Erdős-Gallai inequality with equality for all k satisfying H(d) k ≥ k − 1. Since If d 1 = n − 1, then there is no reordering which is a contradiction, thus Then from these four types of degree sequences we can build larger degree sequences by appending either vertices with the Havel-Hakimi property or isolated vertices to a realization of the degree sequence. Adding an isolated vertex to a degree sequence with one reordering will not change the number of reorderings as the associated term will always be at the end of the degree sequence. Adding a vertex with the Havel-Hakimi property to a degree sequence with one reordering will also not increase the number of reorderings because the vertex is of maximum degree and all neighbors have degree strictly greater than those of non-neighbors.
Thus, when the associated term is laid off during a step of the Havel-Hakimi algorithm, all terms associated with the neighbors of the vertex with the Havel-Hakimi property will be reduced by one and, hence no reordering is required.
Conversely, consider a degree sequence, d, with one reordering whose first step in

Maximum number of reorderings
On the other end of the spectrum we will investigate the degree sequences with a maximum number of reorderings. The maximum number of steps in the Havel-Hakimi algorithm increases as n increases and thus the maximum number of potential reorderings increases as n increases; thus we will fix a value of n.
Furthermore, as the residue increases, the maximum number of steps in the Havel-Hakimi algorithm decreases, and so the maximum number of potential reorderings will occur when the residue is smallest. However, note that when the residue is one, the degree sequence is threshold and therefore there are no reorderings. So, in order to look at the maximum number of potential reorderings, it is appropriate to look at those with residue 2.
Theorem 22. Given the length of a degree sequence n ≥ 4, and the residue of that degree sequence R = 2, the degree sequence with the maximum number of reorderings is ((n − 2) 2 , (n − 3) n−2 ), ((n − 3) n ) or (2222) (in the case where n = 4) and the maximum number of reorderings is n − 3.

Proof.
A parent of a degree sequence, d, in the Havel-Hakimi algorithm, is a degree sequence in which one step of the Havel-Hakimi algorithm produces d. We will build the necessary degree sequences from (0 2 ) inductively and derive the possible parents in the Havel-Hakimi algorithm that require a reordering, noting that the terminal step of the algorithm necessarily does not have a reordering as (0 2 ) is regular. Moreover, the step producing any regular degree sequence in the Havel-Hakimi algorithm also necessarily does not require a reordering (as the resulting terms are all of the same degree). Then since there are n − 2 steps in Havel-Hakimi algorithm, to reduce to (0 2 ) and the last step does not require a reordering, the maximum number of reorderings is at most n − 3 and we will show equality to yield the result.
The only parents of (0 2 ) are (110) and (211). In order to find possible parents, we must append to the degree sequence a term of degree greater than or equal to that of the maximum degree as otherwise that term would not be laid off in the Havel-Hakimi algorithm. Furthermore, a term appended to the degree sequence having the same maximum degree must be adjacent to only vertices of strictly smaller degree in the corresponding graph, as otherwise a term of larger degree is created which would not be a viable parent in the algorithm.
Furthermore, if a term corresponding to a dominating vertex in a realization is appended to the degree sequence, the first step of the Havel-Hakimi algorithm would necessarily not have a reordering. Thus we will not consider parents produced by appending a term corresponding to a dominating vertex in a realization, as the maximum number of reorderings would then be strictly less than n − 3. A term of degree 2 can be added in two different ways, namely (2220) (adding to the two 1 degree terms, or (2211) (adding to one degree 1 term and the degree zero term). In the case of (2220), a reordering is not required, so a sequence requiring a maximum number of reorderings would not encounter this sequence.
The case of (2211) does require a reordering and can have reorderings in previous steps of the algorithm.
Thus for the length of the degree sequence n > 4, if there is a reordering in every step of the Havel-Hakimi algorithm (expect necessarily for the terminal step) we have that (2211) must be encountered in the algorithm. We will proceed by induction on n, noting that the base case of n ≤ 4 was considered above. We will then assume that in order to have a maximum number of reorderings in the algorithm, ((k − 3) 2 , (k − 4) k−3 ) must be encountered or ((k − 3) k ) is the degree sequence. Then we will show that ((k − 2) 2 , (k − 3) k−2 ) must also be encountered or that ((k − 2) k+1 ) is the degree sequence. Note that the result of a Havel-Hakimi step on a degree sequence with maximum number of reorderings equal to n − 3, will yield a degree sequence with a maximum number of reorderings as every step of the algorithm (except the terminal one) will require a reordering.
Similar to Case 2 above, we could append to the degree sequence either a term of degree k − 2 or k − 3 (noting that adding a term of degree k − 1 would correspond to a dominating vertex in a realization). If we add a term of degree k − 3, it must necessarily be adjacent to all of the vertices of degree k − 4 in the corresponding graph, yielding ((k − 3) k ) as a parent. However, the Havel-Hakimi step producing that degree sequence would not require a reordering and thus unless n = k, ((k − 3) k ) cannot be encountered in the algorithm.
A term of degree k −2 can be appended to the degree sequence in two different ways, namely ((k − 2) 3 , (k − 3) k−4 , (k − 4)) (adding to the two k − 3 degree terms), or ((k − 2) 2 , (k − 3) k−2 ) (adding to only one k − 3 degree term). In the case of ((k − 2) 3 , (k − 3) k−4 , (k − 4)), a reordering is not required in the next Havel-Hakimi step and so we will not consider it as a maximum number of n − 3 reorderings is not possible. The case of ((k − 2) 2 , (k − 3) k−2 ) does require a reordering and can have reorderings in previous steps of the algorithm. The result then follows by the principle of mathematical induction.

Independence number and maximum number of reorderings
We will now look at realizations of the graphs exhibited in Theorem 22. One realization of ((n − 3) n ) is C n , where α(C n ) = 2. Furthermore, since every vertex in a realization must be adjacent to all but 2 vertices, the independence number of a realization can only be three for n ≥ 6, realized by K 3 ∪ C n−3 . For ((n − 2) 2 , (n − 3) n−2 ), one realization is two dominating vertices attached to C n−2 with independence number 2 and another is two dominating vertices attached to K 3 ∪ C n−5 for n ≥ 8 with indepedence number 3. Similar to ((n − 3) n ), the largest independence number possible is 3. Note that in Chapter 2, we also saw C n in the construction of the graphs with Maxine number different than that of the independence number as seen in Theorem 8, all of which have an independence number of 3. The three minimal subgraphs exhibited in this theorem are (i) Three dominating vertices attached to C n−3 , which has a degree sequence of ((n − 3) n ).
(ii) Two dominating vertices attached to C n−3 and one vertex of degree n − 2 adjacent to all but one vertex in C n−3 which has a degree sequence of ((n − 3) n−2 , (n − 4) 2 ).
(iii) One dominating vertex attached to P n−3 and two vertices of degree n − 2 adjacent to all but one of the endpoints in P n−3 which has a degree sequence of ((n − 3) n−2 , (n − 4) 2 ).
In (i), this is the same degree sequence found in Theorem 22, and thus the degree sequence exhibits a maximum number of reorderings. In (ii) and (iii), after one application of the Havel-Hakimi algorithm, which does not require a reordering, produces ((n − 4) n−1 ), which is of the same form as ((n − 3) n ) with one less term. Thus when applying the Havel-Hakimi algorithm, there are one less than the maximum number of reorderings possible. These minimal subgrahs all have a discrepancy in the Maxine number and independence number, and are building blocks for a discrepancy in the residue and independence number.
Theorem 22 can be extended to sequences with residue greater than 2 as well. Although the above result gives the existence of one family of degree sequences with maximum possible reorderings, there are other degree sequences with residue R > 2 that exhibit n − R − 1 reorderings. However, characterizing these degree sequences is difficult. One example of another degree sequence with maximum possible reorderings is (5 14 ) which has been diagrammed in the introduction of Chapter 3.

Open questions
The goal of understanding the number of reorderings of a degree sequence is to understand the difference between the residue and the independence number of a degree sequence which is minimum independence number across all realizations of the degree sequence. This leads to the following open questions and potential future research: