Minty variational inequality and optimization: scalar and vector case