  We present N-body simulations of galaxy groups embedded in a common halo of
matter. We study the influence of the different initial conditions upon the
evolution of the group and show that denser configurations evolve faster, as
expected. We then concentrate on the influence of the initial radial density
profile of the common halo and of the galaxy distribution. We select two kinds
of density distributions, a singular profile (modeled by a Hernquist
distribution) and a profile with a flat core (modeled by a Plummer sphere). In
all cases we witness the formation of a central massive object due to mergings
of individual galaxies and to accretion of stripped material, but both its
formation history and its properties depend heavily on the initial
distribution. In Hernquist models the formation is due to a ``burst'' of
mergings in the inner parts, due to the large initial concentration of galaxies
in the center. The merging rate is much slower in the initial phases of the
evolution of a Plummer distribution, where the contribution of accretion to the
formation of the central object is much more important. The central objects
formed within Plummer distributions have projected density profiles which are
not in agreement with the radial profiles of observed brightest cluster
members, unless the percentage of mass in the common halo is small. On the
contrary the central object formed in initially cusped models has projected
radial profiles in very good agreement with those of brightest cluster members,
sometimes also showing luminosity excess over the $r^{1/4}$ law in the outer
parts, as is observed in cD galaxies.

Astrophysics