A Minimum Risk Approach for Path Planning of UAVs