Re: Recommend please : free math library




If I read the problem correctly, this can be formulated as a MIP (mixed integer programming) problem or a CP (constraint programming) problem. E.g.


x(1) - 1024*x(3) = 1024 x(2) - 1024*x(4) = 1024 0 <= x(i) <= 1024 x(i) integer x(i) alldifferent

A MIP formulation could look like:

min dummy
x(1) - 1024*x(3) = 1024
x(2) - 1024*x(4) = 1024
x(i) <= x(j) - 1 + d(i,j)*M      for i>j
x(i) >= x(j) + 1 - (1-d(i,j))*M  for i>j
0 <= x(i) <= 1024
x(i) integer
d(i,j) binary for i>j
where M is an appropriate constant e.g. 1025.
and dummy is a dummy objective function, e.g.
minimize x(1).

Solvers (including free ones) for such problems are
readily available.

Erwin


linq936@xxxxxxxxxxx wrote:
Hi Peter,
  Thanks, I will check that out.

  Please let me add some more constraints to the original matrix,
  1) x1, x2, x3 and x4 are all integer which is less than 1024 and
larger than or equal to 0
  2) x1, x2, x3 and x4 do not equal

  And the last, the program only need one numeric solution, do not care
the whole solution set.

  Given the above, how should I proceed then?

  All I had in mind was to work out some symbolic expression for each
variable and then somehow apply the the 2 constraints I mentioned in
this email. Since these 2 are not equations, I do not know how to
combine them with matrix algebra.

  Any suggestion is highly appreciated.



----------------------------------------------------------------
Erwin Kalvelagen
GAMS Development Corp., http://www.gams.com
erwin@xxxxxxxx, http://www.gams.com/~erwin
----------------------------------------------------------------
.



Relevant Pages

  • Re: POD speed
    ... I listed reasons that enforcement of database ... constraints in application code is error-prone compared to enforcement by the DBMS using ... implement outside the DBMS. ... > programming class I've seen as one ...
    (comp.lang.java.databases)
  • Re: Favorite non-python language trick?
    ... And -- why isn't it in Python? ... I use constraints programming at work, ... It would be great if this style of programming could be added to ... is an example written in Cadence's Specman 'e' language: ...
    (comp.lang.python)
  • Re: Philosphy of programming
    ... there are certain constraints on the model. ... on simulation and the ... It's the constraints on the simulation that make programming ... reality, and then creating a simulation of that limitted reality which can ...
    (comp.programming)
  • Re: ...Thanks for recommending that book!
    ... >Thank you for recommending Krzysztof R. Apt's "Principles of Constraint ... It just arrived from Amazon today, ... >on logic programming features relevant to CSP, ... Constraints" by Kim Mariott and Peter Stuckey, ...
    (comp.lang.prolog)
  • Re: Default selection for radio buttons
    ... just to flesh things out for the eventual ... programming, and this has raised a question or two about the ... This is one of the dummy pages - notice that there are a lot ... the power to abolish all forms of human poverty, ...
    (comp.infosystems.www.authoring.html)