Optimization in vector spaces