How can I solve the following Linear Programming problem in the easiest way?
How can the summation terms be modeled in there?
From page 187 of Mathematical Programming Approaches by Charu Chandra and Janis Grabis.
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It only takes a minute to sign up.Sign up to join this community
I generally agree with Aron's answer.
Depending on the modeling software you use, the matrix notation $Ax = b$ may be more or less convenient than sigma notation. For instance, with the C++ interfaces to CPLEX, CLP, CBC, and the Open Solver Interface (OSI), the linear algebra notation is definitely easier to work with, since the interfaces specifically ask you to set up the problem in (more or less) the form of $Ax = b$ (these interfaces are slightly more flexible).
However, some software packages treat defining a linear program as a more declarative process. Examples include GAMS, and the Python packages PuLP and Coopr. These packages focus on making the process of defining the LP look much more like the summation (or sigma) notation used in many problems. It is, of course, possible to force a problem coded in one of these packages to look like $Ax = b$, but it's nice not to have to resort to that notation if you find it cumbersome. Furthermore, these packages are not set up as standalone solvers, and thus are much more likely to have interfaces to multiple solvers, allowing for increased flexibility in implementation (since solvers vary in speed) and distribution (not everyone has licenses for closed-source solvers).
For these reasons, I'd recommend, in decreasing order of preference:
It took me only about a day or so to learn enough about PuLP to solve small research-scale problems. It took me a couple weeks to get the hang of OSI for research, because compiled languages require more time for development; first, there was the issue of installation, then making sure that I could compile the example files and set up Makefiles correctly, and finally, programs written in C++ are generally a few times longer than programs written in Python to accomplish the same task.
If you really must use MATLAB, Aron's recommendations are probably best. To those, I'd add the MATLAB interface to lpsolve, the MATLAB scripts accompanying the book Linear Programming with Matlab, the CPLEX for MATLAB toolbox, and the YALMIP toolbox.
Of these, the YALMIP toolbox looks most promising because it's free and open source, uses declarative syntax similar to GAMS, PuLP, and Coopr, and has interfaces to a wide variety of free and nonfree solvers for many types of problems (not just linear programming). I haven't used it yet, since I typically do most of my work in the other tools I've mentioned.
Any Linear Program (LP) can be solved by a variety of freely available software. The sigma notation can be converted to linear algebra notation $Ax=b$, which is what will be expected by the LP solver unless you are using a more advanced optimization design framework. You asked about MATLAB, which contains a Linear Programming solver in its Optimization Toolbox, which is available under separate license.
You might be interested in CVX, a freely available toolbox for MATLAB that can solve LPs amongst a more general class of optimization problems.
The problem you have is more an OR problem. As I see, you have a target function and some constraints. IBM ILOG CPLEX Optimization Studio, also known as CPLEX, is a professional software to solve these types of questions. SAS also does optimization and simulation. Hope this answer helps.
Please take a look at lpsolve:
lp_solve is a free (see LGPL for the GNU lesser general public license) linear (integer) programming solver based on the revised simplex method and the Branch-and-bound method for the integers. It contains full source, examples and manuals. lp_solve solves pure linear, (mixed) integer/binary, semi-continuous and special ordered sets (SOS) models.
I would recommend using JuMP. You can see here that expressions and constraints can be written directly in terms of summations. The objective function can be written in terms of sums using standard Julia (i.e. use the
sum function on arrays and things like that which make sense and is easily readable).
But what's even better than the fact that you can easily write the objective and constraints directly in the
sum notation, but you can then use that model to solve the equation using a ton of other packages, standard commercial and open source solvers, all directly from within JuMP. This list right here is a list of the most widely used LP solvers, and you can just test them all in one go without changing your syntax using JuMP.