The Traveling Salesman Problem with Time Window and Precedence Constraints (TSP-TWPC) is to find a Hamiltonian tour of minimum cost in a graph G = (X, A) of n vertices, starting at vertex 1, visiting each vertex i during its time window and after having visited every vertex that must precede i, and returning to vertex 1. The TSP-TWPC is known to be NP-hard and has applications in many sequencing and distribution problems. In this paper we describe an exact algorithm to solve the problem that is based on dynamic programming and makes use of bounding functions to reduce the state space graph. These functions are obtained by means of a new technique that is a generalization of the ‘State Space Relaxation’ for dynamic programming introduced by Christofides et al. Computational results are given for randomly generated test problems.