I have an algorithm (in R) that maximizes a convex function on a compact convex set in every iteration. Based on the maximum principle, I know that the maximima are only attained on the boundary. But my current implementation searches in the whole space which is not necessary and time-consumer. To increase the time efficiency, I would like to narrow the search space, but I couldn't find any algorithm that only searchs on the boundary. Any help is appreciated.
Edit: The dimension can very from 2 to 6. For case 2 the compact set is a rectangle [a, b]*[c, d] and the boundary is the perimeter of the rectangle. The function is nonlinear.
P.S. I have the R code, but if I publish it here then my question would be transfered to Stack Overflow, which I don't think is a right place for my problem. I am looking for an algorithm or optimization method only the boundary.