One of the major questions in high-density transcranial electrical stimulation (TES) is: given a region of interest (ROI), and given electric current limits for safety, how much current should be delivered by each electrode for optimal targeting? Several solutions, apparently unrelated, have been independently proposed depending on how "optimality" is defined and on how this optimization problem is stated mathematically. Among them, there are closed-formula solutions such as ones provided by the least squares (LS) or weighted LS (WLS) methods, that attempt to fit a desired stimulation pattern at ROI and non-ROI, or reciprocity-based solutions, that maximize the directional dose at ROI under safety constraints. A more complete optimization problem can be stated as follows: maximize directional dose at ROI, limit dose at non-ROI, and constrain total injected current and current per electrode (safety constraints). To consider all these constraints (or some of them) altogether, numerical convex or linear optimization solvers are required. We theoretically demonstrate in this work that LS, WLS and reciprocity-based closed-form solutions are particular solutions to the complete optimization problem stated above, and we validate these findings with simulations on an atlas head model. Moreover, the LS and reciprocity solutions are the two opposite cases emerging under variation of one parameter of the optimization problem, the dose limit at non-ROI. LS solutions belong to one extreme case, when the non-ROI dose limit is strictly imposed, and reciprocity-based solutions belong to the opposite side, i.e., when this limit is loose. As we couple together most optimization approaches published so far, these findings will allow a better understanding of the nature of the TES optimization problem and help in the development of advanced and more effective targeting strategies.