  Given a function f defined on a bidimensional bounded domain and a positive
integer N, we study the properties of the triangulation that minimizes the
distance between f and its interpolation on the associated finite element
space, over all triangulations of at most N elements. The error is studied in
the W1p norm and we consider Lagrange finite elements of arbitrary polynomial
order m-1. We establish sharp asymptotic error estimates as N tends to infinity
when the optimal anisotropic triangulation is used. A similar problem has been
studied earlier, but with the error measured in the Lp norm. The extension of
this analysis to the W1p norm is crucial in order to match more closely the
needs of numerical PDE analysis, and it is not straightforward. In particular,
the meshes which satisfy the optimal error estimate are characterized by a
metric describing the local aspect ratio of each triangle and by a geometric
constraint on their maximal angle, a second feature that does not appear for
the Lp error norm. Our analysis also provides with practical strategies for
designing meshes such that the interpolation error satisfies the optimal
estimate up to a fixed multiplicative constant. We discuss the extension of our
results to finite elements on simplicial partitions of a domain of arbitrary
dimension, and we provide with some numerical illustration in two dimensions.
