  We consider the problem of optimal location of a Dirichlet region in a
$d$-dimensional domain $\Omega$ subjected to a given right-hand side $f$ in
order to minimize some given functional of the configuration. While in the
literature the Dirichlet region is usually taken $d-1$ dimensional, in this
shape optimization problems, we consider two classes of control variables,
namely the class of one dimensional closed connected sets of finite one
dimensional Hausdorff measure and the class of sets of points of finite
cardinality, and we give a necessary condition of optimality.
