In this paper a novel clustering algorithm is proposed, namely Variational Multilevel Mesh Clustering (VMLC). The algorithm incorporates the advantages of both hierarchical and variational (Lloyd) algorithms, i.e. the initial number of seeds is not predefined and on each level the obtained clustering configuration is quasi-optimal. The algorithm performs a complete mesh analysis regarding the underlying energy functional. Thus, an optimized multilevel clustering is built. The first benefit of this approach is that it resolves the inherent problems of variational algorithms, for which the result and the convergence is strictly related to the initial number and selection of seeds. On the other hand, the greedy nature of hierarchical approaches, i.e. the non-optimal shape of the clusters in the hierarchy, is solved. We present an optimized implementation based on an incremental data structure. We demonstrate the generic nature of our approach by applying it for the generation of opti...