IBM Support

Variable and constraint names are tagged with "#<number>" suffixes in the exported LP models

Question & Answer


Question

Why are the variable and constraint names tagged with "#" suffixes?

Answer

There are specific rules to follow when it comes to variables and constraint naming in CPLEX LP files. You can find them under the Getting Started with CPLEX > Tutorials > Interactive Optimizer tutorial > Entering a problem > Using the LP format section of the documentation.

When exporting a model in LP format, CPLEX will check whether the names of the variables and constraints violate any of the naming rules. If a violation(s) is found, CPLEX will print the warning "Warning: Output names have been modified to conform to LP format." and modify variable/constraint names.

In CPLEX 12.1 and earlier versions, only the violating characters in the violating names are modified. However, this modification may introduce unwanted duplication.

Since CPLEX Optimization Studio version 12.2, besides modifying the violating characters, all variables/constraints names will be tagged with "#<number>" suffixes, if a variable/constraint naming violation occurs. The numbers used in suffixes are unique, so the uniqueness of the variable names is not affected by the modification.

Note that you should be cautious when using "E" and "e" in variable and constraint names. Here is the excerpt from the documentation of LP format:

The letter E or e , alone or followed by other valid symbols, or followed by another E or e , 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.

[{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Input\/Output","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF014","label":"iOS"}],"Version":"12.4;12.3;12.2.0.1;12.2","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21512617