Home

File formats supported by CPLEX (12.1)

image

Contents

1. SOSORG X5 obj 9 SH 5 x5 ce 3 x6 obj 6 eil 8 x6 CS E NAME 1 MARKER SOSEND The SOS MARKER lines can appear between integer MARKER lines if all members of the SOS are integer or integer MARKER lines can appear between SOS MARKER lines if some members of the SOS are non integer The MARKER format cannot accommodate overlapping SOSs That is a variable cannot be a member of two special ordered sets Overlapping SOSs can however be specified by the CPLEX SOS format documented in Special ordered sets SOS in MPS files REFROW section for SOS in MPS files A REFROW section may be included immediately before the Rows section It consists of exactly one record line with the name of the reference row starting in Field 2 The specified row must also be defined in the Rows section The nonzeros of the reference row are used as weights within an SOS All weights within one SOS must be unique values A REFROW section is optional if no reference row is specified the weighting values 1 nis given to then members of an SOS in the order in which they are read In other words without specific reference row information it is assumed that the user has ordered the SOS variables in ascending order with respect to some relevant criterion for example in importance capacity objective weighting or cost FORMATS SUPPORTED BY CPLEX Quadratic objective information in MPS files If you use the CPLEX barrier o
2. because the second style splits the variable name x2 with a return The objective function may be named by typing a name and a colon before the objective function The objective function name and the colon must appear on the same line Objective function names must conform to the same guidelines as variable names See the rule about Variables If no objective function name is specified CPLEX assigns the name obj An objective function may be quadratic For an example and details about formatting a quadratic objective function see the rule about Quadratic terms Constraints The constraints section is introduced by the keyword subject to This expression can also appear as such that st S T orST in any mix of upper and lower case characters One of these expressions must precede the first constraint and be separated from it by at least one space Each constraint definition must begin on a new line A constraint may be named by typing a name and a colon before the constraint The constraint name and the colon must appear on the same line Constraint names must adhere to the same guidelines as variable names See the rule about names of Variables If no constraint names are specified CPLEX assigns the names c1 c2 c3 etc The constraints are entered in the same way as the objective function however a constraint must be followed by an indication of its sense and a righthand side coefficient The righthand FORMATS SUPPORTED B
3. lt x5 lt 5 6 The bounds positive infinity and negative infinity must be entered as words infinity infinity tinf inf A variable with a negative infinity lower bound and positive infinity upper bound may be entered as free in any mix of upper and lower case characters with a space separating the variable name and the word free For example x7 free is equivalent to infinity lt x7 lt infinity End of file The file must end with the word endin any combination of upper and lower case characters alone on a line when it is created with the enter command This word is not required for files that are read in to CPLEX but it is strongly recommended Files that have been corrupted can frequently be detected by a missing last line MIP integer variables This rule applies to the CPLEX MIP optimizer FILE FORMATS SUPPORTED BY CPLEX 21 22 E E E To specify any of the variables as general integer variables add a GENERAL section to specify any of the variables as binary integer variables add a BINARY section The GENERAL and BINARY sections follow the BOUNDS section if one is present otherwise they follow the constraints section Either of the GENERAL or BINARY sections can precede the other The GENERAL section is preceded by the word GENERAL GENERALS or GEN in any mix of upper and lower case characters which must appear alone on a line The following line or lines should list the nam
4. AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE end of license terms of dtoa routine of the gdtoa package Table of contents POF SUD POM TET 7 Contacting IBM Suppott cccescccssseceeeseeeseeeeeeeeeesnaeeenseeeeseaaeeaseeeeseaaesaseeeeeesaeseseeeeeeseeanseeeeenees 8 File Formats Reference Manual ccccccccsssseeseseseececeeeeeeeeeeeeeeeeeeeeeeeeenseeeenenseneees 11 Brief descriptions of file fOrMatS ccccceceeeeeeeeeeneeeeeeeeenee essere esse enesenn enen ennes 13 Reading and entering file formats in the Interactive Optimizet csssseereeeeeeeeees 17 Saving problems in the Interactive Optimtzer sssee sees sees ees eese esse serres ereer enrere eee 18 LP file format matrix models ssssceesssseeesssseee essere essere ennenen ennenen ennenen nenen 19 MPS file format industry standard esse sssvessvesssvesseeeseeeseeeseeennrennnr ereenn eenn 25 Overview of 1 istic EE deceives e DEE vtec acts aa aeaaaee eee 26 Records MPS Kean 27 Examplesof MPS file fo MAT reese geed EERSTEN 32 Special records in MPS files CPLEX exteNnSiOnS sccseeeeeeseceseeeeeeeeeeesneeeeeeeeeeneeeensenees 33 Overview of MPS extension ise engl d Ee cashed bavere asin tacts 2222122 E THR 2220 a 774 35 Objective sense and name in MPS les 36 Integer variables in MPS les 37 Special ordered sets SOS in MPS ies AE 3
5. Additional range vectors are discarded The BOUNDS section In the BOUNDS section bound values for variables may be specified Field 1 Type of bound Acceptable values are L0 Lower bound up Upper bound FORMATS SUPPORTED BY CPLEX Fx Fixed value upper and lower bound the same FR Free variable lower bound and upper bound mI Minus infinity lower bound PL Plus infinity upper bound Field 2 Bound identifier Field 3 Column identifier to be bounded Field 4 Value of the specified bound Fields 5 and 6 are not used in the BOUNDS section In our example the BOUNDS section looks like this BOUNDS UP BOUND x1 40 If no bounds are specified CPLEX assumes a lower bound of 0 zero and an upper bound of o If only a single bound is specified the unspecified bound remains at 0 or whichever applies with one exception If an upper bound of less than 0 is specified and no other bound is specified the lower bound is automatically set to 0 CPLEX deviates slightly from a convention used by some MPS readers when it encounters an upper bound of 0 zero Rather than automatically set this variable s lower bound o s CPLEX accepts both a lower and upper bound of 0 effectively fixing that variable at 0 CPLEX resets the lower bound to only if the upper bound is less than 0 A warning message is issued when this exception is encountered More than one bound vector may exist The
6. Field 3 FILE FORMATS SUPPORTED BY CPLEX 29 30 ELLE Field 5 Row identifier optional Field 6 Value of the range applied to row specified by Field 5 optional The effect of specifying a righthand side range depends on the sense of the specified row and whether the range has a positive or negative coefficient How range values are interpreted in data records of MPS files specifies how range values are interpreted Fora given row rhs is the righthand side value and range is the corresponding range value How range values are interpreted in data records of MPS files Row type Range value sign Resulting rhs upper limit Resulting rhs lower limit The name of each range vector appears in Field 2 More than one range vector can be specified within an MPS file However only the first range vector is selected when a problem is read Additional range vectors are discarded In our example there are no ranged rows but suppose we want to add the following constraint to our problem pel bh Se LS Instead of explicitly adding another row to the problem we can represent this additional constraint by modifying row 2 of the example to make it a ranged row in this way ie lt sail Sie ap 5S lt S00 The RANGES section of the MPS file to support this modification looks like this RANGES rhs c2 L5 The name of each range vector appears in Field 2 However only the first range vector is selected when a problem is read
7. X3 ee 2 x4 obj il cal 10 x4 E FE RHS rhs oil 20 C2 30 BOUNDS UP BOUND x1 40 LI BOUND x4 2 UI BOUND x4 3 SOS Si setil Sek 10000 x2 20000 x4 40000 ENDATA MARKER lines for SOS in MPS files MARKER lines are used to delimit SOS in the COLUMNS section of an MPS file much like using integer markers The single quotation mark before and after the term is necessary The names of the sets are specified in the second field starting in column 4 or beyond Names of sets must be unique The MARKER lines must come in pairs of an SOSORG and SOSEND surrounding the columns that are in the SOS Optionally in Field 1 ofa MARKER SOSORG line either S1 or S2 may be specified to indicate the type of the SOS An FILE FORMATS SUPPORTED BY CPLEX 39 40 BLE SOS MARKER line without an S1 or S2 indicator is assumed to denote an S1 set Members of an SOS may or may not be integer or binary variables There is no requirement that there be a constraint that all members of an SOS sum to 1 0 nor is any such constraint implicit However providing such a constraint in your formulation may be desirable as it may strengthen the LP relaxation of the mixed integer problem as for example in the case of an S1 set consisting of binary variables In the following example the excerpt from the COLUMNS section of an MPS file defines an SOS Type 1 set consisting of x5 and x6 which may be continuous or integer variables S1 NAME1 MARKER
8. an MPS file if your problem already exists in an algebraic format or if you have an application which generates the problem file more readily in algebraic format such as a C application Working with LP files in the CPLEX User s Manual in the chapter about managing input and output explains the implications of using LP format rather than MPS format CPLEX accepts any problem saved in an ASCII file provided that it adheres to the following syntax rules Comments Anything that follows a backslash is a comment and is ignored until a return is encountered Blank lines are also ignored Blank lines and comment lines may be placed anywhere and as frequently as you want in the file White space and line length In general white space between characters is irrelevant as it is skipped when a file is read However white space is not allowed in the keywords used to introduce a new section such as MAX MIN ST or BOUNDS Also the keywords must be separated by white space from the rest of the file and must be at the beginning of a line The maximum length for any name is 255 The maximum length of any line of input is 560 Skipping spaces may cause CPLEX to misinterpret and accept an invalid entry such as the following xl x2 0 If the user intended to enter that example as a nonlinear constraint CPLEX would instead interpret it as a constraint specifying that one variable named x1x2 must be equal to zero To indicate a quadra
9. characters in a name within a NET file End of a NET file The network specification of a NET file must end with the keyword ENDNETWORK Anything following the keyword ENDNETWORK will be ignored This keyword is referred to as the end of a NET file Sections of a NET file Between its start and end a NET file is divided into sections Each section is introduced by its keyword and continues until the next section begins or the NET file ends The keywords introducing sections are SUPPLY DEMAND ARCS BOUNDS and OBJECTIVE Each section keyword may appear more than once in a NET file They need not be in any order FILE FORMATS SUPPORTED BY CPLEX 49 50 ERE The SUPPLY section In this section supply values for nodes are specified Each supply value is specified with the following sequence node name value where node name specifies the name of the node for which to set a supply value and value is the value that will be assigned to node node name as its supply value If a node with this name does not already exist a new node will be created with this name If the node has been previously assigned a supply value the new value overrides the previous value and a warning will be issued The DEMAND section This section corresponds to the SUPPLY section except that it specifies demand values instead of supply values That is instead of specifying a supply value s in the SUPPLY section you can specify the negative of
10. enter it among any other constraints in the model like this constraintname binaryvariable value gt linear constraint The constraint name followed by a colon is optional The hyphen followed by the greater than symbol gt separates the indicator variable and its value from the linear constraint that is controlled The indicator variable must be declared as a binary variable and the value it is compared to must be either 0 zero or 1 one Quadratic terms This rule applies to applications licensed to solve problems with quadratic terms in them that is quadratic programming problems and quadratically constrained programs QPs and QCPs Quadratic coefficients may appear in the objective function Quadratic coefficients may also appear in constraints under certain conditions If there are quadratically constrained variables in the problem see also rules about Variables Constraints and Solving problems with quadratic constraints QCP in the CPLEX User s Manual The algebraic coefficients of the function x Qx are specified inside square brackets The square brackets must be followed by a divide sign followed by the number 2 This convention denotes that all coefficients inside the square brackets will be divided by 2 in evaluating the quadratic terms of the objective function All quadratic coefficients must appear inside square brackets Multiple square bracket sections may be specified Inside of the square bracke
11. flexibility Most fixed format ORD files conform to the new format Any files that do not conform can be converted to the new format using the convert utility that comes with the standard CPLEX distribution Converting file formats explains how to use that utility FILE FORMATS SUPPORTED BY CPLEX 57 SOL file format solution files 58 E E E CPLEX enables you to read and write solution files formatted in XML for all problem types for all application programming interfaces APIs These solution files known as SOL files carry the file extension sol The XML solution file format makes it possible for you to display and view these solution files in most browsers as well as to pass the solution to XML aware applications CPLEX also provides a stylesheet and schema in yourCplexinstallation include ilcplex to facilitate your use of this format in your applications solution xsl stylesheet solution xsd schema Note Browsers may have specific conventions regarding accessing remote style sheets and XML files with extensions other than xml For example your browser may not read the header of an SOL file with the extension sol or may not consult the stylesheet designated there consequently your browser may display such a file as raw XML code rather than the formatted display you expect In such a situation try copying your SOL file to a file with the extension xml that your browser recognizes and processes correctly
12. name for designating special characters for indicating separators and so forth lloCsvLine An object of this class represents a line of a CSV file The constructors and methods of this class enable you to designate special characters such as a decimal point separator line ending and so forth lloCsvReader Iterator An object of this embedded class is an iterator capable of accessing data in a CSV file line by line This iterator is useful for example in programming loops of your application such as while statements FILE FORMATS SUPPORTED BY CPLEX 67 XML file format serialized models and solutions Concert Technology for C users offers a suite of classes for serializing CPLEX models that is instances of Il1oModel and solutions that is instances of IloSolution through XML The CPLEX C API Reference Manual documents the XML serialization API in the group optim concert xml That group includes these classes Iloxmlcontext allows you to serialize an instance of IloModel or IloSolution This class offers methods for reading and writing a model a solution or both a model and a solution together There are examples of how to use this class in the reference manual IloXmlInfo offers methods that enable you to validate the XML serialization of elements such as numeric arrays integer arrays variables and other extractables from your model or solution IloXmlReader creates a reader in an environment
13. setting in the file is applied When you write a parameter file from the Callable Library only the nondefault values are written to the file String values may be double quoted or not but are always written with double quotation marks Tip The first line of a PRM file is significant to CPLEX An easy way to produce a correctly formatted PRM file is to have CPLEX write it for you The comment character in a parameter file is CPLEX ignores the rest of the line The Callable Library issues a warning if the version recorded in the parameter file does not match the version of the product A warning is also issued of a non integral value is given for an integer valued parameter Here is an example of such a file CPLEX Parameter File Version 11 0 0 CPX PARAM EPPER 3 45000000000000e 06 CPX PARAM OBJULIM 1 23456789012345e 05 CPX PARAM PERIND 1 CPX PARAM SCRIND 1 CPX PARAM WORKDIR tmp FILE FORMATS SUPPORTED BY CPLEX 53 BAS file format advanced basis 54 ELLE An MPS basis file known as a BAS file contains the information needed by CPLEX to define an advanced basis Like an MPS file the BAS file begins with a NAME indicator record and ends with an ENDATA record Tip A BAS file is a text based format that relies on each variable and each constraint having a name If names do not exist they will be created automatically as needed during a write operation If you anticipate reading and writing BAS files it
14. specific to CPLEX Rather this file extension indicates that a file possibly in one of the formats that CPLEX reads has been compressed by BZIP2 On most platforms CPLEX can automatically uncompress such a file and then read data from the file in one of the formats briefly described here CLP is the format CPLEX uses to represent the conflicting constraints and bounds a subset of an infeasible model that were found by the conflict refiner CSV files contain comma separated values Concert Technology offers facilities in CPLEX for reading and writing such files See the CPLEX C API Reference Manual for details especially the classes IloCsvReader IloCsvLine and IloCsvReader Iterator DPE is the format CPLEX uses to write a problem in a binary SAV file after the objective function of the problem has been perturbed DUA format governed by MPS conventions writes the dual formulation of a problem currently in memory so that the MPS file can later be read back in and the dual formulation can then be optimized explicitly This file format is largely obsolete now since you can use the command set presolve dual in the Interactive Optimizer to tell CPLEX to solve the dual formulation of an LP automatically You no longer have to tell CPLEX to write the dual formulation to a DUA file and then tell CPLEX to read the file back in and solve it EMB is the format CPLEX uses to save an embedded network it
15. the quality of the solution For example the maximum primal infeasibility the values of the tolerance parameters in effect during the optimization and other quality information appears in this part There are of course methods and routines for reading and writing SOL files In Concert Technology use these methods FORMATS SUPPORTED BY CPLEX In the C API see the methods IloCplex readSolution and TloCplex writeSolution In the Java API see the methods IloCplex readSolution and IloCplex writeSolution Inthe NEI API see the methods Cplex ReadSolution and Cplex WriteSolution Inthe Callable Library use the routine CPXreadcopysol to read a SOL file and the routine CPXsolwrite to write SOL files Here is an example of a SOL file lt xml version 1 0 standalone yes gt lt xml stylesheet href https www ilog com products cplex xmlv1 0 solution xsl type text xs1 gt lt CPLEXSolution version 1 1 gt lt header problemName examples data mexample mps solutionName incumbent solutionIndex 1 objectiveValue 122 5 solutionTypeValue 3 solutionTypeString primal solutionStatusValue 101 solutionStatusString integer optimal solution MIPNodes 0 MIPIterations 3 gt lt quality epInt le 05 epRHS le 06 maxIntInfeas 0 maxPrimalInfeas 0 maxxX 40 maxSlack 2 gt lt linearConstraints gt lt constraint name cl1 index 0 slack 0 gt lt co
16. 16 FILE FORMATS SUPPORTED BY CPLEX Reading and entering file formats in the Interactive Optimizer The Interactive Optimizer accepts problems that you read in from files by means of the read command or that you enter interactively by means of the enter command When you enter a problem interactively CPLEX uses the LP file format you may save the problem in any supported file format that you choose The read command of the Interactive Optimizer accepts problem files in LP MPS and SAV formats It also accepts basis files in BAS format Problems previously saved in DUA EMB or REW formats are actually in MPS format Presolved problems saved with the pre option are in SAV format Problems in which the objective function has been perturbed and the problem saved with the dpe option are in SAV format Problems in which the righthand side has been perturbed and the problem saved with the ppe option are in SAV format Normally CPLEX automatically detects which of these file types it is reading you may also designate the correct file type if CPLEX does not detect the type automatically When CPLEX reads LP or MPS files it automatically allocates enough physical memory if available to read the problem CPLEX reallocates memory automatically as it is reading from LP and MPS files so it usually not necessary to set values for the parameters ColReadLim RowReadLim and NzReadLim but you can set these parameters to the problem sizes so no re
17. 3 n6 gt n5 ER E n6 OBJECTIVE a a2 a3 a4 a5 a6 S a8 ag alo all SL al3 al4 BOUNDS o GA E UO Ob BAIA OW SB GA Ww FILE FORMATS SUPPORTED BY CPLEX 51 18 lt al lt 24 0 lt a2 lt 25 a3 12 0 lt a4 lt 10 0 lt a5 lt 9 a6 free lt a7 lt 20 lt a8 lt 10 lt a9 lt B lt al0 lt 15 lt all lt 10 lt al2 lt 11 0 lt al3 lt 6 ENDNETWORK EE EE E 52 FILE FORMATS SUPPORTED BY CPLEX PRM file format parameter settings It is possible to read and write a file of parameter settings with the Callable Library This kind of file is known as a PRM file The file extension for a PRM file is prm The Callable Library routine CPXreadcopyparam reads parameter values from a file with the prm extension The routine CPxXwriteparam writes a file of the current nondefault parameter settings to a file with the prm extension Here is the format of such a file CPLEX Parameter File Version number parameter name parameter value CPLEX reads the entire file before changing any of the parameter settings After successfully reading a parameter file the Callable Library first sets all parameters to their default value Then it applies the settings it read from the parameter file No changes are made if the parameter file contains errors such as missing or illegal values There is no checking for duplicate entries in the file In the case of duplicate entries the last
18. 9 Quadratic objective information in MPS les 41 Quadratically constrained programs QCP in MBS fles eee eee eee eee 43 Indicator constraints in MPS ies 44 User defined cuts in MPS es 46 Lazy constraints in MPS 5 1 ege ecient ai n einen ed Ee aiia 47 Copyright IBM Corp 1987 2009 5 NET file format network flow models s sss sss ss sss sss ss sss sss ses es nenen eena nenen nene 48 PRM file format parameter settings sss ssssssese veces ess ss sss esec essen eenn ennenen ennenen enen 53 BAS file format advanced basis sss sss sss sss senses seene ennenen nenen annee 54 MST file format MIP starts cc sss sss sss sss sese enesenn nenen ennenen ennenen nen 56 ORD file format priorities and branching orders sss sssssssssssssee essere esse ennenen eenn 57 SOL file format solution iles css ss sss ss sese essen seene neeaae nenen annan 58 FLT file format filter files for the solution pools ssssssesseee veces sssssse serre ee essere neee 61 OVES W OF 9 ee 62 Reading and writing filter iles cssseresvesssresssee svec eseresvereeverrerer ener ennenen nenen ennenen 63 SVMNtAX OF er TMS EE 64 Diversity Titers viz scene ies eet aad eee Sas Ae ae a Sa ee a a 65 Re e cvs ints eave eats ad ate deeds ape it eae ne eared 66 CSV file format comma Separated values sssseeesseeesseessseessve esse esse eers eres enn ennenen 67 XML file format serialized models ANd SOLUTIONS ccccccecessececnssecenssecesseeeenaseeeaeesseeaeee
19. CPLEX can also read SOL files as an advanced start SOL files contain basis statuses if they are available and solution values The basis statuses can be used for advanced starts with simplex optimizers the solution values can be used for a crossover from a barrier solution or as a MIP start from a mixed integer solution A mixed integer solution may be from a conventional MIP optimization or from a member of the solution pool SOL files contain XML formatted information as do MST files Unlike MST files at the default write level of detail SOL files contain solution values for all variables rather than only the variables that define the integer feasible solution SOL files are thus larger take longer to input and in unusual cases of numerically difficult models are less likely to provide a feasible starting point Consequently CPLEX generally recommends using MST files to restart the optimization instead of SOL files However if you already use SOL files for other purposes you can also use them to provide a feasible starting point SOL files also carry an optional name attribute useful when the problem has names SOL files also include an index corresponding to the constraint index or variable index of the problem The SOL header gives information about the status of the solution For example the optimization status appears as a string and the numeric value of the CPLEX symbolic constant The SOL quality gives information about
20. Lad Ke ld wy a a a m mg mm z Rm wm mm ee eee EE ee r mmm 7 IBM ILOG CPLEX V12 1 File formats supported by CPLEX Copyright International Business Machines Corporation 1987 2009 US Government Users Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp Legal terms Copyright notice Copyright International Business Machines Corporation 1987 2009 US Government Users Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp Trademarks IBM the IBM logo ibm com WebSphere ILOG the ILOG design and CPLEX are trademarks or registered trademarks of International Business Machines Corp registered in many jurisdictions worldwide Other product and service names might be trademarks of IBM or other companies A current list of IBM trademarks is available on the Web at Copyright and trademark information at http Awww ibm com legal copytrade shtml Adobe the Adobe logo PostScript and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and or other countries Linux is a registered trademark of Linus Torvalds in the United States other countries or both Microsoft Windows Windows NT and the Windows logo are trademarks of Microsoft Corporation in the United States other countries or both Java and all Java based trademarks and
21. ORK ENDNETWORK SUPPLY DEMAND ARCS BOUNDS OBJECTIVE z gt gt gt gt gt gt gt INFINITY FREE Keywords are independent of character case Keywords must be separated by white space from other symbols in the file White space White space consists of one or more of the following the space character the tab character t the new line character n 48 FILE FORMATS SUPPORTED BY CPLEX acomment that is all characters following a backslash to the end of a line Abbreviations of keywords Also the NET format recognizes the abbreviations summarized in Abbreviations of Keywords in NET File Format Abbreviations of Keywords in NET File Format Keyword Abbreviation Start of a NET file A NET file must start with one of the following keywords MAXIMIZE NETWORK MINIMIZE NETWORK Both may be followed optionally by the name of a problem If no name is specified the filename will be used instead This part of a NET file is referred to as the start of a NET file Names in a NET file Names must follow the same conventions as they do for CPLEX LP format files They must consist of a sequence of alphanumeric characters a z A Z or 0 9 or one of the symbols amp _ However the first character may not be a digit or period No names corresponding to the keywords are allowed There is no restriction on the number of
22. US SEMI or SEMIS The following line or lines should list the names of all the variables which are to be declared semi continuous separated by at least one space Semi continuous ST x3 MIP special ordered sets This rule applies to the CPLEX MIP optimizer To specify special ordered sets use an SOS section which is preceded by the SOS keyword The SOS section should follow the Bounds General Binaries and Semi Continuous sections Special ordered sets of type 1 require that of the variables in the set one at most may be nonzero Special ordered sets of type 2 require that at most two variables in the set may be nonzero and if there are two FORMATS SUPPORTED BY CPLEX nonzeros they must be adjacent Adjacency is defined by the weights which must be unique within a set given to the variables The sorted weights define the order of the special ordered set For MIP branch and cut the order is used to decide how the variables are branched upon See the CPLEX User s Manual for more information The set is specified by an optional set name followed by a colon and then either of the S1 or S2 keywords specifying the type followed by a double colon The set member names are listed on this line or lines with their weights Variable names and weights are separated by a colon for example SOS setl Sl x1 10 x2 13 MIP indicator constraints This rule applies to CPLEX MIP optimizer To specify an indicator constraint
23. X extensions of MPS file format to support indicator constraints FILE FORMATS SUPPORTED BY CPLEX 33 User defined cuts in MPS files Describes CPLEX extensions of MPS file format to support user defined cuts Lazy constraints in MPS files Describes CPLEX extensions of MPS file format to support lazy constraints 34 FILE FORMATS SUPPORTED BY CPLEX Overview of MPS extension Historically MPS format including CPLEX MPS format for CPLEX version 2 1 and earlier releases included restrictions such as requiring input fields to occupy fixed columnar positions and limiting all names to a length of 8 characters or fewer In CPLEX version 3 0 and subsequent releases these restrictions were relaxed The current CPLEX MPS format is actually an extended version of the historical MPS format To allow for these extensions certain practices which were accepted in MPS files for older CPLEX releases and other systems are no longer permitted For example since CPLEX no longer requires fixed columnar positions blank spaces are interpreted as delimiters Older MPS files containing names with embedded spaces therefore become unreadable To maintain compatibility with earlier versions as well as MPS files from other systems CPLEX provides an MPS file conversion utility which translates older files into the newer CPLEX MPS format The section Converting file formats in the CPLEX User s Manual explains how to use the file conversion uti
24. Y CPLEX side coefficient must be typed on the same line as the sense indicator Acceptable sense indicators are lt lt lt gt gt gt and These are interpreted as lt lt lt and respectively For example here is a named constraint time xl x2 lt 10 Quadratic constraints are allowed in this section Quadratic terms are specified inside square brackets as detailed in the rule about Quadratic terms The specification of a quadratic constraint differs from the specification of a quadratic objective in one important way ina quadratic constraint the terms are not divided by two that is they are not multiplied by 1 2 as they must be in a quadratic objective Indicator constraints are also allowed in this section The rule about MIP indicator constraints explains how to specify indicator constraints Bounds The optional bounds section follows the mandatory constraint section It is preceded by the word bounds or bound in any mix of lower and upper case characters Each bound definition must begin on a new line The format for a bound isl xas Un except in the following cases Upper and lower bounds may also be entered separately as ln Xu Xn S Un with the default lower bound of 0 zero and the default upper bound of remaining in effect until the bound is explicitly changed Bounds that fix a variable can be entered as simple equalities For example x5 5 6 is equivalent to5 6
25. adratic objective information in MPS format in a QUADOBJ section of the following form you do not have to convert your file in order for CPLEX to make use of it varnamel varname2 value CPLEX can read that file and interpret the QUADOBJ section correctly However the MPS file writers of CPLEX do not produce a QUADOBJ section themselves Instead they produce a QMATRIX section as explained here 42 FILE FORMATS SUPPORTED BY CPLEX Quadratically constrained programs QCP in MPS files As explained in the CPLEX User s Manual in Solving problems with quadratic constraints QCP CPLEX can solve problems with quadratic terms among the constraints if the Q matrix for the quadratic term is positive semi definite and the quadratic function defines a convex region CPLEX has extended the MPS format to accommodate QCP models The quadratic constraints of such a model are listed in the Rows section and their linear coefficients appear in the COLUMNS section just the same as coefficients from the linear constraints The quadratic terms go in QCMATRIX sections one QCMATRIX per quadratic constraint QCMATRIX sections appear after the optional sos section They may appear either after or before the QMATRIX objective section The name of the constraint appears on the same line after QCMATRIX The quadratic terms of the quadratic expression must be given as a symmetric matrix That is if there is an entry for Ou then there must b
26. allocations need be done When CPLEX reads a SAV file it is not necessary for you to reset these parameters SAV files contain sufficient information about the size of the problem for CPLEX to allocate adequate space For more information on the read limit parameters see variable column read limit constraint row read limit and nonzero element read limit in the CPLEX Parameters Reference Manual FILE FORMATS SUPPORTED BY CPLEX 17 Saving problems in the Interactive Optimizer 18 E E E In the Interactive Optimizer you save information about the problem currently in memory as a file in the LP MPS or SAV formats by means of the write command and its options For a complete list of file formats that CPLEX supports see Brief descriptions of file formats Here are the options in the Interactive Optimizer for frequently used formats Use the bas option to save a problem basis in MPS format Use the clp option to write a conflict subproblem Use the flt option to write filters for the solution pool Use the mst option to write MIP start files This option also applies to solutions in the solution pool In fact an additional option specifies whether to write a single solution specified by its index or to write all solutions from the solution pool as MIP starts Use the pre option to write a SAV file for the reduced presolved problem formulation Use the prm option to write a file of nondefault parameter setting
27. cify general integers with no upper bounds use LI with the value 0 0 Integer lower bound Field 4 is the lower bound value and must be an integer For example column x4 is an integer variable declared in the BOUNDS section of an MPS file according to this second way of treating integer variables NAME ROWS N obj iy er IC Eco COLUMNS x1 obj Sab foul i x1 CA il X2 OBJ E foul 1 x c2 gt 3 eo d X3 obj gt 53 eil iL X3 cA il x4 obj Sil ul iLO x4 eo gt 35 RHS rhs ei 20 c2 30 BOUNDS UP BOUND x1 40 LI BOUND x4 2 UI BOUND x4 3 ENDATA 38 FILE FORMATS SUPPORTED BY CPLEX Special ordered sets SOS in MPS files If you use the CPLEX mixed integer optimizer that is the MIP optimizer then you may define special ordered sets SOS in MPS format The convention for SOS uses set declaration lines and member declaration lines both of which begin in column 2 or beyond In a set declaration line columns 2 and 3 specify S1 or S2 Optionally the name of a set is specified in column 4 In a member declaration line column 5 or beyond specifies a variable name Note that in an MPS file the SOS section must follow the BOUNDS section If weighting information is provided it follows the member name in a member declaration line In the following example an SOS section is placed after the BOUNDS section NAME ROWS N obj dr SO E I O3 COLUMNS x1 obj all cl Sil x1 G2 N x2 obj 9 eili 1 X2 ice Ee oe d KO obj gt 35 SH il
28. cords may be required to completely specify a given column Field 1 Blank FORMATS SUPPORTED BY CPLEX Field 2 Column identifier Field 3 Row identifier Field 4 Value of matrix coefficient specified by Fields 2 and 3 Field 5 Row identifier optional Field 6 Value of matrix coefficient specified by Fields 2 and 5 optional After a matrix element is specified for a column all other nonzero elements in that same column should be specified The COLUMNS section of our example looks like this COLUMNS x1 obj A alk alk x1 G2 i x2 obj z2 call 1 X2 C2 AS x3 obj Gal i x ee il The RHS section In the RHS section the nonzero righthand side values of the constraints are specified Field 1 Blank Field 2 RHS identifier Field 3 Row identifier Field 4 Value of RHS coefficient specified by Field 2 and 3 Field 5 Row identifier optional Field 6 Value of RHS coefficient specified by Field 2 and 5 optional Several RHS vectors can exist The name of each RHS vector appears in Field 2 However only the first RHS vector is selected when a problem is read Additional RHS vectors are discarded The RHS section of our example looks like this RHS rhs eal 20 eZ 30 The RANGES section In the RANGES section RHS range values to be applied to constraints may be specified Field 1 Blank Field 2 Righthand side range vector identifier Field 3 Row identifier Field 4 Value of the range applied to row specified by
29. e 65 entering problems in 17 DPE file format 13 saving problems 18 DUA file format 13 saving problems in 18 EMB file format 13 lazy constraint enter Interactive Optimizer command LP 24 file formats and 17 MPS 47 LP file format 14 19 24 file f rmat indicator constraints in 23 RLP 15 syntax rules 19 file formats BAS 13 memory BZ2 13 allocating when reading files 17 CSV 13 MIN file format 14 DPE 13 MIP start values DUA 13 file format for entering 56 EMB 13 MPS file format 14 25 47 Copyright IBM Corp 1987 2009 69 70 advanced basis in 54 BAS file format 13 54 BOUNDS section 30 COLUMNS section 28 CPLEX extensions 35 data records 27 DUA format 13 example 32 indicator records 27 integer variables in 37 objective function name 36 objective function sense 36 proprietary information in 15 QUADOBJ section in 41 quadratic coefficients in 41 quadratically constrained program QCP and 43 RANGES section 29 REFROW section 40 REW format 15 RHS section 29 ROWS section 28 saving basis 13 saving dual formulation 13 saving embedded network 13 sense of rows 28 SOS in 39 MST file format 14 56 MST format advanced indicator parameter and 56 NET file format 14 48 network optimizer file format for saving extracted network 13 objective function in MPS file format 36 quadratic coefficient in 23 ORD file format 14 57 parameter file format for 15 perturbed problem file format 13 15 pool lazy constraints 24 use
30. e an identical entry for Ou when i is not equal to j This requirement is the same as for the QMATRIX section where any quadratic terms in the objective function are declared The formats of the Q parts are the same FILE FORMATS SUPPORTED BY CPLEX _ 43 Indicator constraints in MPS files 44 ELE Indicator constraints provide a way for you to express relations among variables by identifying a binary 0 1 variable to control whether or not a given constraint is active CPLEX has extended the MPS format to express indicator constraints The constraints to be controlled by the binary variable are listed in the ROWS section their linear coefficients appear in the COLUMNS section that is the same as coefficients from linear constraints Only rows of types E L and G may be part of indicator constraints In other words a row of type N cannot appear as a constraint controlled by a binary variable in this sense that is an indicator constraint The binary variables that control the linear constraints are specified in the BOUNDS section or with MARKER lines that is like any other binary variable The relationship between the binary variables and the constraints they control is specified in the INDICATORS section The INDICATORS section follows any quadratic constraint section and any quadratic objective section Each line of the INDICATORS section has a type field starting in column 2 or beyond the type must be IF followed by the na
31. e of the model follows the keyword NAME In a formatted filter file the strings inf and inf may be used to denote no limit in each of these contexts the lower bound of a diversity or range filter the upper bound of a diversity or range filter Here is a sample filter file This filter is suitable for use with the model in Example simple facility location problem in the CPLEX User s Manual An explanation of this file appears in Diversity filters and Range filters NAME location PIVE DIER Ged 2 tere pret aL 6 2 pe AL 0 eal el IEG 0 x4 1 0 0 RNGFILTER 2 inf 0 hraneport E fixed 1 0 ENDATA 64 FILE FORMATS SUPPORTED BY CPLEX Diversity filters A diversity filter allows you to control which solutions are generated and stored in the solution pool according to their divergence from a reference solution Only binary variables can be used to define a diversity filter The format of a diversity filter file lets you specify the names of the binary variables of interest the weights to be assigned to those variables and the reference values of those variables with which to compare all solutions It also allows you to specify a lower bound and an upper bound on the divergence from the reference value s The filter enforces the following constraint for a variable x lower bound lt diff x lt upper bound This information is used to compute the diversity measure The diversity measure is comput
32. ed by summing the weighted absolute differences from the reference values like this diff x sum weights i x varind i refval i The keyword DIVFILTER designates the beginning of a diversity filter in the file The name of the filter follows the keyword DIVFILTER on the same line For example in the sample in Syntax of a filter file the name of the filter is 1 and follows the keyword DIVFILTER The lower and upper bounds on the diversity function follow the name of the filter on the same line as the keyword DIVFILTER In this example the lower bound on diversity is 2 and the upper bound is infinity that is there is no limit Each successive line shows the name of a variable followed by the weight and the reference value for that variable In the example equal weight 1 0 is given to the diversity of the four specified variables The reference values are 1 one for x1 and x2 0 zero for x3 and x4 FILE FORMATS SUPPORTED BY CPLEX 65 Range filters A range filter adds a constraint over a linear expression like this lower bound lt linear expression lt upper bound where the linear expression is a sum of weights multiplied by the value of a variable That is sum weights i x varind i Range filters can be defined by any type of variables binary integer continuous semi integer semi continuous In the sample filter file the range filter corresponds to this constraint that the transp
33. elds 2 and 3 Acceptable values appear in Status indicators for variables in a BAS file Field 2 Variable 1 identifier Field 3 Variable 2 identifier ignored if Field 1 is UL LL or BS Variable 1 specifies a structural variable identifier which has entered the basis By convention this structural variable must displace one of the row variables Variable 2 is a row variable FORMATS SUPPORTED BY CPLEX that has left the basis No relationship between structural variables entering the basis and row variables leaving the basis is implied within the BAS file In the Example of MPS file format variables x2 and x3 are basic and the two constraints row variables are nonbasic Also x1 was forced to its upper limit of 40 The optimal basis for that example appears in the following sample CPLEX adds the number of iterations to the NAME record The iteration count is useful if the basis file was automatically generated during a previously aborted run The XL indicator in the first two data records indicates that x3 and x2 are basic and that the row variables for c1 and c2 are nonbasic at their lower bound The third record shows that structural variable x1 is nonbasic and at its upper bound NAME example2 bas Iterations 3 Rows 2 Cols 3 XL x3 cul XL x2 C2 UL RL ENDATA FILE FORMATS SUPPORTED BY CPLEX 55 MST file format MIP starts If you use the CPLEX MIP optimizer the MST file format is available to specify MIP start val
34. es of all variables which are to be restricted to general integer values separated by at least one space The BINARY section is preceded by the word BINARY BINARIES or BIN in any mix of upper and lower case characters which must appear alone on a line The following line or lines should list the names of all variables which are to be restricted to binary integer values separated by at least one space Binary variables are automatically given bounds of 0 zero and 1 one unless alternative bounds are specified in the BOUNDS section in which case a warning message is issued Here is an example of a problem formulation in LP format where x4 is a general integer Maximize loge sell Ge e ah Se Gp ol Subject To Ale So oil Ge eB Ge ses ae lO skh lt A CBS xxi co 3 eck seo KS SIO CORE K2 a OLE Bounds 0 lt x1 lt 40 2 lt x4 lt 3 General x4 End If branching priorities or branching directions exist enter this information through ORD files as documented in ORD file format priorities and branching orders MIP semi continuous variables This rule applies to the CPLEX MIP optimizer To specify any of the variables as semi continuous variables that is as variables that may take the value 0 or values between the specified lower and upper bounds use a SEMI CONTINUOUS section This section must follow the BOUNDS GENERALS and BINARIES sections The SEMI CONTINUOUS section is preceded by the keyword SEMI CONTINUO
35. extracts from a problem EMB files are written in MPS format FILE FORMATS SUPPORTED BY CPLEX 13 14 ELE FLT is the format CPLEX uses to save filters for solution pools GZ is not a file format specific to CPLEX Rather this file extension indicates that a file possibly in one of the formats that CPLEX reads has been compressed by gzip the GNU zip program On most platforms CPLEX can automatically uncompress a gzipped file and then read data from a file in one of the formats briefly described here LP Linear Programming is a CPLEX specific file formatted for entering problems in an algebraic row oriented form In other words LP format allows you to enter problems in terms of their constraints When you enter problems interactively in the Interactive Optimizer you are implicitly using LP format CPLEX also reads files in LP format The section LP file format matrix models describes the conventions and use of this format MIN format for representing minimum cost network flow problems was introduced by DIMACS in 1991 More information about DIMACS network file formats is available via anonymous ftp from ftp dimacs rutgers edu pub netflow general info specs tex MPS is an industry standard ASCII text file format for mathematical programming problems This file format is documented in MPS file format industry standard Besides the industry conventions CPLEX also supports extensions to this
36. for the LP file format MPS file format industry standard Describes the industry standard MPS file format and CPLEX extensions to it Special records in MPS files CPLEX extensions CPLEX extends the MPS standard in several ways NET file format network flow models Describes NET file format PRM file format parameter settings Describes PRM file format for nondefault parameter settings Copyright IBM Corp 1987 2009 11 12 E E E BAS file format advanced basis Describes BAS file format to support advanced basis MST file format MIP starts Describes the MST file format for MIP starts ORD file format priorities and branching orders Describes ORD file format to support priorities and branching orders SOL file format solution files Describes SOL file format to support solution files FLT file format filter files for the solution pool Describes FLT file format to support filters of the solution pool CSV file format comma separated values Describes CSV file format for comma separated values XML file format serialized models and solutions Describes XML file format to support serialized models and solutions FORMATS SUPPORTED BY CPLEX Brief descriptions of file formats BAS files are text files governed by Mathematical Programming System MPS conventions that is they are not binary for saving a problem basis They are documented in BAS file format advanced basis BZ2 is not a file format
37. format for CPLEX specific cases such as names of more than eight characters blank space as delimiters between columns etc The extensions are documented in Special records in MPS files CPLEX extensions MST is an XML format available with the CPLEX MIP optimizer It is a text format CPLEX uses to enter a starting solution for a MIP MST file format MIP starts documents this file format NET is a CPLEX specific ASCII format for network flow problems It supports named nodes and arcs NET file format network flow models offers a fuller description of this file format ORD is a format available with the CPLEX MIP optimizer It is used to enter and to save priority orders for branching It may contain branching instructions for individual variables ORD file format priorities and branching orders documents this file format FORMATS SUPPORTED BY CPLEX PPE is the format CPLEX uses to write a problem in a binary SAV file after the righthand side has been perturbed PRE is the format CPLEX uses to write a presolved reduced problem formulation to a binary SAV file Since a presolved problem has been reduced it does not correspond to the original problem PRM is the format CPLEX uses to read and write nondefault values of parameters in a file PRM file format parameter settings documents the format and conventions for reading and writing such files through the Callable Library REW
38. ibes indicator records and data records in MPS file format Example of MPS file format Shows formatted sample MPS file FILE FORMATS SUPPORTED BY CPLEX 25 Overview of MPS MPS format long established on mainframe LP systems has become a widely accepted standard for defining LP problems In contrast to the CPLEX LP format MPS format is a column oriented format problems are specified by column variable rather than by row constraint 26 FILE FORMATS SUPPORTED BY CPLEX Records in MPS format MPS data files are analogous to a deck of computer input cards each line of the MPS file represents a single card record Records in an MPS data file consist of two types indicator records and data records The records contain fields delimited by blank spaces Indicator records Indicator records separate the individual sections of the MPS file Each indicator record contains a single word that begins in the first column There are seven kinds of indicator records each corresponding to sections of the MPS file They are listed in Indicator records Indicator records Section name indicator Purpose record NAME specifies the problem name unlike other indicator records the name record contains data ROWS specifies name and sense for each constraint COLUMNS specifies the name assigned to each variable column and the nonzero constraint coefficients corresponding to that variable RHS specifies the names of righthand side vec
39. is a format to write a problem in MPS format with disguised row and column names This format is simply an MPS file format with all variable column and constraint row names converted to generic names Variables are relabeled x1 through xn and rows are renamed c1 through cm This format may be useful for example for problems that you consider highly proprietary RLP is the LP format using generic names in the Interactive Optimizer SAV is a CPLEX specific binary format for reading and writing problems and their associated basis information CPLEX includes the basis in a SAV file only if the problem currently in memory has been optimized and a basis exists This format offers the advantage of being numerically accurate to the same degree as your platform in contrast to text file formats that may lose numerical accuracy It also has the additional benefit of being efficient with respect to read and write time However since a SAV file is binary you cannot read nor edit it with your favorite text editor SOL files are XML formatted files that contain solution information they may also provide an advanced start for an optimization FILE FORMATS SUPPORTED BY CPLEX 15 XML as a file format is available to C users of Concert Technology to serialize models and solutions that is instances of TloModel and IloSolution XML file format serialized models and solutions explains more about this serialization API
40. is a good idea to assign aname to each variable column and to each constraint row yourself when you create the model A basis defines a list of basic structural variables and row variables A structural variable is one of the variables columns defined in the MPS problem file A row variable is actually the slack surplus or artificial variable associated with a row For linear programs the total number of basic variables both structural and row is equal to the number of rows in the constraint matrix Additionally the number of basic structural variables is equal to the number of nonbasic row variables By convention an MPS basis file is built on the assumption that all row variables are basic and that all structural variables are nonbasic with values at their lower bound The data records in a BAS file list structural and row variables that violate this assumption This convention minimizes the size of the BAS file For quadratic programs the total number of basic variables can exceed the number of rows and so not all basic variables can be paired with a nonbasic row variable Status indicators for variables in a BAS file Variable 1 is basic variable 2 is nonbasic at its upper bound Variable 1 is basic variable 2 is nonbasic at its lower bound Variable 1 is nonbasic and is at its upper bound Variable 1 is nonbasic and is at its lower bound Variable 1 is basic Field 1 Indicator specifying status of the named variables in Fi
41. ld 3 MARKER including the single quotation marks Field 4 Keyword INTORG and INTEND to mark beginning and end respectively including the single quotation marks Fields 5 and 6 are ignored The marker name must differ from the preceding and succeeding column names If no bounds are specified for the variables within markers bounds of 0 zero and 1 one are assumed In the following example column x4 is an integer variable and looks like this in the COLUMNS section of an MPS file according to this first way of treating integer variables NAME ROWS N obj ity ek iy e IR e COLUMNS x1 obj S cht Salk C2 x2 obj z2 G 1 ee E2 3 Gs E SS obj aS il xB C2 MARKO000 MARKER INTORG x4 obj G 10 x4 Si SESS MARK0001 MARKER INTEND RHS rhs cl 20 ee 30 BOUNDS UP BOUND x1 40 LO BOUND x4 2 UP BOUND x4 3 ENDATA FILE FORMATS SUPPORTED B Y CPLEX 37 In the second way of treating integer variables integer variables are declared in the BOUNDS section with special bound types in Field 1 The acceptable special bound types appear in Special bound types for handling integer variables in MPS files Special bound types for handling integer variables in MPS files BV Binary variable Field 4 must be 1 0 or blank sc Semi continuous variable Field 4 is the upper bound and must be specified UI Integer upper bound Field 4 is the upper bound value and must be an integer To spe
42. lity FILE FORMATS SUPPORTED BY CPLEX 35 Objective sense and name in MPS files CPLEX extends the MPS standard by allowing two additional sections OBJSEN and OBJNAME They may be specified after the NAME section OBJSEN sets the objective function sense and OBJNAME selects an objective function from among the free rows within the file If neither of these sections appears in the MPS file CPLEX assumes that the problem is a minimization and that the objective function is the first free row encountered in the Rows section If these options are used they must appear in order and as the first and second sections after the NAME section The values for OBJSENSE can be MAX or MIN Here is an example of these optional sections NAME example mps OBJSENSE MAX OBJNAME rowname 36 FILE FORMATS SUPPORTED BY CPLEX Integer variables in MPS files If you use the CPLEX mixed integer optimizer then you may restrict any or all variables to integer values CPLEX accepts two commonly used ways of extending the MPS file format to include integer variables in the COLUMNS section or in the BOUNDS section In the first way integer variables are identified within the COLUMNS section of the MPS file by marker lines A marker line is placed at the beginning and end of a range of integer variables Multiple sets of marker lines are allowed Integer marker lines have a field format consisting of Fields 2 through 4 Field 2 Marker name Fie
43. logos are trademarks of Sun Microsystems Inc in the United States other countries or both Other company product or service names may be trademarks or service marks of others Further notices Additional registered trademarks Python is a registered trademark of the Python Software Foundation MATLAB is a registered trademark of The MathWorks Inc Acknowledgement of use dtoa routine of the gdtoa package ILOG acknowledges use of the dtoa routine of the gdtoa package available at http www netlib org fp The author of this software is David M Gay All Rights Reserved Copyright C 1998 1999 by Lucent Technologies Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appears in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation and that the name of Lucent or any of its entities not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN
44. m records and ask usage questions on System z software products You can open track update and close a defect or problem record order corrective preventive toleration maintenance search for known problems or technical support information track applicable problem reports receive alerts on high impact problems and fixes in error and view planning information for new releases and preventive maintenance Contact by phone If you have an active service contract maintenance agreement with IBM or are covered by Program Services you may contact customer support teams by telephone For individual countries please visit the Technical Support section of the IBM Directory of worldwide contacts FILE FORMATS SUPPORTED BY CPLEX 9 10 FILE FORMATS SUPPORTED BY CPLEX File Formats Reference Manual This manual documents the file formats supported by IBM ILOG CPLEX It begins with a brief description of the file formats in alphabetic order This manual continues with longer explanations of the following topics and formats In this section Brief descriptions of file formats Defines the file formats CPLEX recognizes and supports Reading and eniering file formats in the Interactive Optimizer Describes the file formats appropriate for the Interactive Optimizer Saving problems in the Interactive Optimizer Explains which format to use to save a problem in the Interactive Optimizer LP file format matrix models Summarizes the rules
45. me of the row of the indicator constraint the name of the binary variable and finally the value 0 zero or 1 one to indicate when the constraint should be active Rows that appear in the INDICATORS section cannot be ranged rows In other words a row that appears in the RANGES section cannot appear also in the INDICATORS section Here is an example of an INDICATORS section NAME indl mps ROWS N obj L row2 L row4 E xrowl E row3 COLUMNS x obj Si x row2 1 x row4 d x row 1 y row4 1 2 row4 1 Zz row3 1 RHS rhs row2 10 rhs row4 iS BOUNDS UI bnd y 1 INDICATORS IF rowl y 1 IF row3 y 0 ENDATA That declaration represents the following model FORMATS SUPPORTED BY CPLEX Minimize SISTR x Subject To row2 x lt 10 BOWA ao 4p bem ea LE rowl y row3 y Bounds 0 lt y lt 1 Binaries y End Il L M N Il FILE FORMATS SUPPORTED BY CPLEX 4 amp 5 User defined cuts in MPS files The advanced feature user defined cuts can be declared in a special section following the ROWS section The title of this section is USERCUTS The order of sections must be Rows USERCUTS The format of the USERCUTS section is the same as the format of the Rows section with this exception the type must be one of E L or G the row must not be ranged For more information about user defined cuts see User cut and lazy constraint pools in the CPLEX User s Manual 46 FILE FORMATS SUPPORTED BY CPLEX Lazy con
46. name of each bound vector appears in Field 2 However only the first bound vector is selected when a problem is read Additional bound vectors are discarded FILE FORMATS SUPPORTED BY CPLEX 1 Example of MPS file format 32 ELE NAME ROWS N obj be i e COLUMNS sal x1 E E 3 SS RHS rhs BOUNDS UP BOUND ENDATA FORMATS example2 mps obj G2 obj C2 obj C2 oul Sl mil S2 3 S 20 40 SUPPORTED B Gili ih Cili Ce Y CPLEX 30 Special records in MPS files CPLEX extensions CPLEX extends the MPS standard in several ways In this section Overview of MPS extension Introduces extensions to the MPS file format to support special features of CPLEX Objective sense and name in MPS files Describes the CPLEX extension of MPS files to support name and sense of an objective function Integer variables in MPS files Describes CPLEX extensions of MPS file format to support integer variables Special ordered sets SOS in MPS files Describes CPLEX extensions of MPS file format to support special ordered sets Quadratic objective information in MPS files Describes CPLEX extensions of MPS file format to support an objective function containing quadratic terms Quadratically constrained programs QCP in MPS files Describes CPLEX extensions of MPS file format to support quadratically constrained programs Indicator constraints in MPS files Describes CPLE
47. nas 68 DON EEN 69 6 FILE FORMATS SUPPORTED BY CPLEX For support Explains the prerequisites and procedure for technical support of the product In this section Contacting IBM Support Contains information on how to obtain technical support from IBM worldwide should you encounter any problems in using IBM products Copyright IBM Corp 1987 2009 7 Contacting IBM Support 8 BPE IBM Software Support Handbook This guide contains important information on the procedures and practices followed in the service and support of your IBM products It does not replace the contractual terms and conditions under which you acquired specific IBM Products or Services Please review it carefully You may want to bookmark the site so you can refer back as required to the latest information The IBM Software Support Handbook can be found on the web at http www14 software ibm com webapp set2 sas f handbook home html Accessing Software Support When calling or submitting a problem to IBM Software Support about a particular service request please have the following information ready IBM Customer Number The machine type model serial number for Subscription and Support calls Company name Contact name Preferred means of contact voice or email Telephone number where you can be reached if request is voice Related product and version information Related operating system and database information Detailed description of the i
48. nstraint name c2 index 1 slack 2 gt lt constraint name c3 index 2 slack 0 gt lt linearConstraints gt lt variables gt lt variable name x1 index 0 value 40 gt lt variable name x2 index 1 value 10 5 gt lt variable name x3 index 2 value 19 5 gt lt variable name x4 index 3 value 3 gt lt variables gt lt CPLEXSolution gt FILE FORMATS SUPPORTED BY CPLEX _ 59 60 FILE FORMATS SUPPORTED BY CPLEX FLT file format filter files for the solution pool Describes FLT file format to support filters of the solution pool In this section Overview of FLT Introduces FLT file format for specifying filters of the solution pool Reading and writing filter files Cites methods and routines for reading and writing filter files Syntax of a filter file Describes the syntax of a filter file Diversity filters Describes diversity filters for the solution pool Range filters Describes range filters for the solution pool FILE FORMATS SUPPORTED BY CPLEX 61 Overview of FLT FLT denotes a file format for specifying filters either diversity filters or range filters associated with the solution pool of an application of CPLEX This section documents that format For more general information about the solution pool see Solution pool generating and keeping multiple solutions of the CPLEX User s Manual For an introduction to these filters and their purpose along with example
49. ortation cost must be no more than the fixed cost LO transport os en eo lt 0 In a formatted FLT file a range filter is specified by the keyword RNGFILTER The name of the filter in this example 2 follows the keyword RNGFILTER on the same line The lower and upper bounds on the linear expression follow the name of the filter on the same line as the keyword RNGFILTER In this example the lower bound on the expression is negative infinity that is no lower limit and the upper bound is 0 zero Each successive line shows the name of the variable and its coefficient in the linear expression 66 FILE FORMATS SUPPORTED BY CPLEX CSV file format comma separated values CPLEX supports the file format known as CSV through XML facilities in Concert Technology CSV is a file format consisting of lines of comma separated values in ordinary ASCII text Concert Technology provides classes adapted to reading data into your application from a CSV file The constructors and methods of these classes are documented more fully in the CPLEX C API Reference Manual as the group optim concert extensions lloCsvReader An object of this class is capable of reading data from a CSV file and passing the data to your application There are methods in this class for recognizing the first line of the file as a header for indicating whether or not to cache the data for counting columns for counting lines for accessing lines by number or by
50. ptimizer for quadratic programming problems QPs then you can specify quadratic objective coefficients in MPS format in a QMATRIX section Following the BOUNDS section a QMATRIX section may be specified Each line of this section defines one nonzero coefficient of the matrix Q Each line should contain two variable names which must have been specified in the COLUMNS section in Fields 2 and 3 followed by a nonzero coefficient value in Field 4 For each off diagonal coefficient two lines must appear one for the lower triangular element and one for the upper triangular element CPLEX evaluates the quadratic part of the objective function as 0 5 x Qx when the coefficients of Q are specified in an MPS file For example consider the following problem Minimize a b 1 2 a2 dab 7b2 subject to a b 10 a b 0 In MPS format you may enter the problem in the following way NAME problem ROWS N obj G il COLUMNS a obj al eal 1 b obj aL eal i RHS rhs Sch 10 QMATRIX a a 1 a b 2 D a 2 D D 7 ENDATA You can also enter the quadratic objective coefficients by using a QUADOBJ section In this format only the upper diagonal elements of the Q matrix are entered For the same example the input with a QUADOBJ section looks like this NAME problem ROWS FILE FORMATS SUPPORTED BY CPLEX 41 N obj G ei COLUMNS a obj i el 1 b obj i ei i RHS rhs cal 10 QUADOBJ a a L a b 2 b b J ENDATA If you have a model with qu
51. r defined cuts 24 PPE file format 15 PRE file format 15 preprocessing saving reduced problem 15 priority order saving in ORD format 14 PRM file format 15 FILE FORMATS SUPPORTED BY problem allocating memory when reading from file 17 entering in Interactive Optimizer 17 format for saving presolved 15 saving in Interactive Optimizer 18 QUADOBJ section in MPS files Ai quadratic coefficients in MPS file format 41 quadratically constrained program QCP MPS file format and 43 read Interactive Optimizer command file formats and 17 REW file format 15 58 RLP file format 15 row variable 54 SAV file format 15 semi continuous variable file format for entering 22 solution file creating 58 solution pool 14 SOS format for entering in MPS 22 in MPS file format 39 structural variable 54 user defined cut LP 24 user defined cut MPS 46 variable integer 37 row 54 semi continuous 22 structural 54 write Interactive Optimizer command file formats and 18 XML file format 16 CPLEX
52. s Use the sol option to write solution files This option also applies to solutions in the solution pool In fact an additional option specifies whether to write a single solution specified by its index or to write all solutions from the solution pool The SAV file format because it is binary is the format that preserves the greatest degree of precision in data It can be effective in reducing read and write time for repetitively solved problems However because it is a binary format it cannot be readily viewed or edited in standard text editors As a naming convention we recommend that you use the file format for reading the file as the file extension when you write or save the file for instance example bas example 1p example mps example sav When you follow this convention CPLEX automatically recognizes the file type and eliminates additional prompts for you to specify a file type FORMATS SUPPORTED BY CPLEX LP file format matrix models CPLEX provides a facility for entering a problem in a natural algebraic LP formulation from the keyboard The problem can be modified and saved from within CPLEX This procedure is one way to create a file in a format that CPLEX can read An alternative technique is to create a similar file using a standard text editor and to read it into CPLEX The CPLEX LP format is provided as an input alternative to the MPS file format An LP format file may be easier to generate than
53. s in the DEMAND section and vice versa The format for doing so is exactly the same node name value There is no requirement to use both a SUPPLY and a DEMAND section in a given model You can fully specify any model using either of the section types alone by correctly using positive and negative values The availability of either or both section types simply offers flexibility in model formulation The ARCS section In this section the arcs from node or tail and to node or head are specified For each arc the format is arc name from node gt to node where arc name specifies the name for the arc from from node to to node If arc name already exists a warning message is issued and the specified nodes override the previous ones The nodes are referred to by node names If a node does not yet exist a new node with this name will be created with supply value 0 zero Otherwise the existing node of the specified name will be used The OBJECTIVE section This section is used to assign objective values to arcs in the format arc name value where arc name must be the name of an arc that has previously been specified in an ARCS section This arc will be assigned the objective value indicated by value Ifan arc is assigned an objective value more than once a warning message will be issued and the most recently assigned objective value for that arc in the file will be used If no objective value is specified for an arc 0 zero
54. s of their use see also Diversity filters and Range filters of the CPLEX User s Manual 62 FILE FORMATS SUPPORTED BY CPLEX Reading and writing filter files An existing filter file such as one you create in your favorite text editor or one you have saved from a previous session can be added to your application and associated with the solution pool by one of these means Concert Technology 6 readFilters in the C API 6 readFilters String in the Java API 6 cplex ReadFilters in the NET API cPXreadcopysolnpoolfilters routine of the Callable Library read filename flt command of the Interactive Optimizer The diversity and range filters already associated with a solution pool can be saved ina formatted file as explained in Filter files in the CPLEX User s Manual In Concert Technology 6 inthe C API use the method writeFilters 6 in the Java API use the method writeFilters String in the NET API use the method CPLEX WriteFilters Inthe Callable Library use the routine CPxXfltwrite write filename flt command ofthe Interactive Optimizer where filename is the name of a file that the user supplies and f1t specifies the format of the file FILE FORMATS SUPPORTED BY CPLEX 63 Syntax of a filter file A filter file may contain one or more diversity filters one or more range filters or a combination of both types of filter The filters in a file are associated with a particular model The nam
55. solutionTypeValue 3 solutionTypeString primal solutionStatusValue 101 solutionStatusString integer optimal solution MIPNodes 0 MIPIterations 3 gt lt quality epInt le 05 epRHS 1le 06 maxIntInfeas 0 maxPrimalInfeas 0 maxX 40 maxSlack 2 gt lt variables gt lt variable name x4 index 3 value 3 gt lt variables gt lt CPLEXSolution gt 56 FILE FORMATS SUPPORTED BY CPLEX ORD file format priorities and branching orders If you use the CPLEX MIP optimizer the ORD file format is available to indicate priority orders and branching directions for specific variables Variables that are not given an explicit priority or that do not appear in an ORD file are assigned 0 zero priority An ORD file begins with a NAME indicator record and ends with an ENDATA record Integer variables are specified one per line with an optional branching direction UP or DN beginning in column 2 and 3 Names begin in column 5 or beyond The variable name and its priority must be separated by one or more blank spaces Here is an example of an ORD file NAME X 10 DN x5 5 UD SCH ENDATA ORD files created using CPLEX versions 2 1 or earlier used a fixed format in which the various data fields were limited to eight characters in length and restricted to specific columnar positions in each line The extensions provided in the new CPLEX ORD file reader allow for more descriptive names and greater overall input
56. ss Numeric fields can be at most 25 characters long If the first character in Field 3 or 5 is a dollar sign the remaining characters in the record are treated as a comment Another method for inserting comments is to place an asterisk in column 1 Everything on such a line is treated as a comment Values may be defined with decimal or exponential notation and may utilize 25 characters In exponential notation plus and minus signs must precede the exponent value If an exponent value is missing where one is expected it is assigned a value of 0 zero The ROWS section In the Rows section each row of the problem is specified with its name and sense one row per record Field 1 contains a single letter designating the sense of each row Acceptable values are N indicates a free row G indicates a greater than or equal to row L indicates a less than or equal to row indicates an equality row Field 2 contains a character identifier maximum length of 255 characters specifying the name of the row Fields 3 6 are not used in the Rows section If more than one free row is specified the first one is used as the objective function and the others are discarded The Rows section of our example looks like this ROWS N obj ik eal ih e2 The COLUMNS section In the COLUMNS section all the columns of the constraint matrix are specified with their name and all of the nonzero elements Multiple re
57. ssue Se gt gt gt gt gt gt gt gt Severity of the issue in relationship to the impact of it affecting your business needs Contact by Web Open service requests is a tool to help clients find the right place to open any problem hardware or software in any country where IBM does business This is the starting place when it is not evident where to go to open a service request Service Request SR tool offers Passport Advantage clients for distributed platforms online problem management to open edit and track open and closed PMRs by customer number Timesaving options create new PMRs with prefilled demographic fields describe problems yourself and choose severity submit PMRs directly to correct support queue attach troubleshooting files directly to PMR receive alerts when IBM updates PMR view reports on open and closed PMRs You can find information about assistance for SR at http www ibm com software support help contactus html System Service Request SSR tool is similar to Electronic Service request in providing online problem management capability for clients with support offerings in place on System FORMATS SUPPORTED BY CPLEX i System p System z TotalStorage products Linux Windows Dynix PTX Retail OS 2 Isogon Candle on OS 390 and Consul z OS legacy products IBMLink SoftwareXcel support contracts offer clients on the System z platform the IBMLink online problem management tool to open proble
58. straints in MPS files The advanced feature lazy constraints can be declared in a special section following the ROWS and USERCUTS sections The title of this section is LAZYCoNs The order of sections must be ROWS USERCUTS LAZYCONS The format of the LAZYCONS section is the same as the format of the Rows section with this exception the type must be one of E L or G the row must not be ranged For more information about lazy constraints and an example of an MPS file extended to include them see User cut and lazy constraint pools in the CPLEX User s Manual FILE FORMATS SUPPORTED BY CPLEX 47 NET file format network flow models The NET file format is an ASCII file format specific to CPLEX for network flow problems It is the recommended file format for representing pure network problems within CPLEX This format is supported by Concert Technology by the Callable Library and by the Interactive Optimizer In particular it works with CPXNETptr objects not CPXLPptr objects Comments This is a free format file that is line breaks or column positions are irrelevant to the interpretation of the file The only exceptions to this convention are comments anything from a backslash character to the end of a line is a comment and does not contribute to the network specified by the file Comments are allowed anywhere in the file Keywords The NET format recognizes the following keywords in a file MAXIMIZE MINIMIZE NETW
59. that is in an instance of IloEnv This class offers methods to check runtime type information RTTI to recognize hierarchic relations between objects and to access attributes of objects in your model or solution IloXmlWriter creates a writer in an environment that is in an instance of IloEnv This class offers methods to access elements and to convert their types as needed in order to serialize elements of your model or solution Note There is a fundamental difference between writing an XML file of a model and writing an LP MPS SAV file of the same extracted model If the model contains piecewise linear elements PWL or other nonlinear features the XML file will represent the model as such In contrast the LP MPS SAV file will represent only the transformed model That transformed model obscures these nonlinear features because of the automatic transformation that took place BB FILE FORMATS SUPPORTED BY CPLEX N E X Index GZ 14 LP 14 Se format 13 54 MIN 4 file formats for saving 13 15 MST 14 56 branching NET 14 file format for entering direction 21 eee ORD 14 57 file format for entering priority 21 BZ2 file format 13 PERS PRE 15 PRM 15 comma separated value CSV file format 13 REW 15 58 constraint SAV 15 lazy LP 24 XML 16 lazy MPS 47 T e tormata indicator constraint 23 user defined CE 24 Ser leak 37 user defined MPS 46 a Interactive Optimizer entering problems 17 diversity measur
60. tic constraint in this section use explicit notation for multiplication and exponentiation not space Problem sense The problem statement must begin with the word MINIMIZE or MAXIMIZE MINIMUM or MAXIMUM or the abbreviations MIN or MAX in any combination of upper and lower case characters The word introduces the objective function section FILE FORMATS SUPPORTED BY CPLEX 19 20 FILE Variables Variables can be named anything provided that the name does not exceed 255 characters all of which must be alphanumeric a z A Z 0 9 or one of these symbols amp _ Longer names are truncated to 255 characters A variable name can not begin with a number or a period The letter E or e alone or followed by other valid symbols or followed by another E ore should be avoided as this notation is reserved for exponential entries Thus variables can not be named e9 E 24 E8cats or other names that could be interpreted as an exponent Even variable names such as eels or example can cause a read error depending on their placement in an input line Objective function The objective function definition must follow MINIMIZE or MAXIMIZE It may be entered on multiple lines as long as no variable constant or sense indicator is split by a return For example this objective function 1x1 2x2 3x3 can be entered like this Jack sp Dx Hr eS but not like this TII ae ZR SHR SS a bad idea
61. tors and values for each constraint row RANGES specifies constraints that are restricted to lie in the interval between two values interval endpoints are also specified specifies the limits within which each variable column must remain signals the end of the data always the last entry in an MPS file Each section of the MPS file except the RANGES and BOUNDS sections is mandatory If no BOUNDS section is present all variables have their bounds set from 0 zero to positive infinity Failure to include an RHS section causes CPLEX to generate a warning message and set all righthand side values to 0 zero Variables and constraints must be declared in the ROWS and COLUMNS sections before they are referenced in the RHS RANGES and BOUNDS sections Data records Data records contain the information that describes the LP problem Each data record comprises six fields as in Fields of a data record in MPS file format The fields must be separated by white space that is blank space tab etc and the first field must begin in column 2 or beyond Not all fields are used within each section of the input file FILE FORMATS SUPPORTED BY CPLEX 27 28 ELLE Fields of a data record in MPS file format Any ASCII character 32 through 126 is legal but names must contain no embedded blanks In addition names over 255 characters are truncated CPLEX issues an error message if truncation causes the names to lose their uniquene
62. ts two variables are multiplied by an asterisk For example 4x y indicates that the coefficients of both of the off diagonal terms of Q corresponding to the variables x and y in the model are 2 since 4x y equals 2x y 2x y Each pair of off diagonal terms of Q is specified only once CPLEX automatically creates both off diagonal entries of Q Diagonal terms in Q that is terms with an exponent of 2 are indicated by the caret followed by 2 For example 4x 2 indicates that the coefficient of the diagonal term of Q corresponding to the variable x in the model is 4 For example this problem Minimize a b 1 2 a 4ab 7b2 subject tta b2 10anda b 0 FILE FORMATS SUPPORTED BY CPLEX 23 24 FILE in LP format looks like this Minimize loys er tte db A ey Se lee dh TTI Sib wie E Ae Cl eto 1G End Pools of lazy constraints and user defined cuts This rule is of interest only to advanced users It is possible to include pools of lazy constraints and user defined cuts in an LP file A pool of lazy constraints or of user defined cuts must not contain any quadratic constraints For more about these concepts see User cut and lazy constraint pools in the CPLEX User s Manual FORMATS SUPPORTED BY CPLEX MPS file format industry standard Describes the industry standard MPS file format and CPLEX extensions to it In this section Overview of MPS Introduces MPS file format Records in MPS format Descr
63. ues for particular variables most commonly the integer variables MST files are of the same format as SOL files While SOL files have values for all variables MST files written by CPLEX at the default write level of detail have values only for the integer variables and members of special ordered sets SOS at higher write levels of detail MST files may also contain both discrete and continuous variables For more information about the write level for MST SOL files see the CPLEX Parameters Reference Manual WriteLevel CPX_PARAM WRITELEVEL MST file format also supports MIP starts from members of the solution pool See details about the Concert Technology methods cplex writeMIPStarts and the Callable Library routine CPXmstwritemipstarts documented in their respective reference manuals CPLEX uses the start values in an MST file only if the advanced indicator parameter is on that is set to 1 one its default In Concert Technology use the method IloCplex setParam Advind 1 In the Callable Library use the routine cPXsetintparam env CPX PARAM ADVIND 1 In the Interactive Optimizer use the command set advance 1 Here is an example of an MST file lt xml version 1 0 standalone yes gt lt xml stylesheet href https www ilog com products cplex xmlv1 0 solution xsl type text xs1 gt lt CPLEXSolution version 1 0 gt lt header problemName examples data mexample mps objectiveValue 122 5
64. will be used by default The BOUNDS section In this section bounds on the flow through an arc are specified in a variety of ways similar to specifying bounds on variables in LP format The general format is valuel lt arc name lt value2 That general statement assigns a lower bound of value1 and an upper bound of value2 to the arc named arc name This arc must have previously been defined in an ARCS section FORMATS SUPPORTED BY CPLEX Only one bound at a time may be specified for an arc That is the following are valid inputs value lt arc name to set the lower bound of the specified arc to value or arc name lt value to set the upper bound of the specified arc to value If the upper and lower bound for an arc are identical you can write arc name value instead Bound values may be INFINITY or INFINITY An arc with lower bound INFINITY and upper bound INFINITY may be entered as FREE like this arc name free If a bound is not specified for an arc 0 zero will be used as the default lower bound and infinity as the default upper bound Example of NET file format Except for this comment this is the example network file created by netexl c N MINIMIZE NETWORK netex1 SUPPLY DL 20 ml a Sita m5 ST fy ee ARCS SL 2 EN n2 ere ane TA S n3 aos ml S n4 a4 n4 gt n7 AS m ee n6 ao 0 PO cS ng EE ins SS ng ao 3 UE SS n2 ave ios Ss n2 SO 2 ne gt n5 SO 2 na gt n6 SU 2 n6 gt n4 Bul

Download Pdf Manuals

image

Related Search

Related Contents

CS STRUMENTAZIONE ELETTRONICA S.r.l.  DR-1 DRL-1 全長×全巾 560×310 (mm) 1,000×310 (mm) 重量 1.75  Histoires de dispositifs - Foro Analítico del Río de la Plata  TP N°  AlphaTRAK Lancing Device    Haier AB142ACBEA User's Manual  VocoPro DVX-780K User's Manual  Mon super livre enchanté  Manual HelioControl para pdf.cdr  

Copyright © All rights reserved.
Failed to retrieve file