Hi, Menal.<br><br>That's it. I was so worried about the matrix of constraints that I forgot to see the objective function. :-)<br>Now it's work well. I read a file with 48 cities (gr48.tsp -- tsplib) and the program returns the answer without troubles.<br>
Thank you.<br>Virginia S. Costa<br><br><div class="gmail_quote">2009/12/7 <span dir="ltr"><<a href="mailto:symphony-request@list.coin-or.org">symphony-request@list.coin-or.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Send Symphony mailing list submissions to<br>
<a href="mailto:symphony@list.coin-or.org">symphony@list.coin-or.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://list.coin-or.org/mailman/listinfo/symphony" target="_blank">http://list.coin-or.org/mailman/listinfo/symphony</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:symphony-request@list.coin-or.org">symphony-request@list.coin-or.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:symphony-owner@list.coin-or.org">symphony-owner@list.coin-or.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Symphony digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Problems with OsiSymSolverInterface -- loadProblem<br>
(Menal Guzelsoy)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 7 Dec 2009 00:28:46 -0500<br>
From: Menal Guzelsoy <<a href="mailto:megb@lehigh.edu">megb@lehigh.edu</a>><br>
Subject: Re: [Symphony] Problems with OsiSymSolverInterface --<br>
loadProblem<br>
To: Virginia Costa <<a href="mailto:virscosta@gmail.com">virscosta@gmail.com</a>><br>
Cc: <a href="mailto:symphony@list.coin-or.org">symphony@list.coin-or.org</a>, Nelson Maculan<br>
<<a href="mailto:nelson.maculan@gmail.com">nelson.maculan@gmail.com</a>><br>
Message-ID:<br>
<<a href="mailto:56b792680912062128g380d02feh3903c33f3d3f8d67@mail.gmail.com">56b792680912062128g380d02feh3903c33f3d3f8d67@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Virginia,<br>
<br>
Try this:<br>
<br>
wij = new double[nnz] --> wij = new double[n_cols];<br>
<br>
Menal.<br>
<br>
Menal Guzelsoy<br>
1610 4620455<br>
<br>
<br>
On Thu, Dec 3, 2009 at 6:41 PM, Virginia Costa <<a href="mailto:virscosta@gmail.com">virscosta@gmail.com</a>> wrote:<br>
<br>
> Yes,<br>
> I'm going to send you the first option, because I've found a error in the<br>
> second one.<br>
> In the package you can find some tsp files. I got solutions for gr172 (4<br>
> nodes), gr177 (7 nodes), gr179 (9 nodes) and gr1710 (10 nodes), but the<br>
> program returns a error at the end of the solution. For gr1711 and gr17, I'm<br>
> not be able to find a solution.<br>
><br>
> It returns the following error for gr177:<br>
><br>
> Starting Preprocessing...<br>
> Preprocessing finished...<br>
> bounds improved: 392<br>
> Problem has<br>
> 301 constraints<br>
> 273 variables<br>
> 1050 nonzero coefficients<br>
><br>
> Total Presolve Time: 0.001253...<br>
><br>
> Solving...<br>
><br>
> solving root lp relaxation<br>
> The LP value is: 1033.000 [0,95]<br>
><br>
><br>
> ****************************************************<br>
> * Optimal Solution Found *<br>
> * Now displaying stats and best solution found... *<br>
> ****************************************************<br>
><br>
> ======================= CP Timing ===========================<br>
> Cut Pool 0.000<br>
> ====================== LP/CG Timing =========================<br>
> LP Solution Time 0.008<br>
> LP Setup Time 0.000<br>
> Variable Fixing 0.000<br>
> Pricing 0.000<br>
> Strong Branching 0.000<br>
> Separation 0.012<br>
> Primal Heuristics 0.000<br>
> Communication 0.000<br>
> Total User Time 0.020<br>
> Total Wallclock Time 0.022<br>
><br>
> ====================== Statistics =========================<br>
> Number of created nodes : 1<br>
> Number of analyzed nodes: 1<br>
> Depth of tree: 0<br>
> Size of the tree: 1<br>
> Number of solutions found: 1<br>
> Number of solutions in pool: 1<br>
> Number of Chains: 1<br>
> Number of Diving Halts: 0<br>
> Number of cuts in cut pool: 0<br>
><br>
> ======================= LP Solver =========================<br>
> Number of times LP solver called: 4<br>
> Number of calls from feasibility pump: 0<br>
> Number of calls from strong branching: 0<br>
> Number of solutions found by LP solve: 1<br>
> Number of bounds changed by strong branching: 0<br>
> Number of nodes pruned by strong branching: 0<br>
><br>
> ==================== Feasibility Pump =====================<br>
> Number of times feasibility pump called: 0<br>
> Number of solutions found by feasibility pump: 0<br>
> Time spent in feasibility pump: 0.00<br>
><br>
> =========================== Cuts ==========================<br>
> total cuts accepted: 18<br>
> total cuts added to LPs: 9<br>
> total cuts deleted from LPs: 5<br>
> total gomory cuts generated: 0<br>
> total knapsack cuts generated: 0<br>
> total oddhole cuts generated: 0<br>
> total clique cuts generated: 0<br>
> total probing cuts generated: 0<br>
> total mir cuts generated: 0<br>
> total twomir cuts generated: 18<br>
> total flow and cover cuts generated: 0<br>
> total rounding cuts generated: 0<br>
> total lift and project cuts generated: 0<br>
> total landp cuts generated: 0<br>
><br>
> cuts removed because of bad coeffs: 9<br>
> cuts removed because of duplicacy: 0<br>
> insufficiently violated cuts: 0<br>
><br>
> cuts in root: 18<br>
> gomory cuts in root: 0<br>
> knapsack cuts in root: 0<br>
> oddhole cuts in root: 0<br>
> clique cuts in root: 0<br>
> probing cuts in root: 0<br>
> mir cuts in root: 0<br>
> twomir cuts in root: 18<br>
> flow and cover cuts in root: 0<br>
> rounding cuts in root: 0<br>
> lift and project cuts in root: 0<br>
> landp cuts in root: 0<br>
><br>
> time in cut generation: 0.01<br>
> time in gomory cuts in 3 calls: 0.00<br>
> time in knapsack cuts in 3 calls: 0.00<br>
> time in oddhole cuts in 0 calls: 0.00<br>
> time in clique cuts in 3 calls: 0.00<br>
> time in probing cuts in 3 calls: 0.00<br>
> time in mir cuts in 0 calls: 0.00<br>
> time in twomir cuts in 3 calls: 0.00<br>
> time in flow and cover cuts in 3 calls: 0.00<br>
> time in rounding cuts in 0 calls: 0.00<br>
> time in lift and project cuts in 0 calls: 0.00<br>
> time in landp cuts in 0 calls: 0.00<br>
> time in redsplit cuts in 0 calls: 0.00<br>
> time in checking quality and adding: 0.00<br>
><br>
> Solution Found: Node 0, Level 0<br>
> Solution Cost: 1346.000<br>
> +++++++++++++++++++++++++++++++++++++++++++++++++++<br>
> User indices and values of nonzeros in the solution<br>
> +++++++++++++++++++++++++++++++++++++++++++++++++++<br>
> 2 1.000<br>
> 3 1.000<br>
> 7 1.000<br>
> 9 1.000<br>
> 12 1.000<br>
> 15 1.000<br>
> 20 1.000<br>
> 23 1.000<br>
> 33 1.000<br>
> 41 1.000<br>
> 57 1.000<br>
> 75 1.000<br>
> 83 1.000<br>
> 99 1.000<br>
> 129 1.000<br>
> 149 1.000<br>
> 159 1.000<br>
> 167 1.000<br>
> 175 1.000<br>
> 183 1.000<br>
> 209 1.000<br>
> 225 1.000<br>
> 267 1.000<br>
><br>
> Solucao otima encontrada!<br>
> O valor da funcao objetivo e 1346<br>
> *** glibc detected *** ./tsp: free(): invalid pointer: 0x0000000001f04f30<br>
> ***<br>
> ======= Backtrace: =========<br>
> /lib/libc.so.6[0x7f76eed3ccb8]<br>
> /lib/libc.so.6(cfree+0x76)[0x7f76eed3f276]<br>
> ./tsp[0x401be1]<br>
> /lib/libc.so.6(__libc_start_main+0xe6)[0x7f76eece35a6]<br>
> ./tsp[0x401539]<br>
> ======= Memory map: ========<br>
> 00400000-00404000 r-xp 00000000 08:11 3932470<br>
> /home/virginia/teoiv/tsp-backup021209/tsp<br>
> 00603000-00604000 r--p 00003000 08:11 3932470<br>
> /home/virginia/teoiv/tsp-backup021209/tsp<br>
> 00604000-00605000 rw-p 00004000 08:11 3932470<br>
> /home/virginia/teoiv/tsp-backup021209/tsp<br>
> 01efb000-020da000 rw-p 01efb000 00:00 0<br>
> [heap]<br>
> 7f76e8000000-7f76e8021000 rw-p 7f76e8000000 00:00 0<br>
> 7f76e8021000-7f76ec000000 ---p 7f76e8021000 00:00 0<br>
> 7f76ee9e9000-7f76eeac3000 r-xp 00000000 08:02 164587<br>
> /usr/lib/libgfortran.so.3.0.0<br>
> 7f76eeac3000-7f76eecc2000 ---p 000da000 08:02 164587<br>
> /usr/lib/libgfortran.so.3.0.0<br>
> 7f76eecc2000-7f76eecc3000 r--p 000d9000 08:02 164587<br>
> /usr/lib/libgfortran.so.3.0.0<br>
> 7f76eecc3000-7f76eecc4000 rw-p 000da000 08:02 164587<br>
> /usr/lib/libgfortran.so.3.0.0<br>
> 7f76eecc4000-7f76eecc5000 rw-p 7f76eecc4000 00:00 0<br>
> 7f76eecc5000-7f76eee2d000 r-xp 00000000 08:02 7735<br>
> /lib/<a href="http://libc-2.9.so" target="_blank">libc-2.9.so</a><br>
> 7f76eee2d000-7f76ef02d000 ---p 00168000 08:02 7735<br>
> /lib/<a href="http://libc-2.9.so" target="_blank">libc-2.9.so</a><br>
> 7f76ef02d000-7f76ef031000 r--p 00168000 08:02 7735<br>
> /lib/<a href="http://libc-2.9.so" target="_blank">libc-2.9.so</a><br>
> 7f76ef031000-7f76ef032000 rw-p 0016c000 08:02 7735<br>
> /lib/<a href="http://libc-2.9.so" target="_blank">libc-2.9.so</a><br>
> 7f76ef032000-7f76ef037000 rw-p 7f76ef032000 00:00 0<br>
> 7f76ef037000-7f76ef04d000 r-xp 00000000 08:02 2589<br>
> /lib/libgcc_s.so.1<br>
> 7f76ef04d000-7f76ef24d000 ---p 00016000 08:02 2589<br>
> /lib/libgcc_s.so.1<br>
> 7f76ef24d000-7f76ef24e000 r--p 00016000 08:02 2589<br>
> /lib/libgcc_s.so.1<br>
> 7f76ef24e000-7f76ef24f000 rw-p 00017000 08:02 2589<br>
> /lib/libgcc_s.so.1<br>
> 7f76ef24f000-7f76ef340000 r-xp 00000000 08:02 9960<br>
> /usr/lib/libstdc++.so.6.0.10<br>
> 7f76ef340000-7f76ef540000 ---p 000f1000 08:02 9960<br>
> /usr/lib/libstdc++.so.6.0.10<br>
> 7f76ef540000-7f76ef547000 r--p 000f1000 08:02 9960<br>
> /usr/lib/libstdc++.so.6.0.10<br>
> 7f76ef547000-7f76ef549000 rw-p 000f8000 08:02 9960<br>
> /usr/lib/libstdc++.so.6.0.10<br>
> 7f76ef549000-7f76ef55c000 rw-p 7f76ef549000 00:00 0<br>
> 7f76ef55c000-7f76efd0f000 r-xp 00000000 08:02 224865<br>
> /usr/lib/atlas/libblas.so.3gf.0<br>
> 7f76efd0f000-7f76eff0e000 ---p 007b3000 08:02 224865<br>
> /usr/lib/atlas/libblas.so.3gf.0<br>
> 7f76eff0e000-7f76eff13000 r--p 007b2000 08:02 224865<br>
> /usr/lib/atlas/libblas.so.3gf.0<br>
> 7f76eff13000-7f76eff19000 rw-p 007b7000 08:02 224865<br>
> /usr/lib/atlas/libblas.so.3gf.0<br>
> 7f76eff19000-7f76f06f2000 r-xp 00000000 08:02 224866<br>
> /usr/lib/atlas/liblapack.so.3gf.0<br>
> 7f76f06f2000-7f76f08f1000 ---p 007d9000 08:02 224866<br>
> /usr/lib/atlas/liblapack.so.3gf.0<br>
> 7f76f08f1000-7f76f08f2000 r--p 007d8000 08:02 224866<br>
> /usr/lib/atlas/liblapack.so.3gf.0<br>
> 7f76f08f2000-7f76f08f6000 rw-p 007d9000 08:02 224866<br>
> /usr/lib/atlas/liblapack.so.3gf.0<br>
> 7f76f08f6000-7f76f0a04000 rw-p 7f76f08f6000 00:00 0<br>
> 7f76f0a04000-7f76f0b1a000 r-xp 00000000 08:02 445917<br>
> /opt/coin-or/build/lib/libCoinUtils.so.0.0.0<br>
> 7f76f0b1a000-7f76f0d1a000 ---p 00116000 08:02 445917<br>
> /opt/coin-or/build/lib/libCoinUtils.so.0.0.0<br>
> 7f76f0d1a000-7f76f0d1c000 r--p 00116000 08:02 445917<br>
> /opt/coin-or/build/lib/libCoinUtils.so.0.0.0<br>
> 7f76f0d1c000-7f76f0d1e000 rw-p 00118000 08:02 445917<br>
> /opt/coin-or/build/lib/libCoinUtils.so.0.0.0<br>
> 7f76f0d1e000-7f76f0d70000 r-xp 00000000 08:02 446084<br>
> /opt/cCancelado<br>
> virginia@virginia-pc:~/teoiv/tsp-backup021209$<br>
><br>
> Thanks a lot for the answer.<br>
> Virginia.<br>
><br>
> 2009/12/3 Menal Guzelsoy <<a href="mailto:megb@lehigh.edu">megb@lehigh.edu</a>><br>
><br>
> Virginia,<br>
>><br>
>> Could you send me a sample code to reproduce the problem?<br>
>><br>
>> Menal.<br>
>><br>
>> Menal Guzelsoy<br>
>> 1610 4620455<br>
>><br>
>><br>
>> On Thu, Dec 3, 2009 at 1:08 PM, Virginia Costa <<a href="mailto:virscosta@gmail.com">virscosta@gmail.com</a>>wrote:<br>
>><br>
>>> Hi,<br>
>>><br>
>>> I'm a new user of Coin-or and I want to run a mixed integer problem with<br>
>>> Symphony. However, I have a lot of problems with method loadProblem:<br>
>>><br>
>>> 1) I used virtual void OsiSymSolverInterface::loadProblem ( const<br>
>>> CoinPackedMatrix<<a href="http://www.coin-or.org/Doxygen/Osi/class_coin_packed_matrix.html" target="_blank">http://www.coin-or.org/Doxygen/Osi/class_coin_packed_matrix.html</a>>&<br>
>>> *matrix*,<br>
>>><br>
>>> const double * *collb*,<br>
>>><br>
>>> const double * *colub*,<br>
>>><br>
>>> const double * *obj*,<br>
>>><br>
>>> const double * *rowlb*,<br>
>>><br>
>>> const double * *rowub*<br>
>>> )<br>
>>><br>
>>> I gave a CoinPackedMatrix to this function and everything works well, but<br>
>>> when I try to run a problem with more than 10 cities (it's a tsp<br>
>>> implementation),<br>
>>> This matrix returns a memory error.<br>
>>><br>
>>> 2) So, I tried to use<br>
>>> virtual void OsiSymSolverInterface::loadProblem ( const int *numcols*,<br>
>>><br>
>>> const int *numrows*,<br>
>>><br>
>>> const CoinBigIndex<<a href="http://www.coin-or.org/Doxygen/Osi/_coin_finite_8hpp.html#1d91e832494d1d012e44c52e34d2340f" target="_blank">http://www.coin-or.org/Doxygen/Osi/_coin_finite_8hpp.html#1d91e832494d1d012e44c52e34d2340f</a>>*<br>
>>> *start*,<br>
>>><br>
>>> const int * *index*,<br>
>>><br>
>>> const double * *value*,<br>
>>><br>
>>> const double * *collb*,<br>
>>><br>
>>> const double * *colub*,<br>
>>><br>
>>> const double * *obj*,<br>
>>><br>
>>> const double * *rowlb*,<br>
>>><br>
>>> const double * *rowub*<br>
>>> )<br>
>>><br>
>>><br>
>>> Where, I think, we have to pass the matrix in a CCS format (Compressed<br>
>>> Column Storage --<br>
>>> <a href="http://www.cs.utk.edu/%7Edongarra/etemplates/node374.html" target="_blank">http://www.cs.utk.edu/~dongarra/etemplates/node374.html</a><<a href="http://www.cs.utk.edu/%7Edongarra/etemplates/node374.html" target="_blank">http://www.cs.utk.edu/%7Edongarra/etemplates/node374.html</a>>).<br>
>>> But it returns the following error: terminate called after throwing an<br>
>>> instance of 'CoinError'. This error was returned when I try to run a problem<br>
>>> that was solved by the loadProblem above.<br>
>>><br>
>>> Has anybody already seen these errors before?<br>
>>><br>
>>> Could somebody help me please?<br>
>>><br>
>>> Thanks.<br>
>>> Virginia S. Costa<br>
>>> --<br>
>>> Programa de Engenharia de Sistemas e Computa??o<br>
>>> PESC/COPPE/UFRJ -- Rio de Janeiro/Brasil<br>
>>> Visite nossa p?gina web (<a href="http://www.cos.ufrj.br" target="_blank">http://www.cos.ufrj.br</a>)<br>
>>><br>
>>> _______________________________________________<br>
>>> Symphony mailing list<br>
>>> <a href="mailto:Symphony@list.coin-or.org">Symphony@list.coin-or.org</a><br>
>>> <a href="http://list.coin-or.org/mailman/listinfo/symphony" target="_blank">http://list.coin-or.org/mailman/listinfo/symphony</a><br>
>>><br>
>>><br>
>><br>
><br>
><br>
> --<br>
> Programa de Engenharia de Sistemas e Computa??o<br>
> PESC/COPPE/UFRJ<br>
> Visite nossa p?gina web (<a href="http://www.cos.ufrj.br" target="_blank">http://www.cos.ufrj.br</a>)<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://list.coin-or.org/pipermail/symphony/attachments/20091207/bd0395b0/attachment.html" target="_blank">http://list.coin-or.org/pipermail/symphony/attachments/20091207/bd0395b0/attachment.html</a><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Symphony mailing list<br>
<a href="mailto:Symphony@list.coin-or.org">Symphony@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/symphony" target="_blank">http://list.coin-or.org/mailman/listinfo/symphony</a><br>
<br>
<br>
End of Symphony Digest, Vol 54, Issue 3<br>
***************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>Programa de Engenharia de Sistemas e Computação<br>PESC/COPPE/UFRJ<br>Visite nossa página web (<a href="http://www.cos.ufrj.br">http://www.cos.ufrj.br</a>)<br>