  Targeted spectroscopic exoplanet surveys face the challenge of maximizing
their planet detection rates by means of careful planning. The number of
possible observation combinations for a large exoplanet survey, i.e., the
sequence of observations night after night, both in total time and amount of
targets, is enormous.
  Sophisticated scheduling tools and the improved understanding of the
exoplanet population are employed to investigate an efficient and optimal way
to plan the execution of observations. This is applied to the CARMENES
instrument, which is an optical and infrared high-resolution spectrograph that
has started a survey of about 300 M-dwarf stars in search for terrestrial
exoplanets.
  We use evolutionary computation techniques to create an automatic scheduler
that minimizes the idle periods of the telescope and that distributes the
observations among all the targets using configurable criteria. We simulate the
case of the CARMENES survey with a realistic sample of targets, and we estimate
the efficiency of the planning tool both in terms of telescope operations and
planet detection.
  Our scheduling simulations produce plans that use about 99$\%$ of the
available telescope time (including overheads) and optimally distribute the
observations among the different targets. Under such conditions, and using
current planet statistics, the optimized plan using this tool should allow the
CARMENES survey to discover about 65$\%$ of the planets with radial-velocity
semi-amplitudes greater than 1$~m\thinspace s^{-1}$ when considering only
photon noise.
  The simulations using our scheduling tool show that it is possible to
optimize the survey planning by minimizing idle instrument periods and
fulfilling the science objectives in an efficient manner to maximize the
scientific return.
