A Dynamic Programming Approach to Counting Hamiltonian Cycles in Bipartite Graphs

Similar documents
.Cycle counting: the next generation. Matthew Skala 30 January 2013

Classification of Directed and Hybrid Triple Systems

Bounds on the domination number of Kneser graphs

The chromatic number of the square of the 8-cube

The Steiner Quadruple Systems of Order 16

Self-complementary strongly regular graphs revisited

Computing the Domination Number of Grid Graphs

Enumerating Hamiltonian Cycles

There exists no Steiner system S(4, 5, 17)

ON THE NUMBER OF HAMILTONIAN CIRCUITS IN THE «-CUBE

Algebraic Properties and Panconnectivity of Folded Hypercubes

DISTINGUISHING PARTITIONS AND ASYMMETRIC UNIFORM HYPERGRAPHS

The P versus NP Problem. Ker-I Ko. Stony Brook, New York

arxiv: v1 [cs.ds] 2 Oct 2018

Imprimitive symmetric graphs with cyclic blocks

arxiv: v1 [cs.it] 7 Apr 2015

arxiv: v1 [math.co] 3 Feb 2014

Permutation Groups. John Bamberg, Michael Giudici and Cheryl Praeger. Centre for the Mathematics of Symmetry and Computation

Counting Strategies: Inclusion/Exclusion, Categories

Alternative Combinatorial Gray Codes

Chapter 34: NP-Completeness

NP and Computational Intractability

USING GRAPHS AND GAMES TO GENERATE CAP SET BOUNDS

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

MATH 22 HAMILTONIAN GRAPHS. Lecture V: 11/18/2003

Strongly regular graphs constructed from groups

Semiregular automorphisms of vertex-transitive graphs

ABHELSINKI UNIVERSITY OF TECHNOLOGY

NP-Completeness. Until now we have been designing algorithms for specific problems

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Counting Strategies: Inclusion-Exclusion, Categories

NP and NP-Completeness

SAT, Coloring, Hamiltonian Cycle, TSP

Steiner triple and quadruple systems of low 2-rank

Permutation Group Algorithms

Monotone Gray Codes and the Middle Levels Problem

Symmetry properties of generalized graph truncations

Latin squares: Equivalents and equivalence

arxiv: v2 [math.co] 7 Jan 2016

ACODE of length n over an alphabet A is a subset of A n. With alphabet size q = A, the code is called a q-ary code.

ALGEBRA HOMEWORK SET 2. Due by class time on Wednesday 14 September. Homework must be typeset and submitted by as a PDF file.

Short cycles in random regular graphs

Constructing Critical Indecomposable Codes

COP 4531 Complexity & Analysis of Data Structures & Algorithms

ON THE ORDER OF ARC-STABILISERS IN ARC-TRANSITIVE GRAPHS, II

Enumeration of Chord Diagrams without Loops and Parallel Chords

Cycles through 23 vertices in 3-connected cubic planar graphs

Combinatorial properties of transformation monoids

Automorphism group of the balanced hypercube

Counting Strategies: Inclusion/Exclusion, Categories

arxiv: v1 [math.co] 19 Nov 2016

Laceable Knights. Michael Dupuis, Univ. of St. Thomas, St. Paul, Minnesota, USA

Algorithms Design & Analysis. Approximation Algorithm

Connection MATH Connection. Benjamin V.C. Collins, James A. Swenson MATH 2730

1.3 Vertex Degrees. Vertex Degree for Undirected Graphs: Let G be an undirected. Vertex Degree for Digraphs: Let D be a digraph and y V (D).

On Optimal Binary One-Error-Correcting Codes of Lengths 2 m 4 and 2 m 3

Lecture 22: Counting

Lecture 24: Approximate Counting

Trees/Intro to counting

Locally primitive normal Cayley graphs of metacyclic groups

Key words. silver matrix, graph colouring, coding theory, domination in graphs, finite projective

NP-completeness. Chapter 34. Sergey Bereg

Edge-counting vectors, Fibonacci cubes, and Fibonacci triangle

Self-complementary circulant graphs

Pentavalent symmetric graphs of order twice a prime power

Finding a derangement

Constructing t-designs with prescribed automorphism groups

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

EMBEDDED PATHS AND CYCLES IN FAULTY HYPERCUBES

1 Hamiltonian properties

Tree Decompositions and Tree-Width

arxiv: v1 [cs.dm] 26 Apr 2010

The Binary Self-Dual Codes of Length Up To 32: A Revised Enumeration*

CAYLEY NUMBERS WITH ARBITRARILY MANY DISTINCT PRIME FACTORS arxiv: v1 [math.co] 17 Sep 2015

Trees, Tanglegrams, and Tangled Chains

NP-Complete problems

A note on network reliability

The Hypercube Graph and the Inhibitory Hypercube Network

Polynomial-Time Reductions

More on NP and Reductions

Generating Permutations and Combinations

q-counting hypercubes in Lucas cubes

P and NP. Inge Li Gørtz. Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides

Asymptotically optimal induced universal graphs

FURTHER RESTRICTIONS ON THE STRUCTURE OF FINITE DCI-GROUPS: AN ADDENDUM

ARTICLE IN PRESS Theoretical Computer Science ( )

Counting Knight s Tours through the Randomized Warnsdorff Rule

Some Notes on Distance-Transitive and Distance-Regular Graphs

Ringing the Changes II

Permutation groups/1. 1 Automorphism groups, permutation groups, abstract

-ARC-TRANSITIVE GRAPHS Dragan Marusic IMFM, Oddelek za matematiko Univerza v Ljubljani Jadranska 19, 1111 Ljubljana Slovenija

The cycle polynomial of a permutation group

Sets in Abelian groups with distinct sums of pairs

Asymptotically optimal induced universal graphs

Combining the cycle index and the Tutte polynomial?

Week 4-5: Generating Permutations and Combinations

SOME DESIGNS AND CODES FROM L 2 (q) Communicated by Alireza Abdollahi

ACO Comprehensive Exam October 14 and 15, 2013

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

Decision Problems TSP. Instance: A complete graph G with non-negative edge costs, and an integer

Transcription:

A Dynamic Programming Approach to Counting Hamiltonian Cycles in Bipartite Graphs Patric R. J. Östergård Department of Communications and Networking Aalto University School of Electrical Engineering P.O. Box 13000, 00076 Aalto, Finland E-mail: patric.ostergard@tkk.fi Joint work with Harri Haanpää. Supported in part by the Academy of Finland. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 1 / 24

The Authors Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 2 / 24

A Hierarchy of Problems Existence problem Given a collection of properties, decide whether there exists an object realizing these properties. Counting problem Given a collection of properties, count the number of distinct objects meeting the properties. Two versions: all, all up to isomorphism/equivalence. Classification problem Given a collection of properties, describe, up to some criterion of isomorphism, all the objects that have the desired properties. Characterization problem Develop a deeper understanding of classified objects. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 3 / 24

Counting Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 4 / 24

Counting by Dynamic Programming Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 5 / 24

Counting by Dynamic Programming Count the matches in one box: 50 Count the boxes: 19 50 19 = 950 Earlier: 1-factorizations of complete graphs, Latin squares,... Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 5 / 24

Definitions A) Directed Hamiltonian cycles: B) (Undirected) Hamiltonian cycles: Divide #A by 2. C) Gray code: 000, 001, 011, 111, 101, 100, 110, 010 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 6 / 24

Example: 3-Cube (Q 3 ) 111 011 101 110 001 010 100 000 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 7 / 24

Example: 3-Cube (Q 3 ) 111 011 101 110 001 010 100 000 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 7 / 24

Example: 3-Cube (Q 3 ) 111 011 101 110 001 010 100 000 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 7 / 24

Example: 3-Cube (Q 3 ) 111 011 101 110 001 010 100 000 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 7 / 24

Outline of Algorithm Consider a finite bipartite graph Γ = (V, E). 1. Partition V into sets V i such that every edge has its endpoints in consecutive sets V k and V k+1 for some k. 2. For k = 0, 1,... build up (and count) collections of subpaths of a Hamiltonian cycle that are induced by j i=0 V i for j = 0, 1,.... Related old algorithm: W. Kocay, An extension of the multi-path algorithm for finding hamilton cycles, Discrete Math. 101 (1992), 171 188. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 8 / 24

Utilizing Symmetries The stabilizer of the partition V 0, V 1,..., V M can be used to speed up the counting. Q n, the n-cube: V i contains the vertices with Hamming weight i. The order of the stabilizer is n!. Example. 3-cube: V 0 = {000} V 1 = {001, 010, 100} V 2 = {011, 101, 110} V 3 = {111} Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 9 / 24

A Bidirectional Approach, or Gluing (a) Proceed V o V 1. (b) Proceed V M V M 1. Glue the structures when they meet! Meet in the middle. If there is an automorphism of the original graph mapping the elements of V i to V M i, then (b) can be omitted. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 10 / 24

Two gluing strategies Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 11 / 24

Two gluing strategies 1. Make exhaustive attempts 2. Determine what the counterpart should look like Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 11 / 24

The 6-Cube The number of Hamiltonian cycles of the n-cube is 0, 1, 6, 1344, 906 545 760 for i = 1, 2, 3, 4, and 5, respectively (A066037 in the OEIS). The case n = 6 has attracted a lot of interest along the years: Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 12 / 24

Solutions up to Level 3, up to Equivalence Level 0: 1 solution (counter value 1) Level 1: 1 solution (counter value 15) Level 2: 3446 solutions Paths # 1 13 495 2 263 305 3 2 782 510 4 17 003 576 5 61 154 671 6 127 360 225 7 142 398 993 8 65 084 556 9 7 887 199 10 139 098 Total 424 087 628 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 13 / 24

Glued Hamiltonian Cycles of the 6-cube Paths # 1 269 635 088 041 094 880 2 19 221 791 375 622 767 040 3 361 924 641 407 769 994 080 4 2 623 087 675 470 868 439 040 5 8 443 693 910 745 312 544 800 6 12 696 602 985 718 261 583 040 7 8 812 957 118 756 042 697 120 8 2 606 036 710 760 600 434 560 9 268 829 026 417 644 883 200 10 5 590 226 830 719 432 960 Total 35 838 213 722 570 883 870 720 Note. Deza and Shklyar make incorrect claims for n = 6 in arxiv:10043.4291v1 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 14 / 24

arxiv:1004.4391v1 arxiv:1003.4391v1 [cs.dm] 23 Mar 2010 Enumeration of Hamiltonian Cycles in 6-cube March 24, 2010 Michel Deza 1 and Roman Shklyar 2 Abstract Finding the number 2H6 of directed Hamiltonian cycles in 6-cube is problem 43 in Section 7.2.1.1 of Knuth s The Art of Computer Programming ([Kn10]); various proposed estimates are surveyed below. We computed exact value: H6=14, 754, 666, 508, 334, 433, 250, 560=6!*2 4 *217, 199*1, 085, 989*5, 429, 923. Also the number Aut6 of those cycles up to automorphisms of 6-cube was computed as 147,365,405,634,413,085 Key Words: hypercube, Hamiltonian cycle, computation. A Hamiltonian cycle in a graph is a cycle that visits each vertex exactly once. Let Hn denote the number of Hamiltonian cycles in n-cube(the graph of n-dimensional hypercube). An automorphism of a graph is a permutation of its vertex-set preserving its edge-set. Let Autn denote the number of Hamiltonian cycles in n-cube up to the group of automorphisms of n-cube. Let W eightn denote Patric theöstergård number of Hamiltonian 35th ACCMCC, cycles in n-cube Melbourne, up to 5. 9.12.2011 the 15 / 24

Counting Equivalence Classes of Hamiltonian Cycles N Total number of Hamiltonian cycles N i The number of equivalence classes of Hamiltonian cycles with an automorphism group of order i By the Orbit-Stabilizer Theorem, N = i G N i i = i 2 n n!n i i (1) 1. Determine N 2,... 2. Solve N 1 from (1) 3. Determine i N i Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 16 / 24

Hamiltonian Cycles with Prescribed Automorphisms When considering automorphisms of Hamiltonian cycles in a graph Γ = (V, E), it is convenient that these can be considered both as subgroups of Aut(Γ) and subgroups of Aut(C V ). Lemma 1. A Hamiltonian cycle in the n-cube cannot have an automorphism of prime order greater than 2. A Hamiltonian cycle consists of the union of two perfect matchings. Lemma 2. Let n 3. The automorphisms of a Hamiltonian cycle in the n-cube stabilizes the two perfect matchings formed by taking every second edge of the cycle. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 17 / 24

Hamiltonian Cycles with Prescribed Automorphisms Classification is carried out via perfect matchings. Aut \Type All Reflected 2 7 001 923 981 4 369 328 232 4 220 165 195 606 8 568 494 16 20 20 Total 7 002 144 734 4 369 524 352 It now follows that there are 777 739 016 577 752 714 inequivalent Hamiltonian cycles in the 6-cube. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 18 / 24

Details Regarding Computations CPU-time: Gluing for the 6-cube took just under 10 core-years. Memory: Up to 8GB. Validation: Double counting and independent implementations, etc. r 10 core-years... Implementation: Some subproblems and many technical details omitted here. Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 19 / 24

Knight s Tours of a Chessboard Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 20 / 24

Partitions of Vertices 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 4 3 4 3 4 3 4 3 3 4 3 4 3 4 3 4 8 16 16 16 8 0 1 2 1 2 3 2 3 1 2 1 2 3 2 3 4 2 1 2 3 2 3 4 3 1 2 3 2 3 4 3 4 2 3 2 3 4 3 4 5 3 2 3 4 3 4 5 4 2 3 4 3 4 5 4 5 3 4 3 4 5 4 5 6 1 6 15 20 15 6 1 Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 21 / 24

Results Old results: M. Loebbing and I. Wegener, The number of knight s tours equals 33,439,123,484,294 Counting with binary decision diagrams, Electron. J. Combin. 3(1) (1996), Research Paper 5 and Comment 1. B. D. McKay, Knight s tours of an 8 8 chessboard, Technical Report TR-CS-97-03, Computer Science Department, Australian National University, Canberra, 1997. Our result: The number of partial solutions is 1, 143 379, and 95 345 608 on the levels 0, 1, and 2, respectively. Gluing 13 267 364 410 532 Hamiltonian cycles (=McKay). Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 22 / 24

Final Comment and Generalizations The main contribution here is not the numbers but the algorithm. Note! The problem of determining the number of Hamiltonian cycles in a graph is #P-complete and determining whether it is > 0 is NP-complete. Possible variants and generalizations: Consider nonbipartite graphs Consider directed graphs Count Hamiltonian paths Count (perfect) matchings Snake-in-the-box (longest induced path) Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 23 / 24

The End Thank You!!! Questions? Patric Östergård 35th ACCMCC, Melbourne, 5. 9.12.2011 24 / 24