I know L-BFGS-B only supports simple box constrains of the form: $l_i \leq x_i \leq u_i$, where $l_i$ and $u_i$ are constants. For my specific optimization problem, I need to specify some simple linear constraints of the form:
$x_{i-1} + k \leq x_i \leq x_{i+1}-k $ where $k>0$ is a fixed constant. Essentially, I need each variable $x_i$ to stay in-between (and within a certain distance away from) the two variables at index $i-1$ and $i+1$. Is it possible to achieve this with L-BFGS-B?
Can the $l$ and $u$ constraint vectors be modified after each iteration? One silly idea I have tried (and seems to work, although I have not extensively tested it) is to modify $l$ and $u$ after each iteration with this rule:
$$l_i = x_{i-1} + k$$ $$u_i = x_{i+1} - k$$
Thanks in advance!
EDIT: I forgot to mention that the first variable ($x_0$) is also subject to a constant lower bound and the last variable ($x_{N-1}$) is subject to an constant upper bound:
$$x_0 \geq k$$
$$x_{N-1} \leq k_{max}$$
This makes recasting the problem into a basis where the unknowns are the differences of two $x$ variables not feasible since these two extra bounds (which in the current system are actual box constraints) would then become linear constraints.