In this paper, we study the optimization problem [Formula: see text] in a suitable functional space [Formula: see text]. Here, [Formula: see text] is the multi-singular potential given by [Formula: see text] and all the singular poles [Formula: see text], [Formula: see text], arise either in the interior or at the boundary of a smooth open domain [Formula: see text], with [Formula: see text] or [Formula: see text], respectively. For a bounded domain [Formula: see text] containing all the singularities in the interior, we prove that [Formula: see text] when [Formula: see text] and [Formula: see text] when [Formula: see text] (it is known from [C. Cazacu and E. Zuazua, Improved multipolar hardy inequalities, in Studies in Phase Space Analysis with Application to PDEs, Progress in Nonlinear Differential Equations and Their Applications, Vol. 84 (Birkhäuser, New York, 2013), pp. 37–52] that [Formula: see text]. In the situation when all the poles are located on the boundary, we show that [Formula: see text] if [Formula: see text] is either a ball, the exterior of a ball or a half-space. Our results do not depend on the distances between the poles. In addition, in the case of boundary singularities we obtain that [Formula: see text] is attained in [Formula: see text] when [Formula: see text] is a ball and [Formula: see text]. Besides, [Formula: see text] is attained in [Formula: see text] when [Formula: see text] is the exterior of a ball with [Formula: see text] and [Formula: see text] whereas in the case of a half-space [Formula: see text] is attained in [Formula: see text] when [Formula: see text]. We also analyze the critical constants in the so-called weak Hardy inequality which characterizes the range of [Formula: see text] ensuring the existence of a lower bound for the spectrum of the Schrödinger operator [Formula: see text]. In the context of both interior and boundary singularities, we show that the critical constants in the weak Hardy inequality are [Formula: see text] and [Formula: see text], respectively.