A multispace search algorithm for molecular energy minimization