You could linearize the function x -> xlog(x), that is approximate it with a piecewise linear function F.
then you define new variables yj == F(xj) and minimize the sum of yj.
As Alex mentioned, this will introduce binary variables and change the nature of your problem to MILP.
------------------------------
Philippe Couronne
------------------------------
Original Message:
Sent: Thu November 05, 2020 10:32 AM
From: ALEX FLEISCHER
Subject: Can CPLEX solve a problem with a logarithm in the objective function (e.g. optimize entropy)
Hi,
you can either use CPO
using CP;
int scale=1000;
dvar int scalex in 1..1000000;
dexpr float x=scalex/scale;
maximize x;
subject to
{
log(x)<=2.5;
}
execute
{
writeln("x=",x);
}
works fine and you can do that in C++ too
or you can linearize and then use CPLEX MIP
------------------------------
ALEX FLEISCHER
Original Message:
Sent: Wed November 04, 2020 05:09 PM
From: Patrick Kreitzber
Subject: Can CPLEX solve a problem with a logarithm in the objective function (e.g. optimize entropy)
Hi,
I am trying to optimize for the Shannon entropy of a system. This would mean the objective function is (summing over i) Σxi*log(xi). The problem is linearly constrained.
I am not sure if there is anyway to get CPLEX to solve for this directly? Preferably using the C API as that is what I have a decent amount of experience using. Any help would be appreciated!
Thanks in advance
------------------------------
Patrick
------------------------------