[OS] Understanding linearConstraintCoefficients markups

Kipp Martin Kipp.Martin at ChicagoGSB.edu
Tue Feb 12 14:32:23 EST 2008


Hi Joe:

Thanks for your interest. I attach two files. The first file is 
lp_solve_ex.osil which is an osil example file for your  LP.  I ran it 
and also attach lp_solve_ex.osrl which is the answer. It appears that 
the answer is

x0 = 1
x1 = 0
x2 = 99
x3 = 71

with optimal objective function value 71.

Cheers

> 
> 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.
> 
> > 


-- 
Kipp Martin
Professor of Operations Research
and Computing Technology
Graduate School of Business
University of Chicago
5807 South Woodlawn Avenue
Chicago, IL 60637
773-702-7456
kipp.martin at chicagogsb.edu
http://gsbkip.chicagogsb.edu
http://www.coin-or.org

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lp_solve_ex.osil
Type: text/xml
Size: 1747 bytes
Desc: not available
Url : http://list.coin-or.org/pipermail/os/attachments/20080212/7f5c4172/attachment.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lp_solve_ex.osrl
Type: text/xml
Size: 1780 bytes
Desc: not available
Url : http://list.coin-or.org/pipermail/os/attachments/20080212/7f5c4172/attachment-0001.xml 


More information about the OS mailing list