I have a graph representing a city. I know the location of places of interest (nodes that matter), the location of the hotel where I stay, how the nodes connect, the transit time between them and the distance to latitude and longitude. There are no problems associated with the transition of time to distance and vice versa.
The goal is to tour the city, maximizing the importance of the day, but limiting one day of travel to 10 hours. The day begins and ends at the hotel. I have a working A * algorithm that selects the lowest value, but without heuristics, which, in my opinion, is now BB. With that in mind:
- Since I have access to Lat / Long, my first blow to heuristics, while only dealing with time, there will be a distance, like a crow between a node hotel and a hotel. Will this be a valid heuristic? This gives me the shortest distance and time, so he will not overestimate.
Now let's say that the node value is between 1-4. To enable it, one idea could be g (neighbor) = g (current) + (edge_cost / value ^ 2). Assuming this will be valid (if not, why?):
- But now heuristic values ββwill be in another block. Can a solution to this simply give Hotel Value = 1? If the value is the same, will it be acceptable? EDIT: I think this will eventually give me problems due to the difference in scale.
- I still have to limit the total time. If each node tracks the total time spent comparing with the limit, plus the values ββof g () and h () due to different units?
And finally:
- Since I have to start and end in the same node that comes to my mind to explore the node and I have to find the hotel to see if I still have time to explore the neighbors instead of going back. However, if I still have time to go to another node, but time runs out, and I cannot get to the hotel from there, I assume that I will have to go back to my parents.
- I cannot help but see the similarities with the backpack problem. Although I have to use A *, is there a lesson I can learn from it?
- Should my heuristic be consistent in this case? If so, why?
By the way, the goal here is to find the path first, the second optimization.
source share