# Solving for Hamiltonian path with constraints on allowable routes through vertices

Suppose you have a complete graph with N vertexes, with a distinguished vertex $n=1$ ("start"), and you wish to find a route traveling exactly once through each vertex so that the distance along the path is minimized. There is no requirement that the path return to the starting point, but must end at any other vertex besides the $n=1$ vertex. At this stage the problem is finding a Hamiltonian path through the vertexes, starting from a given point; the context I am looking has the vertexes are points in 3D space.

However, I am interested in including an additional condition -- only certain paths through vertexes are allowed, given by a coefficient $c_{ijk}$, where $c_{ijk} = 1$ if the path $i \to j \to k$ is allowed, and $c_{ijk} = 0$ otherwise. The physical context of this is to restrict the angle in 3D space between the incoming vector ${\vec r}_j - {\vec r}_i$ and the outgoing vector ${\vec r}_k - {\vec r}_j$. If this angle is greater than a fixed value $\theta_{max}$, the path cannot pass through the nodes in the sequence $i \to j \to k$. Because of this additional restriction, there is no condition on the number of paths leaving the start vertex, so that if it is impossible with a single path, multiple paths are considered.

Obviously, in the extremes where the $c_{ijk}$ are mostly zero or mostly one, there is either no solution, or the unconstrained solution is feasible, respectively. Studying the properties of $c_{ijk}$ for a given vertex can show that particular vertexes cannot be visited other than directly from the $n = 1$ vertex, or that particular edges $i \to j$ cannot be used by any path. Presumably, one could build up other such relations, but I have not gone about to find any others.

Has a system like this been previously considered in the literature, as a variation of the Hamiltonian path, or of the traveling salesman problem? If so, what is the reference?