⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lp_solve.1

📁 linux下的源码分类器SVM
💻 1
字号:
.TH LP_SOLVE 1.SH NAMElp_solve \- Solve (mixed integer) linear programming problem..SH SYNOPSISlp_solve [option]* "<" <input-file>.SH OPTIONS.TP 1.2i-vVerbose mode. Among other things, shows all the pivots..TP-hHelp mode, prints the usage..TP-dDebug mode, all intermediate results are printed, and the branch-and-bounddecisions in case of (mixed) integer problems..TP-minminimize the objective function. This is the default for MPS input.In lp_solve format you can specify minimization or maximization in the inputfile as well. The command line option overrides..TP-maxmaximize the objective function. This is the default for lp_solve formatinput.In lp_solve format you can specify minimization or maximization in the inputfile as well. The command line option overrides..TP-pOnly functional for pure LP problems. Print the values of the dualvariables as well in the result. They are named r_1 until r_XXXXX unlessspecified by the user.  Note that bounds (constraints on just one variable)are not considered real constraints, and are not given a row in the matrix,and are therefore not printed here..TP-b <bound>Specify an upper (when minimizing) or lower (when maximizing) limit for thevalue of the objective function tothe program. Only useful for (mixed) integer problems.  If close enough, mayspeed up the calculations. The same result can be obtained by adding an extraconstraint to the problem..TP-cWhen branching in MILP problems, take the ceiling of the selected non-integervariable first instead of the floor. This can influence the speed of MILPproblems..TP-e <value>Specify the accuracy with which it is checked whether the value of a variableis really integer. <value> must be between 0 and 0.5. Default value is 1e-6and should be OK for most applications. Of course only useful for MILPproblems..TP-iPrint all intermediate valid solutions. Can give you usefulsolutions even if the total run time is too long.Only useful for (mixed) integer problems..TP-sBoth rows and columns are scaled according to the geometric mean of thecoefficients on them before solving. This might improve the numericalstability of your problem..TP-IPrint info after reinverting..TP-tTrace pivot selection..TP-mpsRead from MPS file instead of lp file. For a short introduction to MPS seeftp://softlib.cs.rice.edu/pub/miplib/mps_format..TP-degenUse random perturbations to reduce degeneracy, can increase numericalinstability..SH DESCRIPTIONThe linear programming problem can be formulated as: Solve A.x >= V1, withV2.x maximal. A is a matrix, x a vector of (nonnegative) variables, V1 avector called the right hand side, and V2 a vector specifying the objectivefunction..brAny number of the variables may be specified to be of type integer..brThis program solves problems of this kind. It is slightly more general thanthe above problem, in that every row of A (specifying one constraint) can haveits own (in)equality, <=, >= or =. The result specifies values for allvariables..brUses a 'Simplex' algorithm and sparse matrix methods, for pure LP problems.If one or more of the variables is declared integer, the Simplex algorithm isiterated with a branch and bound algorithm, until the desired optimalsolution is found..brThe "-i" option will print all intermediate valid solutions..SH "INPUT SYNTAX"The default input syntax is a set of algebraic expressions and "int"declarations in the following order:.sp<objective function>.br<constraint>+.br<declaration>*.spwhere:.TP 0.2i-<objective function> is a linear combination of variables, ending with asemicolon, optionally preceded by "max: " or "min: " to indicate whether youwant it to be minimized or maximized. The case is not important, "Max:" or"MAX:" will work as well. Maximization is the default..TP-<constraint> is an optional constraint name followed by a colon plus alinear combination of variables and constants, followed by a relationaloperator, followed again by a linear combination of variables and constants,ending with a semicolon. The relational operator can be any of the following:"<" "<=" "=" ">" ">=". There is no semantic difference between "<" and "<="nor between ">" and ">=" (even for integer variables!)..TP-<declaration> is of the form: "int" <var>+ ";" Commas are allowed betweenvariables..spSo, the simplest linear problem consists of an objective function and 1constraint..SH EXAMPLEThe simple problem:.spx1 >= 1.brx2 >= 1.brx1 + x2 >= 2.brminimize x1 + x2 (= maximize -(x1 + x2)), with x1 integer.spcan be written as follows:.sp-x1 + -x2;.br(or min: x1 + x2;).brx1 > 1;.brx2 > 1;.brx1 + x2 > 2;.brint x1;.spThe correct result for (x1, x2) is of course (1, 1)..brWith the -mps option, lp_solve will accept MPS as input format..SH BUGSSpecifying a constraint name for a bound (constraints on just singlevariables) does not have an effect: they are not stored inside the main matrixand are not assigned a dual variable..TP-The problem consists entirely of constraints on just single variables(so-called "bounds", like x < 1; ) and no constraint with more than 1variable (like x + 3 y > 17; ). This leaves lp_solve with an empty problemmatrix, as bounds are not stored in the main matrix. No real-life examplesshould be of this form, so I am not really chasing this problem..TP-Many people forget that lp_solve can only handle POSITIVE values for thevariables. While reading MPS files it will however handle free or negativevariables by replacing them with a variable pair <var>_neg and <var>_pos or-<var> respectively. It is up to the user to interpret the result of thistransformation..TP- Sometimes problems are numerically unstable, and the unavoidable roundingerrors inside lp_solve will cause aborts. It is very hard to give generalsolutions to this problem, but try to keep all values in your problem in theorder of magnitude of 1 by proper scaling. This is almost always better thanusing lp_solves built-in scaling (with -s). Almost parallel constraints arealso not very good for numerical stability. Use "lp_solve -v" and observe thevalues of the pivots to see if there are any dangerously large or low numbersthere..brBuilding lp_solve with long doubles (see the Makefile) can help to increasenumerical stability, but will also increase the run time considerably..brYou can consult the author as well if you encounter numerical problems, butplease remember that it is very easy to formulate an infeasible LP problem, sobe sure there is a solution..SH SEE ALSOThe implementation of the simplex kernel was mainly based on:.brW. Orchard-Hays: "Advanced Linear Programming Computing Techniques",McGraw-Hill 1968.brThe mixed integer branch and bound part was inspired by:.brsection 6.4 of "An Introduction to Linear Programming and Game Theory" byPaul R. Thie, second edition published by John Wiley and Sons in 1988..brThis book refers to:.brDakin, R.J., "A Tree Search Algorithm for MILP Problems", Comput. J., 8 (1965)pp. 250-255.SH ACKNOWLEDGEMENTSThe work of Jeroen Dirks made the transition from the basic version 1.5 tothe full version 2.0 possible. He contributed the procedural interface, abuilt-in MPS reader, and many fixes and enhancements to the code..SH CONTRIBUTED BYM.R.C.M. Berkelaar.brEindhoven University of Technology.brDesign Automation Section.brP.O. Box 513.brNL-5600 MB Eindhoven, The Netherlands.brphone +31-40-2474792.brE-mail: michel@es.ele.tue.nl.SH STATUSUse at own risk. Bug reports are welcome, as well as success stories.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -