1

I am trying to use an lp file with this syntax:

http://www.rpi.edu/dept/math/math-programming/cplex66/sun4x_58/doc/refman/html/appendixE13.html

although it says that multiplication is like this:

a * b

the * gives me a syntax error. Any ideas?
I am using the standard linux package lp_solve

Kyriakos
  • 757
  • 8
  • 23
  • Looking at your post I can't see the text you linked to link you provided. – Hoh Aug 23 '14 at 19:01
  • Sorry I just put it in. Thank you for your edits! – Kyriakos Aug 23 '14 at 19:03
  • Can you post part of your constraints? Are you using CPLEX format? According to the page you linked the asterisk has to be inside square brakets, and it used for the non-diagonal terms of the quadratic form `xQx`. – Ioannis Aug 23 '14 at 22:48
  • Hi Ioanni and thanks for your reply. your right I am not using CPLEX format. Probably that's why is not recognizing it. I am using LP file format. So all I really want is to multiply to variables. for example have the constraint:x5 <= k*d6; where x5, k, d6 are integers. The * symbol is giving me an error – Kyriakos Aug 24 '14 at 17:22
  • On lpsolve.sourceforge.net/5.5/ they say that quadratic constraints is not supported. Do you really need to multiply variables? In many cases problem can be reformulated to be linear. – jindraivanek Aug 25 '14 at 23:05

2 Answers2

2

You can't multiply two variables in linear program. That's why it's called a linear program. A linear equation or inequality is always a polynomial of first-degree, hence it has the form:

c1*x1 + ... + cn*xn = b

Where {c1,..,cn} and b are constants and {x1,..,xn} are variables.

Read the definition for more information:

https://en.wikipedia.org/wiki/Linearity

If you are looking for an optimization approach for polynomials of a higher degree, search for nonlinear optimization such as:

https://en.wikipedia.org/wiki/Nonlinear_programming

Bastian
  • 1,553
  • 13
  • 33
0

I'm using LP files with Gurobi and CoinOR (CBC), and the format for multiplications is to NOT use a * sign. So, if you have a constraint a * b, just write:

a b

Don't forget the space, otherwise it will be considered as a new variable ab (even if one of your terms is a purely numerical value).

Etienne C
  • 376
  • 4
  • 9