  We propose a method to optimize the multi-Slater determinants of the
antisymmetrized molecular dynamics (AMD) in the linear combination form and
apply it to the neutron-rich $^{10}$Be nucleus. The individual Slater
determinants and their weights in the superposition are determined
simultaneously according to the variational principle of the energy of the
total wave function. The multi-AMD basis states of $^{10}$Be show various
cluster structures as well as the shell-model type. In the cluster
configurations, different intercluster distances are superposed automatically
indicating the role of the generator coordinates. We further introduce a
procedure to obtain the configurations for the excited states imposing the
orthogonal condition to the ground-state configurations. In the excited states
of $^{10}$Be, the linear-chain-like structure is confirmed consisting of
various clusters. The energy spectrum using the obtained basis states
reproduces the experiments. The present framework can be the method to find the
optimal multi-configuration for nuclear ground and excited states.
