  We present analysis of the evolution of dark matter halos in dense
environments of groups and clusters in dissipationless cosmological
simulations. The premature destruction of halos in such environments, known as
the overmerging, reduces the predictive power of N-body simulations and makes
difficult any comparison between models and observations. We analyze the
possible processes that cause the overmerging and assess the extent to which
this problem can be cured with current computer resources and codes. Using both
analytic estimates and high resolution numerical simulations, we argue that the
overmerging is mainly due to the lack of numerical resolution. We find that the
force and mass resolution required for a simulated halo to survive in galaxy
groups and clusters is extremely high and was almost never reached before: ~1-3
kpc and 10^8-10^9 Msun, respectively. We use the high-resolution Adaptive
Refinement Tree (ART) N-body code to run cosmological simulations with the
particle mass of \approx 2x10^8/h Msun} and the spatial resolution of \approx
1-2/h kpc, and show that in these simulations the halos do survive in regions
that would appear overmerged with lower force resolution. Nevertheless, the
halo identification in very dense environments remains a challenge even with
the resolution this high. We present two new halo finding algorithms developed
to identify both isolated and satellite halos that are stable (existed at
previous moments) and gravitationally bound. To illustrate the use of the
satellite halos that survive the overmerging, we present a series of halo
statistics, that can be compared with those of observed galaxies. (Abridged)
