Hamiltonicity of graphs perturbed by a random regular graph

We study Hamiltonicity and pancyclicity in the graph obtained as the union of a deterministic n$$ n $$ ‐vertex graph H$$ H $$ with δ(H)≥αn$$ \delta (H)\ge \alpha n $$ and a random d$$ d $$ ‐regular graph G$$ G $$ , for d∈{1,2}$$ d\in \left\{1,2\right\} $$ . When G$$ G $$ is a random 2‐regular graph, we prove that a.a.s. H∪G$$ H\cup G $$ is pancyclic for all α∈(0,1]$$ \alpha \in \left(0,1\right] $$ , and also extend our result to a range of sublinear degrees. When G$$ G $$ is a random 1‐regular graph, we prove that a.a.s. H∪G$$ H\cup G $$ is pancyclic for all α∈(2−1,1]$$ \alpha \in \left(\sqrt{2}-1,1\right] $$ , and this result is best possible. Furthermore, we show that this bound on δ(H)$$ \delta (H) $$ is only needed when H$$ H $$ is “far” from containing a perfect matching, as otherwise we can show results analogous to those for random 2‐regular graphs. Our proofs provide polynomial‐time algorithms to find cycles of any length.


I
Two classical areas of research in graph theory are that which deals with extremal results, and that which studies properties of random structures.In the former area, one often looks for sufficient conditions to guarantee that a graph satisfies a certain property.An example of such a result is the well-known Dirac's theorem [16], which states that any graph on ≥ 3 vertices with minimum degree at least /2 contains a Hamilton cycle (that is, a cycle which contains all vertices of ).In the latter, one considers a random structure, chosen according to some distribution, and studies whether it satisfies a given property with sufficiently high probability.For instance, the binomial random graph , (where , is obtained by considering a vertex set of size and adding each of the possible 2 edges with probability and independently of each other) is known to contain a Hamilton cycle asymptotically almost surely (a.a.s.) whenever ≥ (1 + ) log / [23], while if ≤ (1 − ) log / , then a.a.s. the graph is not even connected.
A more recent area of research at the interface of extremal combinatorics and random graph theory is that of randomly perturbed graphs.The general setting is as follows.One considers an arbitrary graph from some class of graphs (usually, given by a minimum degree condition) and a random graph , and asks whether the union of and satisfies a desired property a.a.s.This can be seen as a way to bridge between the two areas described above.Indeed, suppose that is any -vertex graph with minimum degree ( ) ≥ and = , is a binomial random graph (on the same vertex set as ), and consider the property of being Hamiltonian (that is, containing a Hamilton cycle).If ≥ 1/2, then Dirac's theorem guarantees that ∪ is Hamiltonian, for all values of .If, on the other hand, = 0, could be the empty graph, so we are left simply with the random graph .The relevant question, then, is whether, for all ∈ (0, 1/2), any graph with minimum degree is sufficiently 'close' to Hamiltonicity that adding a random graph (which is itself not a.a.s.Hamiltonian) will yield Hamiltonicity.In particular, the goal is to determine whether the range of for which this holds is significantly larger than the range for , itself.
The randomly perturbed graph model was introduced by Bohman, Frieze and Martin [5], who studied precisely the problem of Hamiltonicity.They proved that, for any constant > 0, if is an -vertex graph with ( ) ≥ , then a.a.s.∪ , is Hamiltonian for all ≥ ( )/ .Note, in particular, that this increases the range of given by the random graph model.This result was , O OX2 6GG, U K .E-mail addresses: alberto.espuny-diaz@tu-ilmenau.de, girao@maths.ox.ac.uk.Date: 29th September 2022.This project has received partial funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement no.786198, A. Espuny Díaz).The research leading to these results was also partially supported by the Carl Zeiss Foundation (A.Espuny Díaz) and the EPSRC grant no.EP/N019504/1 (A.Girão) and EPSRC grant no.EP/V007327/1 (A.Girão).
1 very recently generalised by Hahn-Klimroth, Maesaka, Mogge, Mohr and Parczyk [19] to allow to tend to 0 with (that is, to consider graphs which are not dense), similarly improving the range of .In a different direction, the results of Bohman, Frieze and Martin [5] about Hamiltonicity were generalised by Krivelevich, Kwan and Sudakov [24] to pancyclicity, that is, the property of containing cycles of all lengths between 3 and .
Other properties that have been studied in the context of randomly perturbed graphs are, e.g., the existence of powers of Hamilton cycles [2,8,11,17,28], -factors [3,9,10,20], spanning bounded degree trees [7,25] and (almost) unbounded degree trees [22], or general bounded degree spanning graphs [8].The model of randomly perturbed graphs has also been extended to other settings.For instance, Hamiltonicity has been studied in randomly perturbed directed graphs [5,24], hypergraphs [4,12,21,24,27] and subgraphs of the hypercube [13].A common phenomenon in randomly perturbed graphs is that, by considering the union with a dense graph (i.e., with linear degrees), the threshold for the probabilities of different properties is significantly lower than that of the classical , model.In this paper, we study the analogous problem where the random graph that is added to a deterministic graph is a random regular graph (a graph is regular when all its vertices have the same degree).To be more precise, we will consider a given -vertex graph with ( ) ≥ , and we will study the Hamiltonicity and pancyclicity of ∪ , where is a random -regular graph, for some ∈ ℕ.We write , for a graph chosen uniformly at random from the set of all -regular graphs on vertices (we implicitly assume that is even throughout).The model of random regular graphs, though harder to analyse than the binomial model, has been studied thoroughly.In particular, it is a well-known fact that , is a.a.s.Hamiltonian for all 3 ≤ ≤ − 1 [15,26,29,30].It follows that, for all ≥ 3, ∪ , is a.a.s.Hamiltonian independently of , so the problem we consider only becomes relevant for ∈ {1, 2}.For more information about random regular graphs, we recommend the survey of Wormald [31].
It turns out that the behaviour of the problem is quite different in each of these two cases.When we consider = ,2 (also referred to as a random 2-factor), we obtain a result similar to those obtained in the binomial setting: for every constant > 0, if is an -vertex graph with ( ) ≥ , then a.a.s.∪ is Hamiltonian.Even more, we can prove that, in this case, a.a.s.∪ is pancyclic, and also extend the range of for which this holds to some function of which tends to 0. Theorem 1.1.Let = ((log / ) 1/4 ), and let be an -vertex graph with ( ) ≥ . Then, a.a.s.∪ ,2 is pancyclic.
In contrast to this, when we consider = ,1 (that is, a random perfect matching), there is a particular value * < 1/2 such that, for all > * , if is an -vertex graph with ( ) ≥ , then a.a.s.∪ is Hamiltonian.Theorem 1.2.For all > 0, the following holds.Let ≔ (1 + ) ( √ 2 − 1), and let be an -vertex graph with ( ) ≥ .Then, a.a.s.∪ ,1 is pancyclic.This result is best possible.Indeed, for every < √ 2 − 1, there exist graphs with ( ) ≥ such that ∪ ,1 is not a.a.s.Hamiltonian.As we will discuss later (see Section 5), the main extremal construction of for the lower bound is a complete unbalanced bipartite graph.One key feature of this example is that does not contain a very large matching.Indeed, when we further impose that contains an (almost) perfect matching, we can obtain the following result analogous to Theorem 1.1.
The rest of the paper is organised as follows.In Section 2 we present our notation and some preliminary results which will be useful for us, and in Section 3 we prove some properties of ,1 and ,2 regarding their edge distribution and component structure which are crucial for our proofs.We devote Section 4 to proving Theorems 1.1 and 1.3, and defer the proof of Theorem 1.2 to Section 5. Finally, we discuss some possible extensions in Section 6.

Notation. For any
In particular, [0] = .Given any , , ∈ ℝ, we write = ± if ∈ [ − , + ].Whenever we use a hierarchy, the constants are chosen from right to left.To be more precise, when claiming that a statement holds for 0 < ≪ ≤ 1, we mean that it holds for all 0 < ≤ 1 and all 0 < ≤ ( ), for some unspecified non-decreasing function .For our asymptotic statements we often use the standard O notation; when doing so, we always understand that the functions are non-negative.
Throughout this paper, the word graph will refer to simple, undirected graphs.Whenever we consider graphs with loops or parallel edges, we will call them multigraphs.Whenever we consider a (multi)graph on vertices, we implicitly assume that ( ) = [ ] (in particular, all graphs are labelled).
Given any (multi)graph = ( , ) and any two (not necessarily disjoint) sets , ⊆ , we denote the (multi)set of edges of with both endpoints in by ( ), and the (multi)set of edges with one endpoint in and one in by ( , ).If = { } is a singleton, for simplicity we will write ( , ) ≔ ({ }, ), and similarly in the rest of the notation.We denote ( ) ≔ | ( )| and ( , ) ≔ | ( , )|.We write [ ] ≔ ( , ( )) for the subgraph of induced by .If and are disjoint, we write [ , ] ≔ ( ∪ , ( , )) for the bipartite subgraph of induced by and .Given two (multi)graphs and , we write ∪ ≔ ( ( ) ∪ ( ), ( ) ∪ ( )), and if ( ) ⊆ ( ), we write \ ≔ ( ( ), ( ) \ ( )).We denote − ≔ [ \ ].We will write △ ≔ ( ∪ ) \ ( ∩ ) for the symmetric difference of and .We will often abbreviate edges = { , } as = ; recall, however, that edges are sets of vertices, and will be used as such throughout.Given any vertex ∈ , we let ( ) ≔ |{ ∈ : ∈ }| + |{ ∈ : = }| denote its degree in (that is, loops count twice towards the degree of a vertex).We write Δ( ) and ( ) for the maximum and minimum vertex degrees in , respectively.We write ( ) for the neighbourhood of in , that is, the set of vertices ∈ such that ∈ .Given any set ⊆ , we denote ( ) ≔ ∈ ( ).Given any set of edges ′ , we write ( ′ ) ≔ ∈ ′ .A path can be seen as a set of vertices which can be labelled in such a way that there is an edge between any two consecutive vertices.Equivalently, they can be defined by the corresponding set of edges.We will often consider isolated vertices as a degenerate case of paths.If the endpoints of (that is, the first and last vertices, according to the labelling) are and , we often refer to as an ( , )-path.We refer to all vertices of a path which are not its endpoints as internal vertices.The length of a path is equal to the number of edges it contains (the same definition holds for cycles).The distance between two vertices , in a (multi)graph , denoted by dist ( , ), is the length of the shortest ( , )-path ⊆ (if there is no such path, the distance is said to be infinite).Given any two sets of vertices , ⊆ ( ), we define dist ( , ) ≔ min ∈ , ∈ dist ( , ).
Whenever we consider asymptotic statements, we will use the convention of abbreviating a sequence of graphs { } ∈ℕ such that | ( )| → ∞ by simply writing that is an -vertex graph (and implicitly understanding that → ∞).In this setting, we say that an event E holds asymptotically almost surely (a.a.s. for short) if ℙ[E] = 1 − (1).We will ignore rounding issues whenever this does not affect the arguments.

The configuration model.
In order to study random regular graphs, one of the most useful tools is the configuration model, first introduced by Bollobás [6], which gives a process that samples -regular graphs uniformly at random.In its simplest form, the process works as follows.For each ∈ [ ], consider a set of vertices ,1 , . . ., , .Then, choose a uniformly random perfect matching covering the set ) where, for each edge , ′ , ′ ∈ , an edge ′ is added to (if = ′ , this creates a loop).For any ∈ [ ], we will refer to { , : ∈ [ ]} as the extended set of .Similarly, for any ⊆ [ ], we will refer to { , : ∈ , ∈ [ ]} as the extended set of .
Whenever we produce a (multi)graph following the process above, we will write ∼ C , .We will write ∼ C * , for the perfect matching such that = ( ).In order to easily distinguish both models, we will refer to ∼ C * , as a configuration.By abusing notation, we will also sometimes write C * , to denote the set of all configurations with parameters and .Observe that, in particular, for every -vertex -regular multigraph , there exists at least one configuration ∈ C * , such that = ( ).Given any two configurations , ′ ∈ C * , , we write The following lemma bounds the probability that certain variables on configurations deviate from their expectation (see, e.g., [14,Lemma 4.3]).Lemma 2.1.Let ∈ ℕ be fixed.Let > 0 and let be a random variable on C * , such that, for every pair of configurations ∼ ′ , we have | ( ) − ( ′ )| ≤ .Then, for all ∈ ℕ,

Whenever sampling
∼ C , , the process described above may yield a multigraph with both loops and parallel edges.(Of course, this does not apply to the case = 1, where we simply generate a uniformly random perfect matching.)However, upon conditioning on the event that is a simple graph, such a graph is a uniformly random -regular graph.The following is by now a well-established fact (see, e.g., [31,

P
We will need to have bounds on the number of components of random 2-factors (note that every 2-regular graph is a union of vertex-disjoint cycles), as well as the number of cycles in the union of a (not necessarily spanning) matching and a random perfect matching.Proof.We are going to generate a multigraph ∼ C ,2 according to the configuration model (for the proof of (ii), this will be conditioned on certain edges being present).For this, it is important to note that a uniformly random perfect matching on any set of 2 vertices (that is, a configuration ∼ C * ,2 ) can be obtained iteratively by choosing edges in steps.For step , let be the set of all vertices which are covered by the edges of the first − 1 steps.Then, choose any vertex ∈ \ , and choose a neighbour ∈ \ ( ∪ { }) for uniformly at random.The choice of in each step of this process can be made arbitrarily.If we generate a random perfect matching on 2 vertices conditioned on given pairs being present in this matching, we can follow the process above starting at step + 1, assuming that the given edges were chosen in the first steps of the process.For our proofs, we are going to generate a uniformly random configuration following this process.
For each ∈ [ ], let be the extended set of , and let ≔

∈ [ ]
. Consider first the proof of (i).In the -th step, the choice of the vertex will be made as follows: if ≥ 2 and for the unique ∈ [ ] such that −1 ∈ we have that | ∩ | = 1, then let be the unique vertex in \ { −1 }; otherwise, let ∈ \ be arbitrary.Roughly speaking, this choice of at each step means that we are revealing the edges of ∼ C ,2 in such a way that we reveal all edges of each connected component of before moving on to the next one.In particular, we only start a new component at step + 1 when the randomly chosen vertex lies in the unique where exactly one vertex had already been picked.Whenever this happens, we say that the process has finished a component at step .
For each ∈ [ ], let be an indicator random variable which takes value 1 whenever the process finishes a component at step , and 0 otherwise.Observe that, since is chosen uniformly at random, for each ∈ [ ] we have that The total number of components of is then given by the sum of these indicator variables.In particular, for sufficiently large it follows that The claim now follows immediately by Markov's inequality and Lemma 2.2.Consider now the proof of (ii).First, extend the given matching into a perfect matching ′ arbitrarily.For each ∈ [ ], let ( ) be the unique ∈ [ ] such that { , } ∈ ′ .Now, consider the extended set and, for each { , } ∈ ′ , add the pair ,1 ,1 to a matching ˜ on , so we have that ( ˜ ) = ′ .We are going to obtain a configuration ′′ ∼ C * ,2 conditioned on containing this matching ˜ .Observe that, since exactly one point in the extended set of each vertex has been covered by ˜ , a random matching on the uncovered points corresponds to a random perfect matching on [ ].In particular, ( ′′ ) may contain some parallel edges (which correspond to 'isolated' edges in ′ ∪ ,1 ), but it cannot contain any loops.
For each ∈ [ ] \ [ /2], the choice of the vertex will be made as follows: if ≥ /2 + 2 and for the unique ∈ [ ] such that −1 ∈ we have that | ( ) ∩ | = 1, let be the unique vertex in ( ) \ ; otherwise, choose arbitrarily.Similarly to the proof of (i), this allows us to count the number of components of ( ′′ ) (and, thus, of ′ ∪ ,1 ).Note that we only start a new component at step + 1 if the randomly chosen lies in the unique (not completely covered) such that ( ) was covered before the choice of .Whenever this happens, we say that the process has finished a component at step .
For each ∈ [ ] \ [ /2], let be a random variable which takes value 1 whenever the process finishes a component at step , and 0 otherwise, and let be the number of components of ( ′′ ).As before, since is chosen uniformly at random, for each ∈ [ ] \ [ /2] we have that and it follows that a.a.s.≤ log 2 .Each of these components is either a cycle or an isolated pair of parallel edges.Finally, ∪ ,1 can be obtained by contracting parallel edges into a single edge and then removing the edges of ′ \ ( ∪ ,1 ) from ( ′′ ), and this never creates any new cycles, so the bound on the number of cycles follows.
In order to bound the number of components of ∪ ,1 , note that the deletion of each edge of ′ \ ( ∪ ,1 ) may create at most one new component.Thus, a.a.s. the number of components of

Remark 3.2. The proof of Lemma 3.1(ii) gives the following simple bound: if is any (not necessarily perfect) matching on
The following edge-distribution property of ,1 and ,2 will also be useful for us.Proof.We will show how to prove the statement when = ,2 ; the other case can be shown in exactly the same way, but avoiding the reference to Lemma 2.2.
Let ′ ∼ C ,2 .Let E be the event that the statement holds for ′ .First, fix some ∈ [ ], let ≔ { ∈ : ′ ( ) ∩ ≠ }, and let ≔ | |.By using the configuration model, for each ∈ and sufficiently large we have that . Now observe that any random variable on -regular multigraphs obtained according to the configuration model can also be seen as a random variable on uniformly random configurations.In particular, since any pair of configurations ∼ ′ are equal except for their edges at four vertices, it follows that, given any two configurations ) .By a union bound over all ∈ [ ] and the bound on in the statement, we conclude that Finally, by applying Lemma 2.2, we have that the statement holds a.a.s. for = ,2 .

R 2-
We can now prove Theorems 1.1 and 1.3 simultaneously.We note that we believe the bound on ( ) in the statements is far from optimal and, thus, we make no effort to optimise the constants throughout.
We will let = ,2 or = ,1 and want to show that ∪ is pancyclic.Our general strategy will be to first construct a special path which can be used to 'absorb' vertices into a given cycle.To be more precise, we will set aside an arbitrary set of vertices of a suitable size and then construct a path which avoids this set of vertices.Furthermore, we will ensure that each of the vertices set aside forms a triangle with one of the edges of (and each of the vertices does this with a different edge).Then, by replacing the corresponding edge of by the path of length 2 that forms the triangle, we can incorporate each of the vertices set aside into the path (thus 'absorbing' the vertex).This will allow us to have some control over the length of the cycles which we can produce.Once we have constructed the special path , we will show that we can find an 'almost' spanning cycle with ⊆ which avoids the vertices that can be absorbed with .We can then use the cycle , together with the set of vertices that we can absorb into , to find cycles of all lengths larger than that of .A similar strategy using will allow us to find all shorter cycles.
Proof of Theorems 1.1 and 1.3.Let = ((log / ) 1/4 ), and let = ,2 or = ,1 , depending on which of the statements we want to prove.Condition on the event that the statements of Lemmas 3.1 and 3.3 hold, which occurs a.a.s., where we apply Lemma 3.3 to the pairs of sets ( ) and ( ) for each pair ( , ) ∈ ( ) × ( ) with = 1/2.Thus, for all ( , ) ∈ ( ) × ( ) we have that ( ) contains at least 2 /2 vertices such that Whenever necessary, for our claims we assume that is sufficiently large.
For each pair of (not necessarily distinct) vertices ( , ) ∈ ( ) × ( ), consider the set This is a set of 'available' edges for ( , ).Throughout the proof, we will use these edges to make alterations on graphs; every time we do so, we will update this set of available edges (in particular, we will always restrict the list to edges of a 'current' graph; this will become clear later in the proof).
For simplicity of notation, whenever we consider an edge ′ from some set ( , ) (or any of their updated versions), we will implicitly assume that ∈ ( ) and ′ ∈ ( ); note, however, that these edges are not really 'oriented' in the definition, and so ′ ∈ ( , ) too.By = .The existence of such edges in each step follows by (4.4) and (4.3).Consider the path ′ (the fact that this is a path follows by the previous choices of edges).Note | ( )| ≤ 4 .Let ′ ≔ ( ) \ { 1 , ′ }.Consider now the graph 0 ≔ ( − ( ′ ∪ )) ∪ or 0 ≔ (( ∪ ) − ( ′ ∪ )) ∪ , depending on the statement we are trying to prove.By Lemma 3.1, this is a union of at most log 2 cycles and at most (1 + (1)) 2 /200 paths, all vertex-disjoint (where we might have degenerate cases where some paths have length 0, that is, they are an isolated vertex).Indeed, note that Lemma 3.1 asserts that the number of components of ,2 or ∪ ,1 is ( 2 ).The removal of each of the vertices in ′ ∪ may increase the number of components by at most one, and | ′ ∪ | ≤ 5 = 2 /200, so the claim follows.Furthermore, after adding the path again, we have that Δ( 0 ) ≤ 2. Indeed, the fact that the endpoints of have degree at most 2 in 0 follows since the first and last edges of lie in ( ).
We will now use the edges of to iteratively combine these paths and cycles into a single cycle ⊆ ( ∪ ) − of length − with ⊆ , which we will later use to obtain a Hamilton cycle (and, indeed, cycles of all lengths).Let ≔ ( ) \ .For each ( , ) ∈ 2 , we update the set of available edges by setting It follows by (4.2) and (4.3) and since | ( ) ∪ | ≤ 5 that Throughout the upcoming process, we will define graphs 1 , . . ., , for some ∈ ℕ, where each one is obtained from the previous by some 'small' alteration.All these graphs will be unions of vertex-disjoint paths and cycles spanning .The process will end when = , that is, when we obtain the desired cycle spanning .For each ∈ [ ], the alteration that we perform on −1 to construct will depend on its structure.We present here a sketch; the full details are given in cases 1 to 3 below.While the current graph −1 contains at least two paths (case 1), we create a new graph with one fewer path and whose number of components does not increase by more than one.If −1 contains exactly one path (case 2), then we either decrease the number of components or make sure that has no paths (while not increasing the number of components).Finally, if −1 contains at least two cycles and no paths (case 3), then we create a graph with one fewer component, but we possibly create a path in the process.It follows from this description that the process must really end (assuming it can be carried out, which we prove later).Indeed, we only apply case 1 while at least two components are paths, and each time reduce the number of paths and do not increase the number of components by more than one.Since 0 contains at most log 2 cycles and at most (1 + (1)) 2 /200 paths, after some number of iterations we will have a graph containing only one path and at most (1 + (1)) 2 /100 cycles.Furthermore, once there is only one path, there will never be more than one again, so we will never apply case 1 again.From this point on, we apply cases 2 or 3 intermittently, as needed, and we always either reduce the number of components of the graph, or make sure that we will reduce this number in the next iteration (while not increasing the number of components now).In particular, this guarantees that every two steps we decrease the number of components.Thus, at some point we will have a unique component.If it is not a cycle, an application of case 2 will yield the desired cycle.
The alterations performed throughout the process will use some of the 'available' edges.For instance, in some cases we will pick two vertices and and an edge ′ ∈ 0 ( , ), and use these to alter the graph.With this alteration, we will remove ′ from −1 (and our process is correct only if ′ ∈ ( −1 )).Thus, for future iterations, we need to remove ′ from the set of 'available' edges 0 ( , ).For all ∈ [ ] and all pairs of vertices , , we will denote by ( , ) a subset of 0 ( , ) which is 'available' for the next iteration.For all ∈ [ ], we will always define as ≔ ( −1 \ 1 ) ∪ 2 , where 1 and 2 are sets of edges of ∪ .Then, for all ( , ) ∈ 2 , we will set ( , ) ≔ −1 ( , ) \ 1 .Thus, we will not write this definition explicitly in each case, as it will follow from the definition of .
Throughout the process, we will assume that some conditions hold.In particular, for all ∈ [ ] 0 we will have Δ( ) ≤ 2 and ⊆ ⊆ ( ∪ ) \ (note that these hold for 0 by definition; for larger values of , they will be a consequence of the specific process which we follow) and, for all ( , ) ∈ 2 , that ( , ) ⊆ and ( , ) and are vertex-disjoint (both of which hold by definition).Note that the conditions that ( , ) ⊆ and Δ( ) ≤ 2 imply (4.3) holds for each ( , ) (which also holds simply by the definition of ( , )); we will keep referring to (4.3) when we wish to use this fact.Furthermore, we will assume that in each step we have it will follow from our process that the number of steps that we perform and the number of edges that become 'unavailable' at each step are small, so that (4.6) holds.
We now provide the details of the process.Let ∈ ℕ and assume we have already defined −1 .If −1 is a cycle of length − (which spans ), we are done.Otherwise, we will want to create a new graph .For this, we will need to consider several cases.
Case 1. Assume at least two of the components of −1 are paths.Let ′ be one of the path components of −1 , and let its endpoints be and .Choose any edge ′ ∈ −1 ( , Depending on the relative position of ′ with respect to ′ , the total number of components will either decrease by one, remain the same, or increase by one.
Case 2. Assume exactly one component of −1 is a path ′ .Let its endpoints be and .Consider the following cases.
Let ′′ be the subpath of ′ whose endpoints are ′′ and ′′ , and let ℓ ≔ dist ′ ( ′′ , ′′ ) be the length of ′′ .By an averaging argument using (4.7), it follows that By (4.6), this guarantees that we can pick an edge 3 3 In this case, if 3 3 ∈ ( ′ ), we turn ′ into a cycle; otherwise, we combine the vertices of ′ and the cycle containing 3 3 into two new cycles.Case 3. Assume all components of −1 are cycles.We consider the following cases.3.1.For each edge ∈ ( −1 ), let be the cycle of −1 which contains this edge.Assume that there exists some ∈ ( −1 ) \ ( ) satisfying that −1 ( , ) ( ).If so, let This combines two cycles into one.3.2.Otherwise, from (4.6), it follows that each cycle of −1 must contain at least 2 /8 vertices.Now let , ∈ \ ( ) be such that and lie in different cycles (note, in particular, that we may pick a vertex in any of the cycles since | ( )| ≤ 4 < 2 /8) and let ′ ∈ −1 ( , ).
Assume without loss of generality that ′ lies in a cycle other than the one containing .By the definition of 0 ( , ), this means that is an edge of joining two of the cycles of −1 .Now let ∈ −1 ( )and let ≔ ( −1 \ { , ′ }) ∪ { }.This combines two cycles into a path.The fact that Δ( ) ≤ 2 follows by the construction in each case, since we only add at most one edge incident to each vertex, and we only do this for vertices which had degree one in −1 or for which we first delete an incident edge.The fact that ⊆ follows since we have made sure not to delete any of the edges of , and ⊆ ( ∪ ) \ since we only add edges of .Now let = be the graph resulting from the above process.The argument that we provided when arguing that the process must end shows that ≤ (1 + (1)) 2 /40, and this implies that (4.6) holds (indeed, observe that in all cases the number of edges which are deleted from each ( , ) is at most 3, so at most (3 + (1)) 2 /40 edges are removed, and the conclusion follows from (4.5)).
By the iterative process above, we have proved the existence of a cycle of length − such that ⊆ .We must now prove that there is a cycle of length , for all 3 ≤ ≤ .Recall that ( , ) ⊆ ( ) \ ( ) for all ( , ) ∈ 2 and (4.6) holds.We split our analysis into three cases.Suppose first that 3 ≤ ≤ 2 /20.In such a case, consider any subpath ′ ⊆ of length − 3, and let its endpoints be and .Now choose any edge ′ ∈ ( , ) such that , ′ ∉ ( ′ ) (the existence of such an edge follows by (4.6) and (4.3)).Then, the union of ′ and the path ′ forms a cycle of length .
Assume next that − ≤ ≤ .Consider a set ⊆ [ ] with | | = + − .In , for each ∈ , replace the edge = ′ by the path ′ .This yields a cycle of the desired length.

R
Let * ≔ √ 2 − 1.We first show that, for any constant < * , there exist -vertex graphs with ( ) = such that ∪ ,1 does not a.a.s.contain a Hamilton cycle.Indeed, let = ( , , ) be a complete unbalanced bipartite graph, where | | = and | | = (1 − ) (so ( ) = for all ∈ ), and let be a perfect matching on the same vertex set as .It is easy to check that a necessary condition for so that ∪ contains a Hamilton cycle is that [ ] contains at least (1 − 2 ) edges.Now, in ,1 , each edge appears with probability 1/( − 1), so The conclusion then follows by Markov's inequality.
In order to prove Theorem 1.2, we first need the following lemma.
Lemma 5.1.Let 1/ ≪ < /2 < 1/4.Let be an -vertex graph with ( ) ≥ which does not contain a matching of size greater than ( − √ )/2.Let be a maximum matching in .Then, the vertex set of can be partitioned into sets • in such a way that the following hold: To prove the statement we will follow an iterative process.We will inductively construct two sequences of sets { 1 } ≥1 and { 2 } ≥1 with 1 , 2 ⊆ and use these to construct the vertex partition.First, for notational purposes we let −1 2 = 0 1 ≔ , and we define 0 2 ≔ ′ .Then, for each ≥ 1, we define Claim 1.For all ∈ [ /2] 0 , the following properties hold.
(i) 1 does not span any edge from .
(ii) 2 is an independent set.
Proof.We proceed by induction on .As a base case, note that (i) holds trivially for 0 1 , we have already established that 0 2 = ′ is an independent set, and (iii) is vacuously true.Now, for some ∈ [ /2 − 1] 0 , assume that the properties in the statement hold for all ∈ [ ] 0 and that we want to show the properties also hold for + 1.Note that (5.1) and property (i) imply that for all ( , ℓ), (5.2) Observe that, if | +1 1 | ≤ 1, then (i) and (ii) hold trivially, and + 1 = for all ≥ 2. Therefore, for the proof of these two properties we may assume that | +1 1 | ≥ 2 and, thus, | 1 | ≥ 2 for all ∈ [ ].In order to prove (i), suppose for a contradiction that +1  1 spans some edge = ∈ .Our aim is to construct a matching larger than .To do so, first note that, by the definition of +1  1 in (5.1), we may find two distinct vertices 2 , 2 ∈ 2 such that 2 , 2 ∈ ( ).We now proceed recursively for ∈ [ ], starting with = and decreasing its value, as follows: ∈ ( ) (which can be done by the definition of 1 ).
In order to prove (ii), we proceed similarly.Suppose for a contradiction that +1 2 is not an independent set and let = +1 ]).We now proceed recursively for ∈ [ + 1], starting with = + 1 and decreasing its value, as follows: ∈ ( ) (which can be done by the definition of 1 ).
We will also use the following observations repeatedly.Remark 5.2 is a trivial observation, while Remarks 5.3 and 5.4 follow from elementary case analyses.Remark 5.2.Let be a graph and consider a bipartition ( ) = ∪ • .Let ⊆ be a path of length at least 5 which does not contain two consecutive edges in or in .Then, for each ∈ { , }, the path contains two distinct vertices , ∈ with dist ( , ) ≤ 3.

Remark 5.3. Let be a union of vertex-disjoint paths and cycles
, where there are paths and cycles.Let 1 , 2 ⊆ be two non-degenerate vertex-disjoint subpaths of .Let be an endpoint of 1 and be an endpoint of 2 , and assume ≔ { , } ∉ ( ).Then, ( \ ( 1 ∪ 2 )) ∪ { } is a union of vertex-disjoint paths and cycles, with at most + 1 non-degenerate paths and at most + 1 cycles.Remark 5.4.Let be a union of vertex-disjoint paths and cycles.Let , , , ′ ∈ ( ) such that 1 ≔ { , }, 2 ≔ { , ′ } ∉ ( ) and and lie in the same cycle C of .Let 1 , 2 , 3 ⊆ be three non-degenerate vertex-disjoint subpaths of such that 1 has as an endpoint, 2 has ′ as an endpoint, and 3 is an ( , )-path.Then, ( \ ( 1 ∪ 2 ∪ 3 )) ∪ { 1 , 2 } may contain a cycle C ′ only if at least one of the following holds: in \ ( 1 ∪ 2 ∪ 3 ), and lie in the same component, or and ′ lie in the same component, or and ′ lie in the same component.
We are finally ready to prove Theorem 1.2.The general idea is similar to the proof of Theorems 1.1 and 1.3, though the details are more involved.We will use Lemma 5.1 to show that satisfies certain properties and combine these with the properties given by Lemmas 3.1 and 3.3.We will then consider the graph given by the union of ,1 and a large matching of , given by Lemma 5.1, and iteratively modify this graph to obtain cycles of all lengths.To achieve this, we will construct a special path which will be used to absorb other vertices, in a similar fashion to the proof of Theorems 1.1 and 1.3, and then find an almost spanning cycle containing .A key difference with respect to that proof is that the iterative process by which we construct is more involved, since the graph we start with is more structured.Another key difference is that, while creating , we will isolate some vertices which cannot be absorbed with ; we need to make sure that these can be absorbed by the cycle itself at a later stage, so that we may find a Hamilton cycle (but these vertices play no role when constructing cycles shorter than ).The properties given by Lemma 5.1 are crucial in proving that our construction works.
Proof of Theorem 1.2.By Theorem 1.3, if contains a matching covering all but ( ) vertices, we are done, so we may assume that the largest matching in covers at most − √ vertices.
A simple algebraic manipulation with (5.4), (5.5) and the definition of shows that (5.9) Using (5.5) it is also easy to check that The bounds in (5.9) and (5.10) are crucial for our proof.
Our goal is to show that we can find cycles of all possible lengths in ∪ 0 = ∪ ; to achieve this, we will need to modify 0 through an algorithm, where we will delete some edges of 0 and add some edges of for each subsequent alteration.The outcome of this process will be an 'almost' spanning cycle , and we will make sure to satisfy certain properties which will allow us to obtain all the desired cycles.
We begin with a high-level sketch of the process.At each step of the algorithm, we always think of the graph as a union of vertex-disjoint paths and cycles; the vertex set can become smaller at each step, though, as we sometimes 'delete' some vertices (which we will need to 'absorb' at the end of the process).We split the process into six steps (see Steps 1-6 below).In Step 1, we simply remove all 'isolated' edges of 0 , since these will not be useful for us.In Step 2 we create an absorbing path ⊆ ∪ 0 that will allow us to incorporate a suitable number of vertices into a cycle; this choice will be used at the end of the process to guarantee that we can construct cycles of all lengths.Crucially, we must make sure that is not modified through the remaining steps of the process.At this point all paths in the graph will have their endpoints in ∪ 2 ∪ (when constructing we may produce new paths, but we make sure that the new endpoints lie in 2 ).We would like to have all their endpoints in 2 ∪ so that we may use in the future, so through Step 3 we will make it so that all endpoints are in 2 ∪ .Step 4 is used to guarantee that does not lie in a cycle; this helps us avoid possible problems in Step 5, where we turn all cycles into paths (making sure that all the resulting endpoints lie in 2 ∪ ).At this point, the graph we are considering is a union of vertexdisjoint paths with all their endpoints in 2 ∪ .Then, using the aforementioned (G2), in Step 6 we can iteratively combine all the paths into a single, 'almost' spanning path containing , which we later turn into an almost spanning cycle containing .The bound given in (5.9) is crucial to prove that the almost spanning path can be constructed.For simplicity of notation, we will always refer to the graph by the same name throughout each of the steps, but the graph is continuously updated in each step of the process.
As already mentioned above, throughout the process we sometimes 'delete' some vertices from the graph.What this means is that they no longer play a role in this process and will not be vertices of the resulting cycle .We will need to ensure that these vertices can later be 'absorbed' into the cycle (some via , and the rest without help from ).We will denote this set of 'deleted' vertices by .We think of these vertices simply as being isolated.Note, however, that not all vertices of 0 that become isolated through the process are added to , as we will still allow some degenerate paths of length 0 to be part of the graph.Thus, we will always explicitly say which vertices are added to (whenever we do this, we mean that these vertices are removed from (the current version of) 0 , so we may keep thinking of 0 as a union of paths and cycles with the desired properties).In particular, we will always think of the graph at any point throughout the process as a graph on vertex set ( ) \ (and, when choosing vertices for any purpose before the end of Step 6, we will always avoid , even if not explicitly stated).
When altering the graph throughout the process, we will often need to use some edges of which are 'available' to us.To keep track of these, we define a set of 'unavailable' edges.In particular, all edges deleted from 0 are automatically added to (so we will not add them explicitly), but some other edges are added to to ensure that our process will work (in particular, to 'protect' throughout the process).Whenever we add edges to without removing them from the graph, we say so explicitly.
Finally, for some of the alterations, given some vertex , we will want to find a neighbour 1 ∈ ( ) ∩ 1 .When using these neighbours, we will want to delete the edge of containing them (this will help us to guarantee that the resulting graph remains a union of disjoint paths and cycles).However, we cannot always delete this edge of (in particular, if it has already been deleted).Therefore, it will be important for us to keep track of those vertices 1 ∈ 1 which we cannot choose at any given step (they are also 'unavailable').We will denote the set of these vertices by .As happens for , we will often update implicitly; in particular, whenever an edge 1 2 ∈ ( ) with 1 ∈ 1 is added to , implicitly or explicitly, 1 is added to .However, we will sometimes explicitly add extra vertices to this set (in particular, to 'protect' ).We remark that and need not be disjoint.
Let us now describe the steps of our process.The fact that the sets , and are updated immediately throughout the iterations in each of the steps is crucial in some of the choices we make below.We also remark that we continually use the fact that the graph we consider is a union of vertex-disjoint paths and cycles, often implicitly.3.4.5.If ∈ 1 , let ′ ∈ ( ) (which must lie in 1 by (B17), (B18), (B20) and (B22)), let * be the other neighbour of ′ ∈ 2 in 1 (which must exist by (B14) and (B15)), and choose some vertex ′′ ∈ ( ( ′ )∩ 1 )\ ( ∪ 1 ( ∪ )∪{ , , * }) (which must exist by (5.7), (B9), (H1), and the value of ).Then, add ′ ′′ to 1 and remove , , ′ and the edge of containing ′′ (which must lie in 1 by the definition of ) from 1 , and add and to .The vertex ( ′′ ) ∈ 2 becomes an endpoint of a path.4. Add and +1 to 1 .Let +1 ≔ ∪ { , } and iterate.Note now that (B9) follows from (A1) and the fact that , and increase their sizes by at most 8 in each step of the process above.This, combined with the at most 3 increase before the process and the value of , immediately yields the bound.(B10) holds trivially by definition.(B11) holds trivially by the definition of +1 , since , ∉ by (B20) and are distinct.(B12) and (B13) hold because, throughout the process, if ∈ 1 ∪ 2 , we delete the edge of containing , which implies the conditions.(B14) follows from the fact that, throughout, we guarantee that all vertices of the graph 1 have degree at most 2: indeed, we make sure to delete one edge incident to each of the vertices that lie in one of the edges which will be added; the only exception to this is case 3.1, in which there is no need to delete edges by (A3) and the fact that the different vertices throughout the process are always distinct.In order to prove (B15), note that all the newly created endpoints lie in 2 , as remarked throughout the process.Furthermore, the edges which are added to the graph in cases 3.3, 3.4.4and 3.4.5 have one of their endpoints in 2 and the other in 1 \ , which by (B12) cannot belong to any of the vertices in ; this guarantees that the different paths consisting of a single edge with ∈ [ − 1] \ {1} do not become part of any longer paths or cycles until the iteration in which −1 −1 is considered.Observe that avoiding the vertex * in cases 3.3, 3.4.4and 3.4.5 is crucial, as otherwise we would create an endpoint in 2 .(B16) follows directly from the process, since every time we create a new endpoint ∈ 2 we do so by deleting the edge of containing , except in case 3.4.2,where we artificially add ( ) to .(B17) holds directly by construction: in the -th iteration, we add two edges, and +1 , which are contained in +1 by definition, and possibly some edges with an endpoint in 1 and the other in 2 (this happens in cases 3.3, 3.4.4and 3.4.5).Now, consider (B18).In case 3.3, the deleted edge is incident to a vertex which is added to +1 ; the same is true for the edge containing in all subcases of case 3.4; by (B17), we are guaranteed that the other edge deleted in case 3.4.5 now satisfies dist ′ 1 ( , ) = 1; the only other case in which one such edge may be deleted is when is contained in a cycle of length at most 8, but here all deleted edges are either incident to +1 or contained in .Finally, (B19) can be checked throughout the process by (B15), (B17) and the choices in cases 3.3, 3.4.4and 3.4.5.
Note also that (B9)-(B13) hold after the last iteration of the process (that is, for = ).Similarly, (B17) and (B19) also hold after the process (that is, replacing 1 by 2 and with = ).These will come in useful later.
Let 2 be the graph resulting from the process above.Let (recall that all these vertices are distinct, as follows from the choices throughout the process).Observe that (B1), (B2) and (B3) hold by definition.In order to prove that (B4) holds, note first that all the edges of must belong to 1 at some point throughout the process, since ( ) ∩ ( ) ⊆ ( ′ 1 ), 1 ( 1 ), ( ) ∈ ( ′ 1 ) and all other edges of are added in the fourth step of the process throughout the different iterations.The fact that none of these edges are deleted throughout the process follows from (B12), (B13) and (B20): indeed, throughout the process, all deleted edges either lie at distance at most 3 from or , so they cannot be incident to by (B20), or they have an endpoint in 1 \ and belong to (where we further ensure that said endpoint cannot be either or ), and therefore cannot be incident to by (B12) and (B13).Note, furthermore, that the edges deleted in cases 3.2, 3.3 and 3.4 for cannot 'interfere' with those deleted for , since in these cases we are guaranteed that dist \{ } ( , ) ≥ 9. (B5) holds by (A2), (B14) and since, by Remark 5.3, the number of paths and cycles does not increase too much throughout the process.Indeed, the number of paths increases by at most 2 due to the deletions before the process, and then by at most 2 due to the deletions throughout the process, and at most 2 new cycles are created overall purposes, when we write ′ ∈ we assume that ∈ ( ) and ′ ∈ ( )).Note that (G1), (5.10) and (F4) imply that | | ≥ 2 .
(5.12) Recall that, by (B3), and are vertex-disjoint.We consider the following three cases.

C
Binomial random graphs and random regular graphs are perhaps the two most studied random graph models.As we have mentioned in the introduction, many results about randomly perturbed graphs have been obtained for the binomial random graph; it thus seems natural to study analogous problems in random regular graphs.We believe it would be interesting to study graphs perturbed by a random graph with a fixed degree sequence as well.Very recently, the first author has also considered Hamiltonicity of graphs perturbed by a random geometric graph [18].Of course, this study should also be extended to other graph properties.
As we have observed, the behaviour of the graph perturbed by , when = 1 and = 2 is quite different.When = 1, we have shown that, if ( ) ≥ with > √ 2 − 1, then a.a.s.∪ ,1 is Hamiltonian, but the same is not necessarily true if < √ 2 − 1.On the other hand, for = 2, we have shown that ∪ ,2 is a.a.s.Hamiltonian for far sparser graphs ( ( ) = ( 3/4 (log ) 1/4 ) suffices).We believe this is far from optimal and should be true for even sparser graphs .We thus propose the following question.Question 6.1.What is the minimum = ( ) such that, for every -vertex graph with ( ) ≥ , a.a.s.∪ ,2 is Hamiltonian?
The only lower bound we can provide for this question is of order log , which is very far from the upper bound given by Theorem 1.1.Indeed, consider an -vertex complete unbalanced bipartite graph = ( , , ) where | | = log /5.It follows by a standard concentration argument (in the proof of Lemma 3.1(i), one can see that the variables are actually independent, hence standard Chernoff bounds are applicable) that a.a.s.,2 [ ] contains at least log /2 cycles.Upon conditioning on this event, it is easy to check that ∪ ,2 does not contain a Hamilton cycle.
From an algorithmic perspective, by retracing our proofs of Theorems 1.1, 1.2 and 1.3 as well as Lemma 5.1, it easily follows that, given an -vertex graph with ( ) ≥ and any -regular graph which satisfies the statements of Lemmas 3.1 and 3.3 (the latter with respect to the sets defined in each of the proofs, which can be checked in polynomial time), there is a polynomial-time algorithm that finds cycles of any given length in ∪ .
One could consider a generalisation of the results we have obtained for random perfect matchings by considering random -factors (where an -factor is a union of vertex-disjoint copies of which together cover the vertex set), for some fixed graph , assuming the necessary divisibility conditions.In general, we believe the behaviour here will be similar to that of random perfect matchings: if is a uniformly random -vertex -factor, there will exist a specific value * = * ( ) ∈ (0, 1/2), independent of , such that, for every > 0, the following hold: • for every -vertex graph with ( ) ≥ (1 + ) * , a.a.s.∪ is Hamiltonian, and • there exists some -vertex graph with ( ) ≥ (1 − ) * such that ∪ is not a.a.s.
Thus, we have that Now observe that, since is a complete bipartite graph, in building a longest cycle, each vertex of can 'absorb' each of the components of [ ].The conclusion is that, if the number of such components is larger than the number of vertices in , then a Hamilton cycle is impossible.That is, a necessary condition for a Hamilton cycle would be that =1 ≤ .
If we consider the expectations (for the lower bound, Markov's inequality provides sufficient concentration), we have that We think the problem might be interesting for other instances of as well.
In a different direction, we also believe the problem could be interesting for hypergraphs.In particular, following work of Altman, Greenhill, Isaev and Ramadurai [1], it is known that for every integer ≥ 2 there exists an (explicit) constant ( ) such that a random -regular -uniform hypergraph ( )  , a.a.s.contains a loose Hamilton cycle if > ( ), and a.a.s.does not contain such a cycle if ≤ ( ).We propose the following question.Question 6.3.Let ≥ 3 be an integer.For each ≤ ( ), for which values of (possibly as a function of ) is it true that for any -vertex -uniform hypergraph with ( ) ≥ −1 we have that a.a.s.∪ ( )  , contains a loose Hamilton cycle?

A
We would like to thank Padraig Condon for nice discussions at an early stage of this project.We are also indebted to the anonymous referees for their helpful comments and suggestions.
(i) A.a.s. the number of components of ,2 is at most log 2 .(ii) Let be any (not necessarily perfect) matching on [ ].Then, a.a.s.∪ ,1 contains at most log 2 cycles, and its number of components is at most /2 − | | + log 2 .

Conjecture 6 . 2 .
For all ≥ 2, we have that * ( ) is the unique real positive solution to the equation+ − 1 = 0.The lower bound for the conjectured value of * ( ) is given by the same extremal example as for perfect matchings, that is, a complete unbalanced bipartite graph.Indeed, consider a complete bipartite graph with parts and , where | | = and | | = (1 − ) , and let be a uniformly random -vertex -factor.We are going to estimate the number of cliques of each size in [ ].For each ∈ [ ], let be the number of components of [ ] which are isomorphic to .Fix a vertex ∈ .For each ∈ [ ], the probability that the component containing in [ ] is isomorphic to is (roughly) given by (