Recent papers in multiscale morphological filtering, particularly, have renovated the interest in signal representation via multiscale openings. Although most of the analysis was done with flat structuring elements, extensions to grayscale structuring elements (GSE) are certainly possible. In fact, we have shown that opening a signal with convex and symmetric GSE does not introduce additional zero-crossings as the filter moves to a coarser scales. However, the issue of finding an optimal GSE is still an open problem. In this paper, we present a procedure to find an optimal GSE under the least mean square (LMS) algorithm subject to three constraints: The GSE must be convex, symmetric, and non-negative. The use of the basis functions simplifies the problem formulation. In fact, we show that the basis functions for convex and symmetric GSE are concave and symmetric, thus alternative constraints are developed. The results of this algorithm are compared with our previous work.