# AI: Heuristic function A* search

I have an assignment in my university where I have to implement Uniform Cost Search and A* Search.

We have an input which includes a map and queries.

The map is weighted, directed graph, represented by an adjacency matrix. The queries include Uniform Cost Search and A* Search queries (Ex: Uniform(or A*) + initial location + goal location)

I cannot use heuristic functions based on physical distance because we have no knowledge and extra information about this graph except distances between vertices.

Is there any way to find a heuristic function in this case ?

(Is it possible to use prior results from Uniform Cost Search in the queries to extract information from the graph?)

• The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you!
– Raphael
Aug 16 '16 at 22:30
• Just as a quick, obvious note: It suffices that you implement A* and use it with a zero heuristic function to get UCS behavior "for free".
– Omar
Dec 11 '17 at 5:54
• @Omar And, conversely, it suffices to implement UCS because, then, you can claim to have implemented A* with the zero heuristic. :-) Dec 11 '17 at 11:44