I have an optimization problem where the objective (and some of the constraints) contain piecewise linear functions. The problem is relatively large and my attempts at solving it with pyomo and SCIP have not been very successful in terms on runtime. So I wanted to give it a shot using Julia after I learned about PiecewiseLinearOpt.jl

I am new to Julia and JuMP so maybe I have misunderstood things, but can I model a non-continuous piecewise linear function in PiecewiseLinearOpt.jl? If my understanding is correct, I need to pass in the breakpoints and the corresponding values. But with a non-coninuous function I don’t see how this can be done.

For example, consider the following function:

So at 2 and 4, the function is not continuous. And I was interested in trying PiecewiseLinearOpt.jl because it offers different formulations. I have modelled this using binary variables and big-M but the runtime is just horrendous (my problem involves summing millions of non continuous piecewise functions).

The problem I am trying to solve is essentially a profit maximisation problem with churn. So i have a set of customers that have a probability of churning (depending on what price I offer them, call it x_n). So something like this:

Where prob_n is the probability of churning and instead of just (1+x_n) I have x_n with some additional parameters indexed by n. But basically I want to maximise expected profits.

The above is obviously not an interesting problem. In the real problem, I have additional constraints that turns this into a knapsack problem of sorts. But since the set of customers is very large, it is taking very long to solve.

Given the industry I am trying to apply this for, this is surprisingly how we expect churn to look. I was thinking about removing the x_n \leq 0 segment, and turning the remaining segments into a ReLU shaped function and see if that helps. In the worst case scenario I will simply have to group customers together reduce the size of the problem.