I would like to set up a linear program (if it is possible, I'm not sure) to solve this problem in R:
I want to minimize the function:
abs(x1) + abs(x2) + abs(x3) + abs(x4)
Constraints:
x1 + x2 + x3 + x4 = 0
0.2x1 + 0.3x2 + 0.5x3 + 0.1x4 = 0.2
Constraints are usually written as inequalities so I assume I can have two equations of each, one with <= 0 and <= 0.2, and the other two with >= 0 and >= 0.2. The decision variables are continuous and can be positive or negative.
I can setup the matrix for the constraints to use lpSolve but I am most confused about how to implement the absolute value functions in the objective function. This site (http://lpsolve.sourceforge.net/5.1/absolute.htm) was a good read but I'm not sure how to translate that into the inputs for lpSolve in R. Any help or guidance would be much appreciated!