  In this paper we present a lower bound for the minimal dimension
$\mu(\mathfrak{n})$ of a faithful representation of a finite dimensional
$p$-step nilpotent Lie algebra $\mathfrak{n}$ over a field of characteristic
zero. Our bound is given as the minimum of a quadratically constrained linear
optimization problem, it works for arbitrary $p$ and takes into account a given
filtration of $\mathfrak{n}$. We present some estimates of this minimum which
leads to a very explicit lower bound for $\mu(\mathfrak{n})$ that involves the
dimensions of $\mathfrak{n}$ and its center. This bound allows us to obtain
$\mu(\mathfrak{n})$ for some families of nilpotent Lie algebras.
