  The onset of star formation is set by the collapse of filaments in the
interstellar medium. From a theoretical point of view, an isolated cylindrical
filament forms cores via the edge effect. Due to the self-gravity of a
filament, the strong increase in acceleration at both ends leads to a pile-up
of matter which collapses into cores. However, this effect is rarely observed.
Most theoretical models consider a sharp density cut-off at the edge of the
filament, whereas a smoother transition is more realistic and would also
decrease the acceleration at the ends of the filament. We show that the edge
effect can be significantly slowed down by a density gradient, although not
completely avoided. However, this allows perturbations inside the filament to
grow faster than the edge. We determine the critical density gradient for which
the timescales are equal and find it to be of the order of several times the
filament radius. Hence, the density gradient at the ends of a filament is an
essential parameter for fragmentation and the low rate of observed cases of the
edge effect could be naturally explained by shallow gradients.
