Given a set of locations and distances between them, the goal of the Traveling Salesperson Problem (TSP) is to find the shortest tour that visits each location exactly once. Assume that you do not return to the start location after visiting the last location in a tour. We would like to solve the TSP problem using a greedy hill-climbing algorithm. Each state corresponds to a permutation of all the locations (called a tour). The operator neighbors(s) generates all neighboring states of state s by swapping two locations. For example, if s = <A-B-C> is a tour, then <B-A-C>, <C-B-A> and <A-C-B> are the three neighbors generated by neighbors(s). Use as the evaluation function for a state the length of the tour, where each pairwise distance is given in a distance matrix. For example, if s = <A-B-C> is a tour, then its total length is d(A, B) + d(B, C) where d(A, B) is the distance between location A and B.
(a) [3] If there are n locations, how many neighboring states does the neighbors(s) function produce?
(b) [3] What is the total size of the entire search space, i.e., the total number of states, when there are n locations?