views:

121

answers:

3

I need to know about the uniform cost search algorithm. In the uniform cost solution, we find a node that has the lowest cost. But there can be other nodes that have less cost than the previous one.Do we need use some buffer to keep the lowest value in that , so that we can get the lowest cost from the whole tree??I need some pseducode to implement this algorithm.

+3  A: 

You can use the built in fuction min()

>>min([3, 2, 4, 1])
1
Zonda333
A: 

How is tree built, is lowest cost some function of traversing the tree or only dependent of leaf values? Example input and output would be nice.

This Guido's document could be good starting point: http://python.org/doc/essays/graphs.html

Tony Veijalainen
I'm not getting ur soln,.....I need to find the node (goal) of least total cost. I need to go and search the whole tree and there are multiple goals that can be reached but I need to find the lowest cost soln
Shilpa
A: 

http://en.wikipedia.org/wiki/Uniform-cost_search
See ref for how to use a priority queue.

kruiser