We analyze a new algorithm for the finite element approximation of a family of eigenvalue problems for the curl operator that includes, in particular, the approximation of the helicity of a bounded domain. It exploits a tree-cotree decomposition of the graph relating the degrees of freedom of the Lagrangian finite elements and those of the first family of Nédélec finite elements to reduce significantly the dimension of the algebraic eigenvalue problem to be solved. The algorithm is well adapted to domains of general topology. Numerical experiments, including a not simply connected domain with a not connected boundary, are presented in order to assess the performance and generality of the method.