Let's say instead of finding the shortest path we have to maximize the profit in a year of the salesman under the following constraints.
- Salesman can go to a different city only on weekends, all weekdays of a week he will sell in the same city
- The salesman has limited fuel, so he can visit only cities which are in 300(or any other constant) mile radius
- Every time a salesman travels to a different city he gets new prices for each city for his inventory based on demand and supply in each city. For simplicity, you can assume you have prices for each city for each week are pre-decided. i.e. you have Nx52 matrix where N is the number of cities. The more the price the more will be the profit.
To simplify further we can assume a Graph(G) will contain N nodes and each node will point to all cities within a 300-mile radius.
class GraphNode:
def __init__(self, locID, prices, close_locations)
self.locID = locID
self.prices = prices #List of prices in 52 weeks
self.close_locations = close_locations #List of locations in 300 mile radius
How to approach this problem. I could not find any resources to get started to solve this. Here is a similar kind of question but this is as far I could find a similarity: https://stackoverflow.com/questions/24396976/what-is-the-name-for-this-special-case-of-the-travelling-salesman-involving-dyna