What kind of technique does the Curiosity rover employ to find the safest (probably not the fastest) way to its destination that was given to it by NASA from the Earth?
The terrain around the rover is scanned with two sets of cameras: the navigation cameras and the hazard avoidance cameras. These cameras are installed in pairs: each pair generates stereoscopic images, so the rover can measure distances to and dimensions of obstacles. The images from these cameras is converted to a 3D map of the surrounding terrain.
An inertial measurement unit provides information on the rover's position and attitude.
The rover combines this information to plot possible paths through the photographed terrain, then compares these paths to choose the safest one (link about Spirit and Opportunity). (another link with lots of images in a PDF). The navigation system used on Curiosity is derived from the work done on Spirit and Opportunity.