  We propose a universal approach to a range of enumeration problems in graphs.
The key point is in contracting suitably chosen symmetric tensors placed at the
vertices of a graph along the edges. In particular, this leads to an algorithm
that counts the number of d-regular subgraphs of an arbitrary graph including
the number of d-factors (previously we considered the case d=2 with a special
emphasis on the enumeration of Hamiltonian cycles; cf. math.CO/0403339). We
briefly discuss the problem of the computational complexity of this algorithm.
