FHCP Challenge Set: The First Set of Structurally Difficult Instances of the Hamiltonian Cycle Problem

02/27/2019 ∙ by Michael Haythorpe, et al. ∙ Flinders University 0

The FHCP Challenge Set, comprising of 1001 instances of Hamiltonian cycle problem, is introduced. This set is the first to contain instances of Hamiltonian cycle problem for which the primary difficulty is the underlying graph structure, rather than simply size. A summary of the kinds of graphs contained in the FHCP Challenge Set is given. A discussion of the results of the FHCP Challenge, a year-long competition to solve all instances of the FHCP Challenge Set first announced at the 59th Annual Meeting for the Australian Mathematical Society, is also included.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

The Hamiltonian cycle problem (HCP) is a, now classical, problem in graph theory which can be stated simply as follows. Given a graph containing vertices, does possess any simple cycles of length ? Such a simple cycle traversing every vertex in the graph is called a Hamiltonian cycle (HC), and graphs which contain at least one HC are called Hamiltonian. Although it was first posed in the 1850s, there has been a modern resurgence of interest in HCP. This has been in part because HCP was among the first problems proved to be NP-complete [34], and also because of its very close relationship with the, even more famous, traveling salesman problem (TSP). Indeed, the latter can be posed as the question of finding a Hamiltonian cycle of optimal length in a weighted graph. For a summary of results on TSP, the interested reader is referred to Lawler et al [35] which also contains a chapter on HCP written by Chvátal.

There are now several efficient heuristics which are capable of solving HCP, including specialised HCP algorithms

[5, 2, 15, 16, 11, 24, 38, 12] as well as TSP algorithms which can be adapted to solve HCP [1, 28]. In addition, there has been a wealth of theoretical discoveries made relating to necessary and sufficient conditions for Hamiltonicity [37, 4, 39], bounds or exact numbers of HCs in certain families of graphs [42, 22], and the smallest non-Hamiltonian graphs satisfying certain properties [30, 31]. HCP is also the subject of several open conjectures [3, 25, 19, 44, 40].

However, despite this vast body of research, there has been almost no attempt made to produce a good set of HCP instances. Such sets are very important for benchmarking purposes, particularly as it is well-known that HCP can be solved in almost linear time for randomly-generated graphs [21]. Indeed, there are good benchmark sets of instances for other important NP-complete problems such as TSP [41], boolean satisfiability [32], and integer programming [23].

There are a few sets of HCP instances that exist in literature and online. The TSPLIB website [41] has a set of nine Hamiltonian instances containing between 1000 and 5000 vertices. The Extended Foster Census [8] contains a set of all 332 graphs, comprising of all known cubic symmetric graphs with less than 1000 vertices. All but five of these instances are Hamiltonian. A page hosted by the University of Kentucky [47] also contains eight instances of HCP with 200 vertices each, four of which are Hamiltonian. However, none of the instances in these various sets are designed to be difficult to solve, and indeed, the most effective algorithms such as Concorde [1], LKH [28] and Snakes and Ladders Heuristic [2] (SLH) are able to solve each of the instances in no more than a few seconds.

In 2015, the FHCP Challenge Set was produced to fill this void, containing 1001 instances of HCP. Since the intention was for the instances to be difficult due to their structure, rather than simply their size, no instances with more than 10000 vertices were included in the set. Every one of the 1001 instances are known to be Hamiltonian. At the 59th Annual Meeting of the Australian Mathematical Society, the FHCP Challenge was announced, in which researchers were given one year to try and solve each of the 1001 instances. A $1001US prize was offered for the first researcher or research team to solve all of the instances, or for the reseacher who could solve the most instances in the case that nobody was able to solve all of them within a year. After twelve months, the prize was won by a two-person team consisting of David Coudert and Nathann Cohen (INRIA, France) who were successful in solving 985 instances.

Although the FHCP Challenge has now concluded, the instances contained in the FHCP Challenge Set are still of interest to researchers who want to benchmark their own HCP heuristics. In this note, a summary of the graphs contained in the FHCP Challenge Set is given, along with a short discussion about which instances proved the most difficult to solve. The FHCP Challenge Set itself, along with a solution for each instance, is available for download at http://fhcp.edu.au/fhcpcs.

2 FHCP Challenge Set

Graphs in the FHCP Challenge Set can be, roughly, divided into four categories, which are listed in detail below. For the most part, their difficulty comes from having relatively few Hamiltonian cycles compared to the size of the graph. However, simply having few Hamiltonian cycles is not sufficient to provide a difficult instance. For example, an arbitrarily large instance of HCP with a single Hamiltonian cycle can be easily produced by starting with a triangle, and iteratively replacing any vertex with a triangle until the desired size is reached. However, good heuristics will be able to solve instances of this type easily, because many edges can be immediately disregarded as “bad” choices, that is, choices which cannot lead to a HC. Difficult instances, then, must be those which have structural properties that prevent the easy identification of bad edges, but such a definition is hard to define precisely. Hence, when building the FHCP Challenge Set, candidate instances were first tested on Concorde, LKH, and SLH to see if any of those algorithms struggled to solve the instance. If it was a difficult instance for at least two of the algorithms, it was included.

The four categories of instances are as follows. In each case, the vertices were randomly relabelled after construction to prevent easy identification.

2.1 Graphs from literature

There are a number of graph families in literature. In many cases, the exact numbers of Hamiltonian cycles in graphs from these families are known. However, practically no attention has been paid to how HCP algorithms perform on these instances. The FHCP Challenge Set included instances from the following families. First, it included generalized Petersen graphs [46] for some values of mod . These instances are known to contain exactly three Hamiltonian cycles. It also included three families of uniquely Hamiltonian graphs, that is, graphs with only a single Hamiltonian cycle. The first was due to Sheehan [43], which contains the maximal number of edges possible for uniquely Hamiltonian graphs. The second is due to Aldred and Thomassen [29] which have average degree converging to 3 as the size of the graphs grow. The third was due to Fleischner [17] which is the only known family of uniquely Hamiltonian graphs with minimum degree 4 described in literature. There were some other families of uniquely Hamiltonian graphs considered, e.g. see [14], but these were disregarded as all three algorithms found these instances simple to solve even when the size was large.

2.2 Modified graphs from literature

The FHCP Challenge Set also contains two families of graphs which are derived from two families of graphs in literature. Specifically, they are derived from the generalized Petersen graphs [46] for some values of mod , and some Flower Snarks [33]. Every graph in these two families are maximally non-Hamiltonian, that is, they are non-Hamiltonian but the addition of any edge results in a Hamiltonian graph. For the Flower Snarks, which are produced by taking copies of the star graph on 4 vertices and linking them together according to a particular scheme, a single edge is added between any two outer vertices on one of the star graphs. For the generalized Petersen graphs, if constructed as described in [46], a single edge is added between vertices and . In both cases, it appears empirically as though the addition of this single edge results in a graph with an exponential (in ) number of Hamiltonian cycles. However, despite this abundance of Hamiltonian cycles, both Concorde and LKH struggled to solve these graphs, and so they were included.

2.3 Graphs obtained by converting from other discrete problems

HCP is an NP-complete problem, and hence any instance of any problem in NP can be transformed into an instance of HCP; however, the process of doing so often results in a large increase in the size of the instance. Conversions between NP-complete problems that result in only linear growth in the size of the instance has been a recent topic of research, e.g. see [10, 9, 20, 18, 13]. A large number of problems were converted to HCP and tested for difficulty of the resulting instance. Instances from the Dominating Set problem, the -queens problem, and the generalized Instant Insanity problem were found to be sufficiently difficult to be included in the FHCP Challenge Set. Although these conversions have not been formally described in literature, source code for them is provided at [26]. Instances derived from a popular puzzle game, Unium [45], were also included. In general, it seemed that SLH and LKH struggled to solve these instances, with Concorde successful for some but not others. Finally, instances of HCP which were recently derived from a famous combinatorial problem from campanology, specifically the search for peals in parts of bobs-only Stedman Triples [27], were also included; none of the algorithms tested were able to easily solve these instances.

2.4 Combinations of the above

Since some instances are easily solved by one algorithm but not another, a number of instances were constructed by combining different instances together in various configurations. The intention was that an algorithm would need to be sufficiently clever to solve each of the component instances. Alternatively, a clever pre-processing algorithm may be successful in decomposing the instances and solving them individually.

3 Results of the FHCP Challenge

The FHCP Challenge ran from 30th September 2015 until 30th September 2016, after having been formally announced at the 59th Annual Meeting of the Australian Mathematical Society. The results were announced at the 60th Annual Meeting of the Australian Mathematical Society, including a summary of the top five submissions.

  1. M. Nurhafiz (Independent Researcher), 385 graphs solved.

  2. M. Noisternig (TU Darmstadt, Germany), 464 graphs solved.

  3. A. Gharbi and U. Syarif (King Saud University, Saudi Arabia), 488 graphs solved.

  4. A. Johnson (IBM, United Kingdom), 614 graphs solved.

  5. N. Cohen and D. Coudert (INRIA, France), 985 graphs solved.

As can be seen, no teams were successful in solving all instances of the FHCP Challenge Set, with all but two teams failing to solve even half of the instances. The sixteen graphs not solved by Cohen and Coudert were not solved in any of the submissions. These sixteen instance comprised three instances from [27], namely Sted4 (6930 vertices), Sted5 (5544 vertices) and Sted6 (4620 vertices), as well as thirteen instances made out of combinations of graphs which included at least one of Sted4, Sted5 and Sted6. Of all the instances included in the FHCP Challenge Set, these instances were by far the most resistant to attack from heuristics. It should be noted that two other instances from [27] were included, namely Sted10 (2772 vertices) and Sted20 (1386 vertices). Of these, Sted10 was only solved by Cohen and Coudert, and Sted20 was only solved by Johnson, and Cohen and Coudert.

The strong result by Cohen and Coudert was obtained by spending a significant amount of time decomposing the instances and searching for similar structures between instances. Cohen and Coudert also correctly identified that many instances were made up out of smaller instances, and used solutions of the latter to obtain solutions for the former. Cohen and Coudert describe their techniques and approaches to successfully winning the FHCP Challenge in [7].

Some of the instances were also able to be efficiently attacked after some consideration. For instance, the uniquely Hamiltonian graphs by Sheehan are extremely dense, but a simple preprocessing algorithm can reduce the graph to a trivial instance. The other uniquely Hamiltonian graphs, as well as the generalized Petersen graphs with mod can also be solved by recognising which family they belong to, and solving the graph isomorphism problem to obtain the original vertex labelling; this can be achieved in polynomial time since these instances all have very low maximum vertex degree [36].


  • [1] D.L. Applegate, R.B. Bixby, V. Chavátal, and W.J. Cook, The Traveling Salesman Problem: A Computational Study, Princeton University Press (2006).
  • [2] P. Baniasadi, V. Ejov, J.A. Filar, M. Haythorpe, and S. Rossomakhine, Deterministic “Snakes and Ladders” Heuristic for the Hamiltonian cycle problem, Math. Program. Comput., 6(1):55-75, 2014.
  • [3] D.W. Barnette, Conjecture 5, In: W.T. Tutte (ed), Recent Progress in Combinatorics: Proceedings of the Third Waterloo Conference on Combinatorics, New York: Academic Press, 1968.
  • [4] J.A. Bondy and V. Chvátal, A method in graph theory, Discrete Math., 15(2):111-135, 1976.
  • [5] A. Chalaturnyk, A Fast Algorithm For Finding Hamiltonian Cycles. Ph.D Thesis, University of Manitoba, 2008.
  • [6] L. Clark and R. Entringer, Smallest maximally nonhamiltonian graphs, Period. Math. Hung., 14(1):57–68, 1983.
  • [7] N. Cohen and D. Coudert, Le défi des 1001 graphes, Interstices, INRIA, 2017.
  • [8] M.D.E. Confer, P. Dobcsányi, B.D. McKay, and G. Royle, The Extended Foster Census, http://staffhome.ecm.uwa.edu.au/gordon/remote/foster/, 2001, accessed April 6th 2017.
  • [9] N. Creignou, The class of problems that are linearly equivalent to Satisfiability or a uniform method for proving NP-completeness, Theor. Comput. Sci., 145:111-145, 1995.
  • [10]

    A.K. Dewdney, Linear transformations between combinatorial problems,

    Internat. J. Comput. Math., (11):91–110, 1982.
  • [11]

    V. Ejov, J.A. Filar, and J. Gondzio, An Interior Point Heuristic for the Hamiltonian Cycle Problem via Markov Decision Processes,

    J. Global Opt., 29(3):315–334, 2004.
  • [12] V. Ejov, J.A. Filar, M. Haythorpe and G.T. Nguyen, Refined MDP-based branch-and-bound algorithm for the Hamiltonian cycle problem, Math. Oper. Res., 34(3):758–768, 2009.
  • [13] V. Ejov, M. Haythorpe and S. Rossomakhine, A Linear-size Conversion of HCP to 3HCP, Australasian Journal of Combinatorics, 62(1):45–58, 2015.
  • [14] R.C. Entringer and H. Swart, Spanning cycles of nearly cubic graphs, J. Comb. Th., 29:303–309, 1980.
  • [15] D. Eppstein, The traveling salesman problem for cubic graphs, J Graph Algorithm. App., 11(1):61–81, 2007.
  • [16] A. Eshragh, J.A. Filar, and M. Haythorpe, A hybrid simulation-optimization algorithm for the Hamiltonian cycle problem, Ann. Oper. Res., 189(1):103–125, 2011.
  • [17] H. Fleischner, Uniquely Hamiltonian grpahs of minimum degree 4, J. Graph Th., 75(2):167–177, 2014.
  • [18] J.A. Filar, and M. Haythorpe, A Linearly-Growing Conversion from the Set Splitting Problem to the Directed Hamiltonian Cycle Problem, In: Honglei Xu, Xiangyu Wang (ed), Optimization and Control Methods in Industrial Engineering and Construction, Springer, Dordrech, 2014.
  • [19] J.A. Filar, M. Haythorpe and G.T. Nguyen, A conjecture on the prevalence of cubic bridge graphs, Discus. Math. Graph Th., 30(1):175–179, 2010.
  • [20] J.A. Filar, M. Haythorpe, and R. Taylor, Linearly-growing reductions of Karp’s 21 NP-complete problems, Numer. Algebr. Control Opt., 8(1):1–16, 2018.
  • [21] A. Frieze and S. Haber, An almost linear time algorithm for finding Hamilton cycles in sparse random graphs with minimum degree at least three, Random Struct. Algor., 47(1):73–98, 2015.
  • [22] H. Gebauer, On the number of Hamilton cycles in bounded degree graphs, In: Proceedings of the meeting on Analytic Algorithmics and Combinatorics, Society for Industrial and Applied Mathematics, 2008.
  • [23] N.I.M. Gould, D. Orban, and Ph. L. Toint, CUTEr (and SifDec): a Constrained and Unconstrained Testing Environment, revisited, ACM Trans. Math. Soft., 29(4):373–394, 2003.
  • [24] M. Haythorpe, Finding Hamiltonian Cycles Using an Interior Point Method, Austral. Math. Soc. Gaz., 37(3):170–179, 2010.
  • [25] M. Haythorpe, On the Minimum Number of Hamiltonian Cycles in Regular Graphs, Exp. Math., to appear, 2017. Published Online, DOI: 10.1080/10586458.2017.1306813.
  • [26] M. Haythorpe, Flinders Hamiltonian Cycle Project, http://fhcp.edu.au, 2017, accessed April 6th 2017.
  • [27] M. Haythorpe and A. Johnson, Changing Ringing and Hamiltonian Cycles : The Search for Erin and Stedman Triples, Elec. J. Graph Th. App., submitted 2017. Available at https://arxiv.org/abs/1702.02623.
  • [28] K. Helsgaun, An Effective Implementation of Lin-Kernighan Traveling Salesman Heuristic, Eur. J. Oper. Res. 126:106–130, 2000.
  • [29] D.A. Holton and R.E.L. Aldred, Planar Graphs, Regular Graphs, Bipartite Graphs and Hamiltonicity, Austral. J. Comb., 20:111-131, 1999.
  • [30] D.A. Holton and B.D. McKay, The smallest non-Hamiltonian 3-connected cubic planar graphs have 38 vertices, J. Comb. Th. Ser. B., 45(3):305–319, 1988.
  • [31] D.A. Holton and J. Sheehan, The Petersen Graph, Cambridge University Press, 1993.
  • [32] H.H. Hoos, SATLIB, http://www.cs.ubc.ca/ hoos/SATLIB/benchm.html, 2011, accessed April 6th 2017.
  • [33] R. Isaacs, Infinite Families of Nontrivial Trivalent Graphs Which Are Not Tait Colorable, Amer. Math. Monthly, 82:221–239, 1975.
  • [34] R.M. Karp, Reducibility among combinatorial problems, Springer, New York, 1972.
  • [35] E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys, The traveling salesman problem. John Wiley & Sons, Essex, England, 1985.
  • [36] E.M. Luks, Isomorphism of graphs of bounded valence can be tested in polynomial time, J. Comput. Syst. Sci., 25:42–65, 1982.
  • [37] Ø. Ore, Note on Hamilton circuits, Am. Math. Mon., 67(1):55, 1960.
  • [38] V.H. Pettersson, Enumerating Hamiltonian Cycles, Electron. J. Comb., 21(4):4–7, 2014.
  • [39] M.S. Rahman and M. Kaykobad, On Hamiltonian cycles and Hamiltonian paths, Inform. Process. Lett., 94:37–41, 2005.
  • [40] E. Rapaport-Strasser, Cayley color groups and Hamilton lines, Scripta Math., 24:51–58, 1959.
  • [41] G. Reinelt, TSPLIB, http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/, 2015, accessed April 6th 2017.
  • [42] A. Schwenk, Enumeration of Hamiltonian Cycles in Certain Generalized Petersen Graphs, J. Comb. Th. Ser. B, 47:53–59, 1989.
  • [43] J. Sheehan, Graphs with exactly one hamiltonian circuit. J. Graph Th., 1:37–43, 1977.
  • [44] J. Sheehan, The multiplicity of Hamiltonian circuits in a graph. Recent advances in graph theory, pp.477-480, 1975.
  • [45] J. Statz. Unium, http://www.kittehface.com/p/unium.html, 2015, accessed April 6th 2017.
  • [46] M.E. Watkins, A Theorem on Tait Colorings with an Application to the Generalized Petersen Graphs, J. Combin. Th., 6:152–164, 1969.
  • [47] Hamiltonian-cycle problem, http://www.cs.uky.edu/ai/benchmark-suite/hamiltonian-cycle.html, accessed April 6th 2017.