Two generalizations of the traveling salesman problem