Counting cycles in an interval covering graph Created 2026-09-24 Updated 2026-09-24
If is the adjacency matrix of a directed covering graph, then counts its pointed closed walks of length . For a prime number , subtracting the constant walks and identifying the cyclic choices of starting point gives
primitive closed itineraries of length .
Set
Their covering graph is
with adjacency matrix
The closed walks and give a horseshoe from two closed covering walks for , so must be chaotic. Since
counting cycles in an interval covering graph gives
distinct 3-cycles in the minimum case, attained by the corresponding connect-the-dots interval map.
Let
The covering relations are
Thus the covering graph has adjacency matrix
The two closed length-three walks
give a horseshoe from two closed covering walks for , so must be chaotic. Moreover,
By counting cycles in an interval covering graph, the number of primitive length-three cyclic itineraries is
Hence must have at least, and the connect-the-dots realization shows that it need have only, distinct 3-cycles.
Use subset dynamic programming for a Hamiltonian path, with a Boolean dynamic programming state for each nonempty subset and . It is true exactly when there is a graph path using every vertex of once, using no other vertices, and ending at . The base and transition are
where is the adjacency matrix of a directed graph.
HamiltonianExists(A):
    initialize every D[S,v] to false
    for v in V:
        D[{v},v] = true
    for k = 2,...,n:
        for S subset of V with |S| = k:
            for v in S:
                D[S,v] = any(D[S-{v},u] and A[u,v]
                             for u in S-{v})
    return any(D[V,v] for v in V)
For correctness, a valid path ending at has some penultimate vertex ; removing yields exactly a path recorded by the corresponding predecessor state. Conversely, extending any true predecessor state by the edge produces a path visiting precisely once. Mathematical induction on proves the meaning of every state. Therefore the final disjunction is true exactly when a Hamiltonian path exists.
There are possible states and at most predecessor checks per state. More exactly, the full set of ordered predecessor checks has size for . With constant-time adjacency matrix access and ordinary subset-indexed table access,
The graph is normally assumed nonempty here. If the empty graph is admitted, return the chosen convention for its empty Hamiltonian path separately; it does not affect the bound.
The adjacency matrix of a directed graph whose vertices are symbols and whose directed edges are the permitted consecutive pairs. Its entries indicate permission. In comparison, the transition matrix of a Markov chain records transition probabilities.