Uniform Cost Search Algorithm