This paper introduces an optical solution to (bounded-length input instances of) an NP-complete problem called the traveling salesman problem using a pure optical system. The solution is based on the multiplication of a binary-matrix, representing all feasible routes, by a weight-vector, representing the weights of the problem. The multiplication of the binary-matrix by the weight-vector can be implemented by any optical vector-matrix multiplier. In this paper, we show that this multiplication can be obtained by an optical correlator. In order to synthesize the binary-matrix, a unique iterative algorithm is presented. This algorithm synthesizes an N-node binary-matrix using rather small number of vector duplications from the (N-1)-node binary-matrix. We also show that the algorithm itself can be implemented optically and thus we ensure the entire optical solution to the problem. Simulation and experimental results prove the validity of the optical method.