Difference between revisions of "ApCoCoA-1:GLPK.MIPSolve"
KHiddemann (talk | contribs) m (wrong title) |
|||
Line 8: | Line 8: | ||
{{ApCoCoAServer}} | {{ApCoCoAServer}} | ||
− | <em>Objective_f</em>: A linear polynomial which is equivalent to the linear objective function. | + | <itemize> |
− | + | <item>@param <em>Objective_f</em>: A linear polynomial which is equivalent to the linear objective function.</item> | |
− | <em>EQ_Poly</em>: List of linear polynomials, which are equivalent to the equality-part in the list of conditions. | + | <item>@param <em>EQ_Poly</em>: List of linear polynomials, which are equivalent to the equality-part in the list of conditions.</item> |
− | + | <item>@param <em>LE_Poly</em>: List of linear polynomials, which are equivalent to the lower or equal-part in the list of conditions.</item> | |
− | <em>LE_Poly</em>: List of linear polynomials, which are equivalent to the lower or equal-part in the list of conditions. | + | <item>@param <em>GE_Poly</em>: List of linear polynomials, which are equivalent to the greater or equal-part in the list of conditions.</item> |
− | + | <item>@param <em>Bounds</em>: List of lists with two elements. Each List contains the lower and upper bounds for each variable. You can choose between INT or RAT for the type of each bound, if you type in a (empty) string, then it means minus infinity (first place) or plus infinity (second place).</item> | |
− | <em>GE_Poly</em>: List of linear polynomials, which are equivalent to the greater or equal-part in the list of conditions. | + | <item>@param <em>IntNum</em>: List of variables, which should be integer. <em>Note</em>: For each variable in this list, the borders get rounded (lower bound: up and upper bound: down). In the case that the lower rounded bound becomes greater then the upper rounded bound, glpk returns: Solution Status: INTEGER UNDEFINED - Value of objective function: 0.</item> |
− | + | <item>@param <em>Binaries</em>: List of variables, which should be binaries (0 or 1).</item> | |
− | <em>Bounds</em>: List of lists with two elements. Each List contains the lower and upper bounds for each variable. You can choose between INT or RAT for the type of each bound, if you type in a (empty) string, then it means minus infinity (first place) or plus infinity (second place). | + | <item>@param <em>MinMax</em>: Minimization ("Min") or maximization ("Max"), that's the question.</item> |
− | + | <item>@return List of linear polynomials, the zeros of the polynomials are the points where the optimal value of the objective function is archieved</item> | |
− | <em>IntNum</em>: List of variables, which should be integer. <em>Note</em>: For each variable in this list, the borders get rounded (lower bound: up and upper bound: down). In the case that the lower rounded bound becomes greater then the upper rounded bound, glpk returns: Solution Status: INTEGER UNDEFINED - Value of objective function: 0. | + | </itemize> |
− | |||
− | <em>Binaries</em>: List of variables, which should be binaries (0 or 1). | ||
− | |||
− | <em>MinMax</em>: Minimization ("Min") or maximization ("Max"), that's the question. | ||
− | |||
First we want to discuss a rather easy example. | First we want to discuss a rather easy example. | ||
Line 46: | Line 41: | ||
Value of objective function: 5 | Value of objective function: 5 | ||
[x[1] - 2, x[2] - 4] | [x[1] - 2, x[2] - 4] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</example> | </example> | ||
Line 181: | Line 50: | ||
<key>solve linear programm</key> | <key>solve linear programm</key> | ||
<key>solve lp</key> | <key>solve lp</key> | ||
− | <key> | + | <key>GLPK.MIPSolve</key> |
− | |||
<wiki-category>Package_GLPK</wiki-category> | <wiki-category>Package_GLPK</wiki-category> | ||
</command> | </command> |
Revision as of 11:37, 21 April 2009
MIPSolve
solve linear programms
Syntax
GLPK.MIPSolve(Objective_f:POLYNOM, EQ_Poly:LIST, LE_Poly:LIST, GE_Poly:LIST, Bounds:LIST, IntNum:LIST, Binaries:LIST, MinMax:STRING)
Description
Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use
it/them.
@param Objective_f: A linear polynomial which is equivalent to the linear objective function.
@param EQ_Poly: List of linear polynomials, which are equivalent to the equality-part in the list of conditions.
@param LE_Poly: List of linear polynomials, which are equivalent to the lower or equal-part in the list of conditions.
@param GE_Poly: List of linear polynomials, which are equivalent to the greater or equal-part in the list of conditions.
@param Bounds: List of lists with two elements. Each List contains the lower and upper bounds for each variable. You can choose between INT or RAT for the type of each bound, if you type in a (empty) string, then it means minus infinity (first place) or plus infinity (second place).
@param IntNum: List of variables, which should be integer. Note: For each variable in this list, the borders get rounded (lower bound: up and upper bound: down). In the case that the lower rounded bound becomes greater then the upper rounded bound, glpk returns: Solution Status: INTEGER UNDEFINED - Value of objective function: 0.
@param Binaries: List of variables, which should be binaries (0 or 1).
@param MinMax: Minimization ("Min") or maximization ("Max"), that's the question.
@return List of linear polynomials, the zeros of the polynomials are the points where the optimal value of the objective function is archieved
First we want to discuss a rather easy example.
Example
We want to maximize the Function y = - 1/2x, with the two conditions y ≤ 6 - 3/4x and y ≥ 1 - x and the bounds 0 ≤ x ≤ 6 and 1/3 ≤ y ≤ 4. We prename the input of GLPK.MIPSolve-function. Use S::=Q[x,y]; OF := 1/2x + y; LE := [3/4x + y - 6]; GE := [x + y - 1]; Bounds:=[[0,6], [1/3,4]]; IntNum:=[x,y]; Then we compute the solution with $GLPK.MIPSolve(OF, [], LE, GE, Bounds, IntNum, [], "Max"); And we achieve: Solution Status: INTEGER OPTIMAL Value of objective function: 5 [x[1] - 2, x[2] - 4]