The snake-in-the-box problem in
graph theory
In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
and
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
deals with finding a certain kind of path along the edges of a
hypercube
In geometry, a hypercube is an ''n''-dimensional analogue of a square ( ) and a cube ( ); the special case for is known as a ''tesseract''. It is a closed, compact, convex figure whose 1- skeleton consists of groups of opposite parallel l ...
. This path starts at one corner and travels along the edges to as many corners as it can reach. After it gets to a new corner, the previous corner and all of its neighbors must be marked as unusable. The path should never travel to a corner which has been marked unusable.
In other words, a ''snake'' is a connected open path in the hypercube where each node connected with path, with the exception of the head (start) and the tail (finish), it has exactly two neighbors that are also in the snake. The head and the tail each have only one neighbor in the snake. The rule for generating a snake is that a node in the hypercube may be visited if it is connected to the current node and it is not a neighbor of any previously visited node in the snake, other than the current node.
In graph theory terminology, this is called finding the longest possible
induced path
In the mathematical area of graph theory, an induced path in an undirected graph is a path that is an induced subgraph of . That is, it is a sequence of vertices in such that each two adjacent vertices in the sequence are connected by an edge ...
in a
hypercube
In geometry, a hypercube is an ''n''-dimensional analogue of a square ( ) and a cube ( ); the special case for is known as a ''tesseract''. It is a closed, compact, convex figure whose 1- skeleton consists of groups of opposite parallel l ...
; it can be viewed as a special case of the
induced subgraph isomorphism problem
In complexity theory and graph theory, induced subgraph isomorphism is an NP-complete decision problem that involves finding a given graph as an induced subgraph of a larger graph.
Problem statement
Formally, the problem takes as input two graphs ...
. There is a similar problem of finding long induced
cycle
Cycle, cycles, or cyclic may refer to:
Anthropology and social sciences
* Cyclic history, a theory of history
* Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr.
* Social cycle, various cycles in ...
s in hypercubes, called the coil-in-the-box problem.
The snake-in-the-box problem was first described by , motivated by the theory of
error-correcting code
In computing, telecommunication, information theory, and coding theory, forward error correction (FEC) or channel coding is a technique used for controlling errors in data transmission over unreliable or noisy communication channels.
The centra ...
s. The vertices of a solution to the snake or coil in the box problems can be used as a
Gray code
The reflected binary code (RBC), also known as reflected binary (RB) or Gray code after Frank Gray (researcher), Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit).
For ...
that can detect single-bit errors. Such codes have applications in
electrical engineering
Electrical engineering is an engineering discipline concerned with the study, design, and application of equipment, devices, and systems that use electricity, electronics, and electromagnetism. It emerged as an identifiable occupation in the l ...
,
coding theory
Coding theory is the study of the properties of codes and their respective fitness for specific applications. Codes are used for data compression, cryptography, error detection and correction, data transmission and computer data storage, data sto ...
, and computer
network topologies
Network topology is the arrangement of the elements ( links, nodes, etc.) of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, including command and cont ...
. In these applications, it is important to devise as long a code as is possible for a given dimension of
hypercube
In geometry, a hypercube is an ''n''-dimensional analogue of a square ( ) and a cube ( ); the special case for is known as a ''tesseract''. It is a closed, compact, convex figure whose 1- skeleton consists of groups of opposite parallel l ...
. The longer the code, the more effective are its capabilities.
Finding the longest snake or coil becomes notoriously difficult as the dimension number increases and the search space suffers a serious
combinatorial explosion
In mathematics, a combinatorial explosion is the rapid growth of the complexity of a problem due to the way its combinatorics depends on input, constraints and bounds. Combinatorial explosion is sometimes used to justify the intractability of cert ...
. Some techniques for determining the upper and lower bounds for the snake-in-the-box problem include proofs using
discrete mathematics
Discrete mathematics is the study of mathematical structures that can be considered "discrete" (in a way analogous to discrete variables, having a bijection with the set of natural numbers) rather than "continuous" (analogously to continuous f ...
and
graph theory
In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
,
exhaustive search
In computer science, brute-force search or exhaustive search, also known as generate and test, is a very general problem-solving technique and algorithmic paradigm that consists of systematically checking all possible candidates for whether or ...
of the search space, and
heuristic
A heuristic or heuristic technique (''problem solving'', '' mental shortcut'', ''rule of thumb'') is any approach to problem solving that employs a pragmatic method that is not fully optimized, perfected, or rationalized, but is nevertheless ...
search utilizing evolutionary techniques.
Known lengths and bounds
The maximum length for the snake-in-the-box problem is known for dimensions one through eight; it is
:1, 2, 4, 7, 13, 26, 50, 98 .
Beyond that length, the exact length of the longest snake is not known; the best lengths found so far for dimensions nine through thirteen are
:190, 370, 712, 1373, 2687.
For cycles (the coil-in-the-box problem), a cycle cannot exist in a hypercube of dimension less than two. The maximum lengths of the longest possible cycles are
:0, 4, 6, 8, 14, 26, 48, 96 .
Beyond that length, the exact length of the longest cycle is not known; the best lengths found so far for dimensions nine through thirteen are
:188, 366, 692, 1344, 2594.
''Doubled coils'' are a special case: cycles whose second half repeats the structure of their first half, also known as ''symmetric coils''. For dimensions two through seven the lengths of the longest possible doubled coils are
:4, 6, 8, 14, 26, 46.
Beyond that, the best lengths found so far for dimensions eight through thirteen are
:94, 186, 362, 662, 1222, 2354.
For both the snake and the coil in the box problems, it is known that the maximum length is proportional to 2
''n'' for an ''n''-dimensional box, asymptotically as ''n'' grows large, and bounded above by 2
''n'' − 1. However the constant of proportionality is not known, but is observed to be in the range 0.3 - 0.4 for current best known values.
[For asymptotic lower bounds, see , , and . For upper bounds, see , , , , , and .]
Notes
References
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
External links
*
*{{mathworld , title = Snake , urlname = Snake, mode=cs2
Error detection and correction
Computational problems in graph theory