For a particle to revolve in a vertical loop, the minimum velocity that the particle has at the top of the circle must be just 0. The tension in the string attached to the particle must be just above 0. . The centripetal force of the particle at the top of the circle must be just equal to the weight.
m g = m v2² / r , v2 = velocity of particle at the top
KE of the particle at the bottom of the circle = initial KE = 1/2 m v²
v = initial velocity
applying the conservation of energy at the top of the circle:
1/2 m v² = m g (2 r) + 1/2 m v2²
= 2 m g r + 1/2 m g r
simplyfying, we get : v² = 5 g r and v = √(5gr)