[OS] Understanding linearConstraintCoefficients markups

Joe joe.boublack at gmail.com
Tue Feb 12 11:39:08 EST 2008



I'm trying to convert my lp_solve/LP files into OSiL file format. I
don't understand the mapping applied on coefficients from
linearConstraintCoefficients markups. I've found one example in the
"OS 1.0 User's Manual" also discussed in this newsgroup. However these
explanations is not so clear for me. I've also checked examples from
documentations of LPFML because OSiL would be a superset of this
language (unfortunately, markups names have been changed from LPFML to
OSiL conventions).

Maybe someone could help me to convert a small (only 4 variables, 2
constraints, 1 objective) lp_solve/file into OSiL (the contents of
small.lp is paste on the end of this message). Please find my attempt
for OSiL formulation (actually, OSSolverService crashes on parsing
this file) :

#broken-small.osil ; usage : OSSolverService -osil broken-small.osil
<?xml version='1.0' encoding='UTF-8'?>
<osil xmlns='os.optimizationservices.org'>
 <instanceHeader>
  <name>My broken example</name>
  <source>Manually written</source>
  <description>Any comments</description>
 </instanceHeader>

<!-- Objective -->
<objectives numberOfObjectives='1'>
 <obj name='Example objective' maxOrMin='max'  numberOfObjCoef='1'>
  <coef idx='3'>1</coef>
 </obj>
</objectives>

<!-- Constraints -->
<constraints numberOfValues='2'>
 <con ub='0' lb='0'/>
 <con ub='100'/>
</constraints>

<linearConstraintCoefficients numberOfValues='4'>
  <rowIdx><el> 0 </el></rowIdx>
  <start> <el> 3 </el><el> 0 </el><el> 1 </el><el> 2 </el></start>
  <value> <el> 7 </el><el> 2 </el><el> 3 </el><el> 5 </el></value>
</linearConstraintCoefficients>

<linearConstraintCoefficients numberOfValues='3'>
  <rowIdx><el> 1 </el></rowIdx>
  <start> <el> 0 </el><el> 1 </el><el> 2 </el> </start>
  <value> <el> 1 </el><el> 1 </el><el> 1 </el> </value>
</linearConstraintCoefficients>

<!-- Declarations -->
<variables numberOfVariables='4'>
 <var name='X0' type='I'/>
 <var name='X1' type='I'/>
 <var name='X2' type='I'/>
 <var name='X3' type='I'/>
</variables>

</instanceData>
</osil>
### end broken-small.osil


The original lp_solve/LP file :

### small.lp ; usage : lp_solve < small.lp
/* Objective */
 MAX: X3;

/* Constraints */
 7 X3 - 2 X0 - 3 X1 - 5 X2 = 0;
 X0 + X1 + X2 <= 100;

/* Bounds */
X0 >= 0 ; X1 >= 0 ; X2 >= 0 ; X3 >= 0;

/* Declarations */
INT   X0   X1   X2   X3 ;

### end small.lp


Thanks for any remarks on the OSiL file contents (I didn't try to make
my OSiL file compact, it is not the aim) !
Joe.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Optimization Services (OS)" group.
To post to this group, send email to optimizationservices at googlegroups.com
To unsubscribe from this group, send email to optimizationservices-unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/optimizationservices?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the OS mailing list