Optimization of multilateral well trajectories using pattern search and genetic algorithms