  For decades, the boundary of cosmic filaments have been a subject of debate.
In this work, we determine the physically-motivated radii of filaments by
constructing stacked galaxy number density profiles around the filament spines.
We find that the slope of the profile changes with distance to the filament
spine, reaching its minimum at approximately 1 Mpc at z = 0 in both
state-of-the-art hydrodynamical simulations and observational data. This can be
taken as the average value of the filament radius. Furthermore, we note that
the average filament radius rapidly decreases from z = 4 to z = 1, and then
slightly increases. Moreover, we find that the filament radius depends on the
filament length, the distance from connected clusters, and the masses of the
clusters. These results suggest a two-phase formation scenario of cosmic
filaments. The filaments experience rapid contraction before z = 1, but their
density distribution has remained roughly stable since then. The subsequent
mass transport along the filaments to the connected clusters is likely to have
contributed to the formation of the clusters themselves.
