D(i, j) is the distance from location i to location j. x(i, j) is a variable that models a vehicle’s routing sequence: x(i, j) = 1, the vehicle travels from location i to location j; otherwise x(i, j) = 0.
Use linear functions to model the following (you can define new variables if necessary. If new variables are defined, relationship between different variables must be modeled as well):
a.1 Objective function: maximize the total number of locations visited (2%)
a.2 This vehicle departs from location "1", can visit each location at most once, and must return to the departure location "1". (Hint: flow in = flow out <= 1, and subtour elimination constraints)
a.3 Locations 5 and 8 must be visited
a.4 At most one of Location 6 and Location 7 can be visited (they cannot be visited both)
a.5 Total travel distance cannot exceed a threshold D