Enumerative invariants in algebraic geometry and string theory