xpress-mp optimization

135 views
Skip to first unread message

exter

unread,
Jun 3, 2007, 12:56:36 AM6/3/07
to Xpress-MP
Hello. I am trying to write a program for xpress-mp optimization that
finds the minimum value of x.Q.x* where x is a 1xn vector and Q is a
nxn matrix. ( * denotes transpose). Q is given, and x is a vector of
values either 0 or 1. I think I followed the xpress-mp essentials
(http://www.dil.univ-mrs.fr/~vancan/m09/documents/essentials.pdf), but
it does not work. Please help me with the code. I am writing the
problems in parenthesis within the code. Thank you.

model minimization
uses "mmxprs";

declarations
n = 1..10
x: array(n) of mpvar
matrix: array(n,n) of real
temp: array(n) of real
end-declarations

matrix := [0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,
0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1] (error101: incompatible
types in assignment)
forall(i in n) x(i) is_binary
forall(j in n) temp(j) := sum(i in n) x(i)*(matrix(i,j))
(error101: incompatible types in assignment)

h:= sum(i in n) x(i)*temp(i)
minimize(h)
writeln("Minimum energy is ",getobjval)
writeln("x = ",getsol(x)) (error102:
incompatible types for parameters of "getsol".)

bobdaniel

unread,
Jun 3, 2007, 5:00:44 AM6/3/07
to Xpress-MP
1. Please read previous replies.
2. model minimization
uses "mmxprs","mmquad"

declarations
n = 1..10
x: array(n) of mpvar
matrix: array(n,n) of real
end-declarations
initializations from "t.dat"
matrix
end-initializations

forall(i in n) x(i) is_binary
minimize(sum(i,j in n) x(i)*matrix(i,j)*x(j))

writeln("Minimum energy is ",getobjval)
forall (i in n) writeln("x(", i,")= ",getsol(x(i)))
end-model

3. You can create t.dat yourself.

exter

unread,
Jun 3, 2007, 9:00:23 AM6/3/07
to Xpress-MP
Hello bobdaniel. Thank you very much for your reply. I tried it, but I
get the following error. I would appreciate your further help. ---
exter---

model minimization
uses "mmquad";


declarations
n = 1..10
x: array(n) of mpvar
matrix: array(n,n) of real
end-declarations
initializations from "t.dat"
matrix
end-initializations
forall(i in n) x(i) is_binary
minimize(sum(i,j in n) x(i)*matrix(i,j)*x(j))

(error123: "minimize" is not defined)


writeln("Minimum energy is ",getobjval)
forall (i in n) writeln("x(", i,")= ",getsol(x(i)))
end-model

t.dat file is:
matrix: [1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1]

exter

unread,
Jun 3, 2007, 11:57:38 AM6/3/07
to Xpress-MP
Hello.

Adding to the previous message, I also tried:
t.dat file:
matrix: [1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1]

Is there a specific directory I should store this file? I usually save
t.dat and minimization.mos file on desktop. Thanks again.

Raphael Chabar

unread,
Jun 3, 2007, 5:15:15 PM6/3/07
to Xpress-MP
You forgot to specify the use of the mmxprs library (uses "mmxprs") -
without it you won't do any optimization - additionally to the use of
the quadratic library (uses "mmquad"), required since your model
involves quadratic programming.

On Jun 3, 12:57 pm, exter <sejoon...@hotmail.com> wrote:
> Hello.
>

> Adding to the previous message, I also trzation - ied:

exter

unread,
Jun 3, 2007, 7:57:43 PM6/3/07
to Xpress-MP
Thank you for your reply. Now, the program runs, but there is one more
problem. I set the values of x (which is a 1xn matrix) to take values
either 0 or 1 (forall(i in n) x(i) is_binary). However, I get the
vector containing real values: Please tell me how to fix this. Thanks
again. ---exter---

x(1)= 1.19159
x(2)= 0.908745
x(3)= 0.395778
x(4)= 0.741114
x(5)= 1.18331
x(6)= 0.900206
x(7)= 1.38135
x(8)= 0.901781
x(9)= 0.24378
x(10)= 1.82767
x(11)= 1.08778
x(12)= 0.741361
x(13)= 1.17491
x(14)= 1.54276
x(15)= 1.31522
x(16)= 0.889918
x(17)= 0.43708
x(18)= 0.553228
x(19)= 0.663693
x(20)= 1.55591
x(21)= 0.0693643
x(22)= 0.647546
x(23)= 1.08989
x(24)= 1.32768
x(25)= 0.873682
x(26)= 1.16688
x(27)= 1.45494
x(28)= 1.92084
x(29)= 1.00719
x(30)= 1.06678
x(31)= 0.604012
x(32)= 1.30586
x(33)= 0.361892
x(34)= 1.45934
x(35)= 1.15125
x(36)= 1.07065
x(37)= 0.001
x(38)= 1.02743
x(39)= 0.776843
x(40)= 1.09378
x(41)= 0.622654
x(42)= 0.768762
x(43)= 0.879336
x(44)= 0.357083
x(45)= 0.853013
x(46)= 1.07815
x(47)= 0.813489
x(48)= 1.96134
x(49)= 0.397121
x(50)= 1.26333

exter

unread,
Jun 3, 2007, 8:40:26 PM6/3/07
to Xpress-MP
Hello. Adding to the previous message, my matrix is a 50x50 matrix. I
changed n in the code to n=1..50.
my t.dat file is:
matrix: [0 0.0146716 -0.105635 -0.0878459 0.148285
0.917176 0.172277 0.392689 1.13592 -0.106412 0.425937 -1.14844
1.04536 1.42465 1.37694 -0.0306497 -1.00669 -0.730314 -0.899731
0.172121 0.325556 -1.67704 0.639404 0.0520135 -0.236679
0.102738 -0.580513 -1.59156 1.02582 0.584149 0.560393 -0.245548
1.96872 -0.634699 -1.66988 -0.589918 -1.15798 -0.412623
-1.11822
0.805896 1.83025 -1.24079
1.62206 -0.767071 -0.415811 -1.54997 -0.810296 0.526641 1.4933
0.0492999 0.0146716 0 1.46179 0.371956 -1.37343
0.838838 -0.786776 -0.699816 -1.23025 0.0913872 -0.961162
1.80418
2.19352 -0.854312 -1.79285 -0.936338 -2.0648 -1.34617 -1.3476
1.67497 0.469648 -1.90255 1.17503 -0.667421 0.669387 0.0222846
1.66364 0.272066 0.422218 0.55242 0.631678 -0.344611
0.136446 -0.941352 0.171198 -0.251289 0.172304 1.99166
0.0789586 -0.751269 0.122958 1.21424 -0.144447 -0.603117
1.11808
1.07639 0.157476 -2.03424 -1.1757 -0.384691 -0.105635 1.46179
0 0.281032 -0.21791 -0.109784 0.359965 1.14771 -1.65902
1.29317 -0.0820554 -0.505824 0.379283 -0.429928 -0.0238018
0.755491 -0.198018 0.788144 0.260688 -0.43316 -1.04375 1.38165
0.654828 0.738465 -1.13907 0.82955 -0.270267 -0.99764
0.563893 -0.411609 0.683688 -0.568726 0.426232 -0.15531
-0.566248
2.01947 -2.11372 -1.25541 0.824271 -0.83004
0.242372 -0.467781 -0.869547
1.13022 -0.132097 -0.244272 -0.129292 -1.2763 -0.467369
0.271265 -0.0878459 0.371956 0.281032 0 -1.59742 1.56919
0.270289 -0.623148 -0.518164 0.40409 1.5675 0.947489 -2.13064
0.463916 1.43412
0.593691 -0.767298 -0.0617322 -0.444122 -0.243859 -1.89301
0.265218 1.18012 -3.59848 0.203467 0.00916067 0.153265
-0.270849
0.0640352 0.155932 1.68883 -1.14232 -0.760905
1.31076 -2.23 -0.529138 -0.817583 -0.750809 -1.34916 0.18839
2.1793 0.677626 0.706835 -0.950046 1.70784 -1.05193
1.17071 -0.950676 -0.317183
0.365851 0.148285 -1.37343 -0.21791 -1.59742 0 -0.472634
0.764216 1.03653 -1.39968 -0.348152 0.387943
0.323038 -0.931585 -0.382651 -0.378267 -0.202228
1.63898 -0.636127 0.765126 -0.164869 -0.847364 0.00546717
0.271137 -0.0542792 -1.62596
0.313471 -0.161188 -1.26574 -0.229558 -0.510641
0.407942 -0.665766 -0.444301 1.5627 -2.43865 0.321578 -1.02519
0.227414 0.398191 -0.819521 -0.830086 -0.446544 1.1594
0.744526 -2.5864 0.936224 -0.612824 -0.543582
1.67334 -0.833141 0.917176 0.838838 -0.109784 1.56919 -0.472634
0 0.970188 -0.875832 0.109639 1.26789 -0.931949
1.5364 -0.788372 1.71299 -0.960863 -0.491131 -1.53329 -0.340622
0.0339848 -1.25125 1.07744 -1.76132 0.349657 -0.429715
1.05597 -0.793749 -0.340592 -1.74679 1.29095 -2.28053 0.0820134
1.03547 -0.363845 -1.20705 -0.366488
1.35315 -1.06806 -1.0066 -0.882734 0.254198 -1.4041 0.807704
0.454136 -0.0127676 -0.769539
0.678516 -1.76917 -0.989516 -0.341727
0.0944068 0.172277 -0.786776 0.359965 0.270289 0.764216
0.970188 0 0.444688 -1.17066 -0.0887525
0.0660198 -1.08462 -0.609512 -1.24453 -0.22083 0.779118
-0.360874
1.79792 -0.65713 0.236184 0.702345 1.194 -0.0873938
1.3932 -0.631486 0.420594 0.564819
1.17393 -1.26656 -0.533927 -0.929579 -0.81317 2.09215 0.962324
0.385255 -1.48317 0.555417 0.598972 -0.71481 -0.562258
-0.381009
0.711133 2.09276 0.506124 0.234832 1.16375 0.0417107
0.756733 -0.442761 -0.789999 0.392689 -0.699816
1.14771 -0.623148 1.03653 -0.875832 0.444688 0 0.851426
1.25691 -0.751044 1.39219 0.322437 0.48891 -0.691819 -1.36573
1.98564 0.301628 0.0849024 -0.356836 0.640573 -0.435604
-0.906891
0.25104 0.697597 0.352976 0.226006 0.586916 -0.704213
1.09186 -0.642013 0.0165595 -0.156254 1.83767 -1.82343 0.223785
0.883354 -0.584634 0.805012 0.00633264 0.97417
0.414825 -0.656463 -1.07174 -1.30519 -0.441838 -1.44999
0.107518 -0.416209
0.499699 1.13592 -1.23025 -1.65902 -0.518164 -1.39968
0.109639 -1.17066 0.851426 0 -0.0397924 0.92087 -1.29316
0.949453 -0.759767 -0.482192 0.412632 1.08872 -0.879453
0.601651
1.03038 0.2082 -0.253388 -0.759521 -2.20949
1.41591 -1.06154 -1.39272 1.38948 0.233454 -1.47067 0.0980172
0.199408 1.28692 0.218707
0.575726 -0.0475188 -1.46008 -0.350814 -0.246196
0.919137 -0.805473 -0.941258 0.457846 1.91736 0.326058
0.749766 -0.118848 1.73731 0.54235 0.32942 -0.106412 0.0913872
1.29317 0.40409 -0.348152 1.26789 -0.0887525 1.25691 -0.0397924
0 -0.329613 -1.73719 -1.20596 0.14689
0.961325 -0.0950215 -0.796135 1.90839 -1.20446 2.077 -1.07654
0.276624 0.557598 -0.994002
1.48004 -0.161933 -1.81227 -0.886377 -0.516481 0.418959
0.207715 -0.742561
0.244422 -1.83441 -0.801476 -0.886416 -0.0435479 -0.0629435
-0.306472 0.599403 -0.613855 0.00771092 -0.626734 0.657122 -1.13202
1.24869 0.135714
0.213004 -0.847911 -0.104386 0.425937 -0.961162 -0.0820554
1.5675 0.387943 -0.931949 0.0660198 -0.751044 0.92087 -0.329613
0 0.0476548 -0.262078 1.25623 0.82761
1.52789 -0.963066 -0.527462 0.715203 0.598665 2.055
0.901369 -0.55967 -0.397012 -0.660356 0.117198 0.788426
-1.40331
0.0252286 -0.207434 1.23007 0.065937
1.44468 -0.773573 -0.170689 -2.44306 0.0729949 -0.456244
0.348266 -1.47169 -0.354885 -1.95705
1.14272 -0.398177 -0.302128 -0.810359 0.216162 3.33306 -1.14182
0.418526 -1.14844 1.80418 -0.505824 0.947489 0.323038
1.5364 -1.08462 1.39219 -1.29316 -1.73719 0.0476548 0 0.844457
1.40043 0.296828 -0.692271 1.34154 -0.271451
0.498617 -1.96354 -0.0554408 -0.290439 -0.986759 0.526371
1.00153 -0.481196 0.843561 0.45519 1.85627
1.87989 -0.203773 -0.0837016 -0.298336 1.88623 -0.546095
0.857545
0.206834 -1.63466 0.455984 0.151082 0.444896 0.407115 2.16546
0.0884802 -0.863582 -0.605878 0.926641 0.972374 -0.379402
1.71808 1.04536 2.19352
0.379283 -2.13064 -0.931585 -0.788372 -0.609512 0.322437
0.949453 -1.20596 -0.262078 0.844457
0 -2.00651 -0.998354 -0.295248 2.23133 0.261471
0.502684 -3.04094 -2.12479 -0.494051 1.21585 -0.203815 1.8216
0.344689 -0.445624 0.666476 -0.50237 0.385352 0.815762
0.134605 -1.80668 0.942644 1.72921 -0.836834 -1.41662 0.858412
0.83827 0.905654 -1.33385 -0.836161 -1.24452 0.901209 -1.44432
1.23131 -0.776677 -0.261088 -1.2341 -0.655536 1.42465
-0.854312 -0.429928 0.463916 -0.382651 1.71299 -1.24453
0.48891 -0.759767 0.14689 1.25623 1.40043 -2.00651 0 1.23047
0.384148 0.844764 0.269037 -1.2927 -1.30452 0.724019
0.768757 -1.08057 1.25183 0.487862 1.94835 -0.410053 -1.42386
0.243135 0.748038 -0.724988 -0.640319 0.0544846 1.18446
-2.15566
1.09833 -0.219467 0.32081 -1.15125 -0.79123
0.285226 -2.05845 -1.93075 -1.18314 1.02277 -0.703756
1.20975 -0.759782 -0.99604 -0.623498 1.37694 -1.79285
-0.0238018 1.43412 -0.378267 -0.960863 -0.22083 -0.691819 -0.482192
0.961325 0.82761 0.296828 -0.998354 1.23047 0 0.115383 -1.05179
0.160016 -0.0157988 -0.491038 1.20276 -1.72972
0.284048 -0.535522 -2.02381 0.328405 2.19702 -0.948924
0.867223 -2.13372 1.82789 -1.06 0.492206 -0.955584
0.599034 -0.650266 -0.0877927 -2.32538 -0.103089
0.558741 -0.471694 -0.13461
1.81514 -0.253008 -0.168469 -0.241407 -0.376062 -1.25916
-0.223401 0.758495 -0.0306497 -0.936338 0.755491
0.593691 -0.202228 -0.491131 0.779118 -1.36573
0.412632 -0.0950215 1.52789 -0.692271 -0.295248 0.384148
0.115383
0 -0.338628 1.49588 0.265069 0.704663 -0.25017 0.799791 1.37742
0.227155 0.455995 0.0760841 -0.123671 0.20144 -0.782851
0.909637 -1.11598 -1.11064 -0.669436 -0.206086 0.521838
0.609015
1.27121 -0.483486 -0.560713 1.67283 0.0771008 -0.300971
0.476034 -0.86569 -1.12876 0.236904 0.729546
0.262369 -0.116326 -1.52756 -1.00669 -2.0648 -0.198018
-0.767298 1.63898 -1.53329 -0.360874 1.98564
1.08872 -0.796135 -0.963066 1.34154 2.23133
0.844764 -1.05179 -0.338628
0 -0.47785 -1.98345 -0.716504 -0.69089 -0.899613 1.2281 2.17624
0.94025 -0.0374713 -0.988093 -1.3591
0.0302844 -0.850376 -0.810823 0.14167 -1.12468
0.0365631 -2.15955 -0.184452 0.0921918 0.666384 -0.222603
1.92896 -0.0666837 -0.17373 -0.283848
0.631956 -0.743467 -0.684354 -0.00509547 0.677832 -0.247801
0.712173 -0.730314 -1.34617
0.788144 -0.0617322 -0.636127 -0.340622 1.79792
0.301628 -0.879453 1.90839 -0.527462 -0.271451 0.261471
0.269037
0.160016 1.49588 -0.47785 0 -0.422271 0.423413 1.22687
0.161787 -1.13743 -1.239 0.705347 -1.64797 -1.21451
0.470059 -0.762182 -0.517904 0.52542 0.546711 0.673102
1.1322 -0.489932 1.90207 0.0525617 0.316921
0.893195 -0.770984 -1.18093 1.09174 -0.0559018
0.141735 -0.742967 -0.5294 -0.385239 -0.128992 -0.0776633
-0.678952 -0.899731 -1.3476 0.260688 -0.444122 0.765126
0.0339848 -0.65713 0.0849024 0.601651 -1.20446 0.715203
0.498617
0.502684 -1.2927 -0.0157988 0.265069 -1.98345 -0.422271
0 -0.713547 0.731747 -0.686902 1.61019
0.0938838 -1.55371 -0.00874007 -1.43884 -0.754387 -1.34875
1.96953 -0.123768 -0.224499 1.11862 1.06578 0.222975
1.50218 -0.490204 0.326529 -0.553505 0.210714
1.09532 -0.998825 -1.73495 -0.39698 -1.30778 1.35863 -1.31026
0.871619 -1.80744 -0.211229 0.172121
1.67497 -0.43316 -0.243859 -0.164869 -1.25125 0.236184
-0.356836
1.03038 2.077 0.598665 -1.96354 -3.04094 -1.30452 -0.491038
0.704663 -0.716504 0.423413 -0.713547 0 -2.05467 0.209532
1.6131 -0.14894 0.174353 -0.947081 -1.41668 0.212296
2.07449 -0.711704 0.726697 1.70684 0.498756 0.398528 1.29873
0.831429 0.384375 -0.498152 0.868749 1.19659 0.137283 0.0022477
0.745982 -0.0805188 0.0869413 1.39117 0.936617 -1.92505 1.81757
0.662312 0.325556 0.469648 -1.04375 -1.89301 -0.847364 1.07744
0.702345 0.640573 0.2082 -1.07654 2.055 -0.0554408 -2.12479
0.724019 1.20276 -0.25017 -0.69089 1.22687 0.731747 -2.05467 0
0.665809 -0.143241 2.15584 0.0195286 2.07354 -0.0326529 -0.5434
1.049 -1.41895 0.495401 0.368575 0.109816 -0.611453
0.861704 -1.34581 -1.7188 -0.00428942 -0.418852 0.137141
-1.15078
0.447565 -0.49429 0.225244 -0.30864 1.44331 1.11465 0.265411
1.13117 1.59455 -1.67704 -1.90255 1.38165 0.265218
0.00546717 -1.76132 1.194 -0.435604 -0.253388 0.276624
0.901369 -0.290439 -0.494051 0.768757 -1.72972 0.799791
-0.899613
0.161787 -0.686902 0.209532 0.665809
0 -0.304102 -0.492377 -2.09475 1.11063 0.497789
0.432879 -0.0642775 0.243489 1.20092 0.197463 -0.172432
-1.29362
0.119213 -1.98223 -0.505406 -0.188783 -0.716322 -0.16462
1.45988 -0.00100709 -0.333455 0.954038 -1.58194 0.138315
2.28592
0.046995 -1.76556 0.491229 0.639404 1.17503 0.654828 1.18012
0.271137 0.349657 -0.0873938 -0.906891 -0.759521
0.557598 -0.55967 -0.986759 1.21585 -1.08057 0.284048 1.37742
1.2281 -1.13743 1.61019 1.6131 -0.143241 -0.304102 0 -0.529623
1.04199 0.162033 -1.32744 -0.219635 -0.603688 -1.1132 2.52915
1.10597 -0.676698 0.939154 0.174215 0.328505 0.895265
1.27212 -1.47913 -0.645383 2.16248 1.00066
0.0364773 -0.611395 -0.085409 0.851553 0.939182 1.91545
0.291526 -0.711431 0.0520135 -0.667421
0.738465 -3.59848 -0.0542792 -0.429715 1.3932
0.25104 -2.20949 -0.994002 -0.397012 0.526371 -0.203815
1.25183 -0.535522 0.227155 2.17624 -1.239 0.0938838 -0.14894
2.15584 -0.492377 -0.529623 0 0.624957
0.148953 -0.407965 -1.25029 0.642474
0.506005 -1.32642 -0.584555 -0.951932 -1.51538 -0.589766
-0.302623 -1.2758 0.861428 -0.544745 0.0993886 0.218456 0.0879198
0.942361 0.633561 0.70721
0.157939 -0.798394 -0.0039914 -1.93849 -2.69277 -0.236679
0.669387 -1.13907 0.203467 -1.62596 1.05597 -0.631486 0.697597
1.41591 1.48004 -0.660356 1.00153 1.8216 0.487862 -2.02381
0.455995 0.94025 0.705347 -1.55371 0.174353 0.0195286 -2.09475
1.04199 0.624957 0 1.12957 -0.272003 -0.56345 -0.495936
0.766532 -1.20871 -1.19523 -0.689891 0.00161975
0.619777 -2.17046 -0.151901 -0.814491 -0.867944 -0.180136
1.30823 -0.30368 -0.110778 0.435061 -0.407406 -0.960647 1.72226
0.363701 -0.417074 -0.531045 0.102738 0.0222846 0.82955
0.00916067 0.313471 -0.793749 0.420594
0.352976 -1.06154 -0.161933 0.117198 -0.481196 0.344689 1.94835
0.328405 0.0760841 -0.0374713 -1.64797 -0.00874007 -0.947081
2.07354 1.11063 0.162033 0.148953 1.12957 0
0.162842 -0.370794 -1.90573 0.0485816 -0.122397 -0.708244
0.783084 -2.08077 0.579857 -0.757381 -0.402716 0.881756
0.065927
0.827023 -0.153566 -0.175458 -1.47292 -1.13758 -1.29813
-0.637207 -1.21126 -0.0358839 0.702476 1.80294 -0.580513
1.66364 -0.270267 0.153265 -0.161188 -0.340592 0.564819
0.226006 -1.39272 -1.81227 0.788426 0.843561 -0.445624
-0.410053
2.19702 -0.123671 -0.988093 -1.21451 -1.43884 -1.41668
-0.0326529
0.497789 -1.32744 -0.407965 -0.272003 0.162842 0
0.121162 -1.12501 0.614225 -0.138487 -1.29927 1.2313
1.61881 -0.186056 -0.310918 0.430226 0.262876 0.29278 1.04353
1.12921 -0.97532 -0.897242 0.776469 0.652465 -1.49406 1.42416
0.435407 -0.65181 -0.499337 -1.59156
0.272066 -0.99764 -0.270849 -1.26574 -1.74679 1.17393 0.586916
1.38948 -0.886377 -1.40331 0.45519 0.666476 -1.42386 -0.948924
0.20144 -1.3591 0.470059 -0.754387 0.212296 -0.5434
0.432879 -0.219635 -1.25029 -0.56345 -0.370794 0.121162 0
1.73352 -1.17425 -1.14083 0.197557 0.0340227 -1.99134 -0.718987
0.334632 -1.35713 0.372636 0.175331 -1.9209 -0.0697025 0.819118
0.521509 1.0924 -0.560937 -2.24523 1.70652
0.824216 -0.346135 -0.401543 1.02582 0.422218 0.563893
0.0640352 -0.229558 1.29095 -1.26656 -0.704213 0.233454
-0.516481
0.0252286 1.85627 -0.50237 0.243135 0.867223 -0.782851
0.0302844 -0.762182 -1.34875 2.07449 1.049 -0.0642775 -0.603688
0.642474 -0.495936 -1.90573 -1.12501 1.73352 0
0.520902 -0.0342957 -0.237532 -0.759215 0.180991 1.32864
1.24021 -0.839337 -0.424122 -0.591874 0.860276 0.13919
0.72622 -0.675763 -0.431737 0.711812 -1.49733 -0.287345
-1.68966
0.672391 -1.22065 0.584149 0.55242 -0.411609
0.155932 -0.510641 -2.28053 -0.533927 1.09186 -1.47067
0.418959 -0.207434 1.87989 0.385352 0.748038 -2.13372
0.909637 -0.850376 -0.517904 1.96953 -0.711704 -1.41895
0.243489 -1.1132 0.506005 0.766532 0.0485816 0.614225 -1.17425
0.520902 0 0.232262
0.470288 -0.239594 -0.221563 -1.25075 -0.598349 -0.909813
0.996573 -0.850601 -0.299572 2.071 0.0119715 1.40863
0.194404 -0.187918 0.639121 0.44249 -0.693163 0.42275
0.443986 0.560393 0.631678 0.683688 1.68883 0.407942
0.0820134 -0.929579 -0.642013 0.0980172 0.207715
1.23007 -0.203773 0.815762 -0.724988 1.82789 -1.11598 -0.810823
0.52542 -0.123768 0.726697 0.495401 1.20092
2.52915 -1.32642 -1.20871 -0.122397 -0.138487 -1.14083
-0.0342957
0.232262 0 -0.570975 -0.846784 1.36854 0.151893 0.502027
0.0442117 0.0228273 -1.04489
0.218971 -0.697232 -0.446424 -0.502883 -0.281488
1.08292 -0.393906 0.851475 -0.0786892 -0.572455
1.41424 -0.245548 -0.344611 -0.568726 -1.14232 -0.665766
1.03547 -0.81317 0.0165595 0.199408 -0.742561 0.065937
-0.0837016
0.134605 -0.640319 -1.06 -1.11064 0.14167 0.546711 -0.224499
1.70684 0.368575 0.197463
1.10597 -0.584555 -1.19523 -0.708244 -1.29927 0.197557
-0.237532
0.470288 -0.570975 0 -1.52108
0.83346 -1.75765 -0.650782 -0.27243 0.0343448 0.997939
-0.403841
0.963221 0.921185 -0.458732 0.97033 0.479601 -0.722936 -1.40249
0.016077 -0.314103 1.01813 1.96872 0.136446
0.426232 -0.760905 -0.444301 -0.363845 2.09215 -0.156254
1.28692
0.244422 1.44468 -0.298336 -1.80668 0.0544846
0.492206 -0.669436 -1.12468 0.673102 1.11862 0.498756
0.109816 -0.172432 -0.676698 -0.951932 -0.689891 0.783084
1.2313
0.0340227 -0.759215 -0.239594 -0.846784 -1.52108
0 -0.772844 -0.996151 0.186501 -0.313234 1.52444 -0.711995
0.0247041 0.200216 1.26407 2.06716 -1.18906 -1.50903 -1.58881
0.351719 -0.568266 -0.693104
0.62142 -0.634699 -0.941352 -0.15531 1.31076 1.5627 -1.20705
0.962324 1.83767 0.218707 -1.83441 -0.773573 1.88623 0.942644
1.18446 -0.955584 -0.206086 0.0365631 1.1322 1.06578
0.398528 -0.611453 -1.29362 0.939154 -1.51538 0.00161975
-2.08077
1.61881 -1.99134 0.180991 -0.221563 1.36854 0.83346 -0.772844 0
0.853888 0.255115 -2.35495
0.391954 -0.53304 -0.758883 -0.979886 -0.16964 -1.09201
0.385287
0.794403 -0.00915915 1.2769 -1.07972 -0.816261
0.251921 -1.66988 0.171198 -0.566248 -2.23 -2.43865 -0.366488
0.385255 -1.82343 0.575726 -0.801476 -0.170689 -0.546095
1.72921 -2.15566 0.599034 0.521838 -2.15955 -0.489932 0.222975
1.29873 0.861704 0.119213 0.174215 -0.589766 0.619777
0.579857 -0.186056 -0.718987 1.32864 -1.25075
0.151893 -1.75765 -0.996151 0.853888 0 1.39532 -1.99679 -1.07347
0.108996 -0.579681 0.637183 1.26692 0.879957 -0.056056
-1.09247
1.21672 -1.00228 -0.912907 1.3617 0.596484 -0.589918 -0.251289
2.01947 -0.529138 0.321578 1.35315 -1.48317
0.223785 -0.0475188 -0.886416 -2.44306 0.857545 -0.836834
1.09833 -0.650266 0.609015 -0.184452 1.90207 1.50218
0.831429 -1.34581 -1.98223
0.328505 -0.302623 -2.17046 -0.757381 -0.310918 0.334632
1.24021 -0.598349 0.502027 -0.650782 0.186501 0.255115 1.39532 0
0.599134 -1.71436 -0.633004 1.53865 -0.741774 -1.0623 -1.15898
0.615474 0.330962 -0.753714 -1.2798 0.225871 -1.36411
1.59323 -1.15798 0.172304 -2.11372 -0.817583 -1.02519 -1.06806
0.555417 0.883354 -1.46008 -0.0435479 0.0729949
0.206834 -1.41662 -0.219467 -0.0877927 1.27121 0.0921918
0.0525617 -0.490204 0.384375 -1.7188 -0.505406
0.895265 -1.2758 -0.151901 -0.402716
0.430226 -1.35713 -0.839337 -0.909813
0.0442117 -0.27243 -0.313234 -2.35495 -1.99679 0.599134
0 -0.352288 0.501361 -0.595641 -0.0833238 -0.755425
0.855259 -1.18706 -0.564664 -0.491196 -1.41032 -0.273734
-0.696941 -1.66178 -0.412623 1.99166 -1.25541 -0.750809
0.227414 -1.0066
0.598972 -0.584634 -0.350814 -0.0629435 -0.456244 -1.63466
0.858412 0.32081 -2.32538 -0.483486 0.666384 0.316921
0.326529 -0.498152 -0.00428942 -0.188783 1.27212
0.861428 -0.814491 0.881756 0.262876 0.372636 -0.424122
0.996573
0.0228273 0.0343448 1.52444 0.391954 -1.07347 -1.71436
-0.352288
0 -1.07509 -0.982072 -1.28802 1.43986 -0.226804 0.0837412
1.14241 0.933571 0.918949 -0.132985 1.46774 -0.0943234 -1.11822
0.0789586 0.824271 -1.34916 0.398191 -0.882734 -0.71481
0.805012 -0.246196 -0.306472 0.348266 0.455984
0.83827 -1.15125 -0.103089 -0.560713 -0.222603 0.893195
-0.553505
0.868749 -0.418852 -0.716322 -1.47913 -0.544745 -0.867944
0.065927 0.29278 0.175331 -0.591874 -0.850601 -1.04489
0.997939 -0.711995 -0.53304 0.108996 -0.633004 0.501361
-1.07509
0 -1.13114 -0.948666 -0.0951046 -0.714597 -0.453202 -1.60914
-0.930854 1.4451 -0.687196 0.416965
1.49886 0.805896 -0.751269 -0.83004 0.18839 -0.819521
0.254198 -0.562258 0.00633264 0.919137 0.599403 -1.47169
0.151082
0.905654 -0.79123 0.558741 1.67283 1.92896 -0.770984 0.210714
1.19659 0.137141 -0.16462 -0.645383 0.0993886 -0.180136
0.827023
1.04353 -1.9209 0.860276 -0.299572 0.218971 -0.403841
0.0247041 -0.758883 -0.579681
1.53865 -0.595641 -0.982072 -1.13114 0
1.16261 -1.2546 -0.00346967 0.970799 1.6692 0.508715 1.81512
1.76025 -1.13722 1.1435 1.83025 0.122958 0.242372
2.1793 -0.830086 -1.4041 -0.381009
0.97417 -0.805473 -0.613855 -0.354885 0.444896 -1.33385
0.285226 -0.471694 0.0771008 -0.0666837 -1.18093 1.09532
0.137283 -1.15078 1.45988 2.16248 0.218456 1.30823 -0.153566
1.12921 -0.0697025 0.13919 2.071 -0.697232 0.963221
0.200216 -0.979886
0.637183 -0.741774 -0.0833238 -1.28802 -0.948666 1.16261 0
0.0454965 -1.85352 0.426964 0.657554 -0.394112
0.175835 -0.181805 -0.203465 -0.544768 -1.24079
1.21424 -0.467781 0.677626 -0.446544 0.807704 0.711133
0.414825 -0.941258 0.00771092 -1.95705
0.407115 -0.836161 -2.05845 -0.13461 -0.300971 -0.17373
1.09174 -0.998825 0.0022477 0.447565 -0.00100709 1.00066
0.0879198 -0.30368 -0.175458 -0.97532 0.819118 0.72622
0.0119715 -0.446424 0.921185 1.26407 -0.16964
1.26692 -1.0623 -0.755425 1.43986 -0.0951046 -1.2546 0.0454965
0 -0.269367 0.00522093 -0.94079 0.335321 -0.0984714
0.317522 -1.48634 -1.11375 1.62206 -0.144447 -0.869547 0.706835
1.1594 0.454136 2.09276 -0.656463 0.457846 -0.626734 1.14272
2.16546 -1.24452 -1.93075 1.81514
0.476034 -0.283848 -0.0559018 -1.73495
0.745982 -0.49429 -0.333455 0.0364773
0.942361 -0.110778 -1.47292 -0.897242 0.521509 -0.675763
1.40863 -0.502883 -0.458732 2.06716 -1.09201 0.879957 -1.15898
0.855259 -0.226804 -0.714597 -0.00346967 -1.85352 -0.269367 0
0.32287 0.445762 -0.321093 -0.964308 0.428307 0.111505
0.00121512 -0.767071 -0.603117 1.13022 -0.950046
0.744526 -0.0127676 0.506124 -1.07174 1.91736 0.657122
-0.398177
0.0884802 0.901209 -1.18314 -0.253008 -0.86569 0.631956
0.141735 -0.39698 -0.0805188 0.225244 0.954038 -0.611395
0.633561
0.435061 -1.13758 0.776469 1.0924 -0.431737 0.194404 -0.281488
0.97033 -1.18906 0.385287 -0.056056 0.615474 -1.18706
0.0837412 -0.453202 0.970799 0.426964 0.00522093 0.32287 0
0.383436 0.342152 1.17047 0.693166 -0.517073 -1.52129 -0.415811
1.11808 -0.132097 1.70784 -2.5864 -0.769539 0.234832 -1.30519
0.326058 -1.13202 -0.302128 -0.863582 -1.44432
1.02277 -0.168469 -1.12876 -0.743467 -0.742967 -1.30778
0.0869413 -0.30864 -1.58194 -0.085409 0.70721 -0.407406
-1.29813
0.652465 -0.560937 0.711812 -0.187918 1.08292 0.479601 -1.50903
0.794403 -1.09247 0.330962 -0.564664 1.14241 -1.60914 1.6692
0.657554 -0.94079 0.445762 0.383436
0 -0.122563 -0.422003 -2.34178 0.440658 1.63661 -1.54997
1.07639 -0.244272 -1.05193 0.936224 0.678516 1.16375 -0.441838
0.749766 1.24869 -0.810359 -0.605878 1.23131 -0.703756
-0.241407
0.236904 -0.684354 -0.5294 1.35863 1.39117 1.44331 0.138315
0.851553 0.157939 -0.960647 -0.637207 -1.49406 -2.24523
-1.49733
0.639121 -0.393906 -0.722936 -1.58881 -0.00915915
1.21672 -0.753714 -0.491196 0.933571 -0.930854 0.508715
-0.394112
0.335321 -0.321093 0.342152 -0.122563
0 -0.981776 -0.309981 -0.80819 -0.454964 -0.810296
0.157476 -0.129292 1.17071 -0.612824 -1.76917
0.0417107 -1.44999 -0.118848 0.135714 0.216162 0.926641
-0.776677
1.20975 -0.376062 0.729546 -0.00509547 -0.385239 -1.31026
0.936617 1.11465 2.28592 0.939182 -0.798394 1.72226 -1.21126
1.42416 1.70652 -0.287345 0.44249 0.851475 -1.40249 0.351719
1.2769 -1.00228 -1.2798 -1.41032 0.918949 1.4451 1.81512
0.175835 -0.0984714 -0.964308 1.17047 -0.422003 -0.981776
0 -1.31348 -0.688418
0.209286 0.526641 -2.03424 -1.2763 -0.950676 -0.543582
-0.989516 0.756733 0.107518 1.73731 0.213004 3.33306
0.972374 -0.261088 -0.759782 -1.25916 0.262369 0.677832
-0.128992
0.871619 -1.92505 0.265411 0.046995 1.91545 -0.0039914
0.363701 -0.0358839 0.435407
0.824216 -1.68966 -0.693163 -0.0786892
0.016077 -0.568266 -1.07972 -0.912907
0.225871 -0.273734 -0.132985 -0.687196 1.76025 -0.181805
0.317522
0.428307 0.693166 -2.34178 -0.309981 -1.31348 0 0.39195
0.584153 1.4933 -1.1757 -0.467369 -0.317183
1.67334 -0.341727 -0.442761 -0.416209
0.54235 -0.847911 -1.14182 -0.379402 -1.2341 -0.99604 -0.223401
-0.116326 -0.247801 -0.0776633 -1.80744 1.81757 1.13117 -1.76556
0.291526 -1.93849 -0.417074 0.702476 -0.65181 -0.346135
0.672391
0.42275 -0.572455 -0.314103 -0.693104 -0.816261
1.3617 -1.36411 -0.696941 1.46774
0.416965 -1.13722 -0.203465 -1.48634 0.111505 -0.517073
0.440658 -0.80819 -0.688418 0.39195
0 -1.41763 0.0492999 -0.384691 0.271265 0.365851 -0.833141
0.0944068 -0.789999 0.499699 0.32942 -0.104386 0.418526
1.71808 -0.655536 -0.623498 0.758495 -1.52756
0.712173 -0.678952 -0.211229 0.662312 1.59455
0.491229 -0.711431 -2.69277 -0.531045
1.80294 -0.499337 -0.401543 -1.22065 0.443986 1.41424 1.01813
0.62142 0.251921 0.596484 1.59323 -1.66178 -0.0943234 1.49886
1.1435 -0.544768 -1.11375 0.00121512 -1.52129 1.63661 -0.454964
0.209286 0.584153 -1.41763 0]

exter

unread,
Jun 3, 2007, 11:27:56 PM6/3/07
to Xpress-MP
Adding to the previous message, my file looks like: (i don't
understand by x(i) are not 0s and 1s). Thanks.

model minimization
uses "mmxprs";
uses "mmquad";
declarations
n = 1..50


x: array(n) of mpvar
matrix: array(n,n) of real
end-declarations
initializations from "t.dat"
matrix
end-initializations

forall(i in n) x(i) is_binary

minimize(sum(i,j in n) x(i)*matrix(i,j)*x(j))

writeln("Minimum energy is ",getobjval)

bobdaniel

unread,
Jun 4, 2007, 4:34:05 AM6/4/07
to Xpress-MP
I suggest you place t.dat somewhere where we can pick it up. It is no
use having just part of it.
Or zip it up and email it to people who ask.
Bob

On Jun 4, 1:40 am, exter <sejoon...@hotmail.com> wrote:
> Hello. Adding to the previous message, my matrix is a 50x50 matrix. I
> changed n in the code to n=1..50.
> my t.dat file is:
> matrix: [0 0.0146716 -0.105635 -0.0878459 0.148285
> 0.917176 0.172277 0.392689 1.13592 -0.106412 0.425937 -1.14844
> 1.04536 1.42465 1.37694 -0.0306497 -1.00669 -0.730314 -0.899731
> 0.172121 0.325556 -1.67704 0.639404 0.0520135 -0.236679
> 0.102738 -0.580513 -1.59156 1.02582 0.584149 0.560393 -0.245548
> 1.96872 -0.634699 -1.66988 -0.589918 -1.15798 -0.412623

...
> ...
>
> read more »

exter

unread,
Jun 4, 2007, 9:53:21 AM6/4/07
to Xpress-MP
Adding to the previous message. I see that the status is "QP
unsolved." I was wondering how I can fix this problem. Thank you.

exter

> > read more »- Hide quoted text -
>
> - Show quoted text -

bobdaniel

unread,
Jun 4, 2007, 1:08:49 PM6/4/07
to Xpress-MP
The Q matrix is not semi-definite, so the solver stops.
Are the data real?
Bob

exter

unread,
Jun 18, 2007, 4:46:23 PM6/18/07
to Xpress-MP
Does it mean that Q must be semi-definite for xpress-mp to work? My Q
is usually not semi-definite. Then, is there another program that does
the same minimization task? Thank you.

kleineklaus

unread,
Jun 21, 2007, 5:25:12 AM6/21/07
to Xpress-MP
I have the same problem with a MIQP.
The matrix is not semidefinite, and the solver stops after some
instants...

is there any parameter I can set to go further in the computational
process?

thnks, kleineklaus

wind

unread,
Jun 21, 2007, 5:44:50 AM6/21/07
to Xpress-MP
This doesn't concern parameter settings at all. Xpress requires the Q
matrix be PSD; otherwise, it is not convex and it won't proceed. You
need to go back to your model....
Reply all
Reply to author
Forward
0 new messages