I am running a graph search(with different types of search like ucs, bfs, dfs, greedy, and a*) on a tsp problem, I am however running into an issue with greedy and a* search because I am stuck with identifying the heuristics function. I have my connected cities stored as a list of lists called connections. The contents look like this ['newyork', 'albany', 1] which signifies that newyork and albany are connected with the cost of 1 to travel between them. On a previous implementation of solving this I was provided with a locations dictionary that was of the format 'newyork': (91,492) which signified the different locations of the cities
On a previous implementation this was the method I used to calculate the heuristics: `
def euclidian (current_node, goal_node):
current_location = locations[current_node.state]
goal_locatinon = locations[goal_node]
distance = math.dist(current_location, goal_locatinon)
return distance
` Which worked wonderfully! But now without the locations I am stuck and can't figure out how to do it? can someone please help guide me on the right path?