add getheuristic function to greedy and A*