Re: [Help-glpk] the theoretic formula about the integrality gap for MILP and 0-1 knapsack integer programing model
Hello David, see https://en.wikibooks.org/wiki/GLPK/Known_issues#MIP_gap_reporting Best regards Heinrich Schuchardt -Ursprüngliche Nachricht- Gesendet: Donnerstag, 03 Dezember 2015 um 06:10:20 Uhr Von: "usa usa"An: help-glpk@gnu.org Betreff: [Help-glpk] the theoretic formula about the integrality gap for MILP and 0-1 knapsack integer programing model Hi, I would like to find the theoretic formula about the integrality gap for 1. Mixed integer linear programing model and its linear programming relaxation 2. 0-1 knapsack integer programing model and its linear programming relaxation Sometimes the gao may be called relative error or approximation ratio. I would like to see the formula that express the gap mathematically. Any help would be appreciated. Best Regards, David ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Help-glpk Digest, Vol 128, Issue 12
Hello Faiza install.packages(Rglpk) should be what you are looking for. Best regards Heinrich Schuchardt http://www.xypron.de Am 27.07.13 um 12:59 schrieb Faiza Hamdi bonjour j'ai installée la dernière version de R et qui est R version 3.0.1 (2013-05-16) et quand je voudrais télécharger une fonction j'utilise install.packages(ici j’écris le nom de la fonction) il y a certaines fonctions ça marche et il n y'a pas des problèmes, alors que lorsque je mis: install.packages(Rglpk_solve_LP) il m'a dit Warning message: package ‘Rglpk_solve_LP’ is not available (for R version 3.0.1) je sais pas quel est le problème je suis coincée a ce niveau là, prière de me guider. merci pour votre Cordialement De : Heinrich Schuchardt xypron.g...@gmx.de À : Faiza Hamdi faiza_i...@yahoo.fr Cc : Help Glpk help-glpk@gnu.org Envoyé le : Lundi 22 juillet 2013 18h59 Objet : Re: [Help-glpk] Help-glpk Digest, Vol 128, Issue 12 Bonjour Faiza, le projet R se trouve sur http://www.r-project.org/ La version actuelle est R3.0.1. Tu y trouve les liens pur le télécharegement comme http://cran.univ-lyon1.fr/ Si tu as des problèmes avec l'Anglais veuilles essayer http://www.google.com/translate?hl=ensl=entl=fru=http%3A%2F%2Fwww.r-project.org%2F http://www.google.com/translate?hl=enie=UTF8sl=entl=fru=http%3A%2F%2Fcran.univ-lyon1.fr%2F Cordialement Heinrich Schuchardt On 22.07.2013 14:12, Faiza Hamdi wrote: Merci pour votre réponse est ce que vous pouvez me donner un lien qui me permet de télécharger une version de R la plus récente sachant que j'ai la version R version 2.15.3 (2013-03-01) . Merci pour votre réponse Cordialement faiza hamdi ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] glpk multiple solutions from solver
Hello Chris, you may need to switch off the presolver. Best regards Heinrich Schuchardt http://www.xypron.de Am 28.06.13 um 08:05 schrieb chris On Sat, Jun 15, 2013 at 9:57 PM, Michael Hennebry henne...@web.cs.ndsu.nodak.edu wrote: On Thu, 13 Jun 2013, chia jia wei wrote: On Wed, Jun 12, 2013 at 7:31 PM, Raniere Silva ra092...@ime.unicamp.br** wrote: In the case of solving the problem using glp_simplex, is there any way to retrieve the solution in between iterations? AFAIK, using glp_simplex it isn't possible. Take a look in chapter 4 Advanced API Routines of the manual to some functions that can do that. Raniere Do you have any simple example to illustrate the possibility of using the advanced routines to achieve retrieving of multiple solutions? Look up callbacks. -- Michael henne...@web.cs.ndsu.nodak.edu On Monday, I'm gonna have to tell my kindergarten class, whom I teach not to run with scissors, that my fiance ran me through with a broadsword. -- Lily Thanks for the advice. I've tried to use the simplex algo to obtain an optimal basis. Then, I made attached the callback listener, implemented printout of solution at GLP_IBINGO, and used glp_intopt but i seem to be getting solutions that do not relate to the original problem data. Regards, chris ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: GMPL table stmt]
IM014:1:0:[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application You are trying to use a 32bit DSN from a 64 bit executable or vice versa. Make sure the bitness of the used components matches. Best regards Heinrich Schuchardt http://www.xypron.de Am 28.06.13 um 00:47 schrieb Andrew Makhorin Forwarded Message From: technical forestry services tech.forestry.servi...@gmail.com To: bug-g...@gnu.org Subject: GMPL table stmt Date: Fri, 28 Jun 2013 10:06:35 +1200 Hello I have been trying to get GMPL to read an SQLite3 database using the following syntax. set I ; set J ; set S dimen 2; param c{i in I, j in J} ; param d{i in I, j in J} ; # table statement creates indexed parameters c[i, j] and d[i, j] # and set S comprising (string) indices (i, j) table tbl IN iODBC 'DSN=SQLite3 Datasource' 'SELECT id, srce, dest, dist, cost ' 'FROM Ytij': S - [srce, dest], d~dist, c~cost ; data ; set I := Seattle San-Diego ; set J := New-York Chicago Topeka ; end ; There seems to be an issue with the table statement in that the code will compile OK and by adding GMPL printf and display statements will correctly list the database contents during the compile phase. However during any Build phase I get the following error message: Reading tbl... Failed to connect The driver reported the following diagnostics whilst running SQLDriverConnect IM014:1:0:[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application Test_glpk_sqlite3.mod:27: error on opening table tbl MathProg model processing error Exit code: 1Time: 0.228 I have tried a couple of SQLite-ODBC drivers without success: 1) sqliteodbc.exe available at www.ch-werner.de/sqliteodbc (installs with (System) DSN=SQLite3 Datasource). 2)sqlite odbc driver as part of SQLite2009 Pro Enterprise Manager (installs with (System) DSN=DSN_SQLite2010Pro). SQLite2009 Pro Manager is available at www.sqlite.org/cvstrac/wiki?p=ManagementTools . Changing the driver has no effect as the same error is reported during the Build phase. I attach the database that I attempted to read from. If you can shed any light on the issue I would be extremely grateful. If you require further information don't hesitate to make contact. Would you please acknowledge receipt of this E-mail. Regards LRB ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] MathProg model processing error
Hello Robin, you cannot have and in a constraint. Use two constraints. Best regards Heinrich Schuchardt http://www.xypron.de Am 28.06.13 um 03:24 schrieb robin hankin hello, v4.51, macosx 10.8.3 Please help me, I have a problem and have boiled it down to the following .mod file which exibits the error I am struggling with: wt118:~/Dropbox/glpk/alice_puzzle% wt118:~/Dropbox/glpk/alice_puzzle% cat doesnotwork.mod var x1, integer; var x2, integer; var x3, integer; s.t. ss: (x1 = x2) and (x2 = x3); solve; end; wt118:~/Dropbox/glpk/alice_puzzle% glpsol -m doesnotwork.mod GLPSOL: GLPK LP/MIP Solver, v4.51 Parameter(s) specified in the command line: -m doesnotwork.mod Reading model section from doesnotwork.mod... doesnotwork.mod:5: operand preceding = has invalid type Context: ...er ; var x2 , integer ; var x3 , integer ; s.t. ss : ( x1 = MathProg model processing error wt118:~/Dropbox/glpk/alice_puzzle% what is wrong with my doesnotwork.mod file? What is wrong with my 'ss' constraint? thanks in advance -- Robin Hankin Uncertainty Analyst hankin.ro...@gmail.com ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Get a feasible solution with glpsol
Hello Esma, start glpsol with --tmlim. Or if using the library, call glp_ios_terminate in the callback routine. Best regards Heinrich Schuchardt http://www.xypron.de Am 19.06.13 um 10:11 schrieb Mehiaoui Hello everybody, Is it possible To stop the glpsol solver before terminating and get the best solution (a feasible solution not the optimal one ) found so far ? Thank you Esma ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] glpk Limitation? Or what is the problem
Hello John, error C005 is a memory access violation. Best regards Heinrich Schuchardt http://www.xypron.de Am 19.06.13 um 11:28 schrieb john tass Good morning, I am trying to solve a large LP problem and I start my code (in C++) using the following lines. int C = 30; int H = 30; int R = 6; glp_prob *lp; int ia[1 + C*H*R + C*R], ja[1 + C*H*R + C*R]; double ar[1 + C*H*R + C*R], z; coutBasic matrices of LP problem are defined\n; lp = glp_create_prob(); coutlp problem created\n; glp_set_prob_name(lp, sample); coutName of lp problem defined\n; glp_set_obj_dir(lp, GLP_MIN); coutDirection of lp problem defined\n; But something is wrong and I can not realize what it is. The program interrupt as soon as it gets at line 9 (coutBasic matrices of LP problem are defined\n;) which is executed fine. The problem occurs at the next line 10 (lp = glp_create_prob();) and the program returns an error code like 3221225477. Is the problem related to the size of LP problem? Thanks for helping me Ioannis Tassopoulos ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Need help running GLPK code in Ubuntu server]
Hello Kazi, glpk-4.50/src/glpk.h has no constyant LPX_LP. You obviously use a GLPK for Java built against an older include file. Check directory /usr/include. Best regards Heinrich Schuchardt http://www.xypron.de Am 09.06.13 um 21:54 schrieb Kazi Moyeen ul Huq Hi, What is this Timer-0 error ? Thanks Kazi. ~/application/state-optimizer$ java -Djava.library.path=/usr/local/lib/jni/ -classpath /usr/local/share/java/glpk-java.jar -jar st.jar Problem created ...test_MPC3 *Exception in thread Timer-0 java.lang.UnsatisfiedLinkError: org.gnu.glpk.GLPKJNI.LPX_LP_get()I* at org.gnu.glpk.GLPKJNI.LPX_LP_get(Native Method) at org.gnu.glpk.GLPKConstants.clinit(GLPKConstants.java:122) at org.totalgrid.reef.examples.stateoptimizer.DESDAlgorithm.optimize(DESDAlgorithm.java:145) at org.totalgrid.reef.examples.stateoptimizer.StateOptimizerManager$1.run(StateOptimizerManager.java:65) at java.util.TimerThread.mainLoop(Timer.java:534) at java.util.TimerThread.run(Timer.java:484) -Kazi On Sun, Jun 9, 2013 at 9:46 AM, Heinrich Schuchardt xypron.g...@gmx.dewrote: On 09.06.2013 15:33, Kazi Moyeen ul Huq wrote: java -Djava.library.path=/usr/lib/**jni -jar st.jar Hello Kazi, the default installation path for GLPK and GLPK for Java is /usr/local If you did not configure with --prefix the command line to execute you jar file should be java -Djava.library.path=/usr/**local/lib/jni \ -classpath /usr/local/share/java/glpk-**java.jar -jar st.jar Best regards Heinrich Schuchardt ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Need help running GLPK code in Ubuntu server]
Hello Kazi GLPK for Java looks in /usr/include and /usr/local/include for glpk.h. Best regards Heinrich Schuchardt http://www.xypron.de Am 10.06.13 um 13:42 schrieb Kazi Moyeen ul Huq Hi, Should usr/include contain a copy of glpk.h ? I don't have one. Should I copy the glpk.h to usr/include or should I install another time ? I installed glpk4.50 in the home directory. But, glpsol --version shows GLPSOL: GLPK LP/MIP Solver, v4.50 -Kazi On Mon, Jun 10, 2013 at 3:26 AM, xypron.g...@gmx.de wrote: Hello Kazi, glpk-4.50/src/glpk.h has no constyant LPX_LP. You obviously use a GLPK for Java built against an older include file. Check directory /usr/include. Best regards Heinrich Schuchardt http://www.xypron.de Am 09.06.13 um 21:54 schrieb Kazi Moyeen ul Huq Hi, What is this Timer-0 error ? Thanks Kazi. ~/application/state-optimizer$ java -Djava.library.path=/usr/local/lib/jni/ -classpath /usr/local/share/java/glpk-java.jar -jar st.jar Problem created ...test_MPC3 *Exception in thread Timer-0 java.lang.UnsatisfiedLinkError: org.gnu.glpk.GLPKJNI.LPX_LP_get()I* at org.gnu.glpk.GLPKJNI.LPX_LP_get(Native Method) at org.gnu.glpk.GLPKConstants.clinit(GLPKConstants.java:122) at org.totalgrid.reef.examples.stateoptimizer.DESDAlgorithm.optimize(DESDAlgorithm.java:145) at org.totalgrid.reef.examples.stateoptimizer.StateOptimizerManager$1.run(StateOptimizerManager.java:65) at java.util.TimerThread.mainLoop(Timer.java:534) at java.util.TimerThread.run(Timer.java:484) -Kazi On Sun, Jun 9, 2013 at 9:46 AM, Heinrich Schuchardt xypron.g...@gmx.de wrote: On 09.06.2013 15:33, Kazi Moyeen ul Huq wrote: java -Djava.library.path=/usr/lib/**jni -jar st.jar Hello Kazi, the default installation path for GLPK and GLPK for Java is /usr/local If you did not configure with --prefix the command line to execute you jar file should be java -Djava.library.path=/usr/**local/lib/jni \ -classpath /usr/local/share/java/glpk-**java.jar -jar st.jar Best regards Heinrich Schuchardt ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Need help running GLPK code in Ubuntu server]
Hello Kazi, GLPK can also be build without GMP. Try package libgmp3-dev. Best regards Heinrich Schuchardt http://www.xypron.de Am 08.06.13 um 19:55 schrieb Kazi Moyeen ul Huq Hi, I tried to install the dependencies. Looks like the library libgmp-dev isn't available for the lucid suite. http://packages.ubuntu.com/search?keywords=libgmp-dev . I installed all the other build-depends: debhelper, cdbs, libltdl-dev, zlib1g-dev, libiodbc2-dev, libmysqlclient-dev, automake, autoconf, libtool. libgmp-dev gave me the error msg -- E: Couldn't find package libgmp-dev. Is there any work-around to that ? I'll try to install it from the other suites ( precise) but I get a feeling from previous experience that the server denies to install. Thanks. Kazi On Fri, Jun 7, 2013 at 3:34 PM, Heinrich Schuchardt xypron.g...@gmx.dewrote: Hello Kazi, When I used sudo apt-get install libglpk-java , the server installs libglpk-java: 1.0.1-1.1. Then when I tried to run my program ( also You seem to be on an outdated version of Ubuntu (lucid). The current version is Ubuntu 12.04 LTS (Precise Pangolin). I suggest you uninstall GLPK and GLPK for Java on your Ubuntu server. sudo apt-get remove libglpk0 libglpk-dev sudo apt-get autoremove Install the build-depends: debhelper, cdbs, libgmp-dev, libltdl-dev, zlib1g-dev, libiodbc2-dev, libmysqlclient-dev, automake, autoconf, libtool Then build GLPK and GLPK for Java from source as described on http://glpk-java.sourceforge.**net/gettingStarted.htmlhttp://glpk-java.sourceforge.net/gettingStarted.html When you want to install with iODBC use this configure line for GLPK: configure --enable-dl --enable-odbc --enable-mysql --with-gmp If you prefer UnixODBC you will need unixodbc-dev instead of libiodbc2-dev, and may use this configuration line for GLPK: configure --enable-dl --enable-odbc=unix --enable-mysql --with-gmp Best regards Heinrich Schuchardt On 07.06.2013 16:41, Andrew Makhorin wrote: Forwarded Message From: Kazi Moyeen ul Huq To: help-glpk@gnu.org Subject: Need help running GLPK code in Ubuntu server Date: Fri, 7 Jun 2013 08:41:41 -0400 Hi, I wrote a GLPK program in Windows-Java using the current vesrion of GLPK-java (1.0.28). It works well in windows. Now, I have to port it to a Ubuntu server. I'm an intermediate level Ubuntu user. When I used sudo apt-get install libglpk-java , the server installs libglpk-java: 1.0.1-1.1. Then when I tried to run my program ( also the test program given in the glpk examples ) it gives the the message : A. for lp = GLPK.glp_create_prob(); Exception in thread main java.lang.**UnsatisfiedLinkError: org.gnu.glpk.GLPKJNI.glp_**create_prob()J at org.gnu.glpk.GLPKJNI.glp_**create_prob(Native Method) B. forSystem.out.println(GLPK.glp_**version()); Exception in thread main java.lang.**UnsatisfiedLinkError: org.gnu.glpk.GLPKJNI.glp_**version()Ljava/lang/String; Please suggest me what I should do next to make my program run in the installed 1.0.1-1.1 version in server.( any modification required ? ) Thanks in advance, Moyeen ==**=== for further information, I also tried these: A. I tried to change the repository and install the 1.0.18-1 from http://us.archive.ubuntu.com/**ubuntu/http://us.archive.ubuntu.com/ubuntu/precise/universe amd64 Packages instead of current lucid/universe amd64 Packages but the server fails to install it. It says some dependencies can't be installed. B. similar thing happens when I tried to manually install by using ./configure then I received an error - configure: error: glpk.h not found The detail error message is attached. ==**= __**_ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/**listinfo/help-glpkhttps://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
[Help-glpk] GLPK for Windows 4.50, GLPK for Java 1.0.28
GLPK for Java 1.0.28 has been released. It is available from http://glpk-java.sourceforge.net GLPK for Windows 4.50 has been released. It is available from http://winglpk.sourceforge.net It includes 32bit and 64bit Windows executables of GLPK 4.50 and GLPK for Java 1.0.28. Best regards Heinrich Schuchardt -- View this message in context: http://old.nabble.com/GLPK-for-Windows-4.50%2C-GLPK-for-Java-1.0.28-tp35570815p35570815.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Installing glpk-java under mac os x
Hello, please, provide the complete output of make. Please, comment this line in swig/Makefile.in using #: #@HAVEMVN_TRUE@ $(MVN) clean package site Then run ./configure make make check Do you still get an error? If you are using Maven for your project, please, see http://glpk-java.sourceforge.net/index.html#Maven Best regards Heinrich Schuchardt dirichlet-2 wrote: Hi everyone, I do not know if this is the proper place to ask for help, but I'm trying to install GLPK under OS X Lion (10.7) I've installed GLPK version 4.50, then installed swig (I had to install Perl PCREV for it but it went fine), but I'm getting some errors when trying to install glpk-java from the source code, during the make command: [ERROR] /Users/valerio/Desktop/cutimizer/cutimizer/lib/libglpk-java-1.0.27/swig/src/main/java/org/gnu/glpk/LPXKKT.java:[205,11] cannot find symbol [ERROR] symbol : method LPXKKT_cs_ae_max_set(long,org.gnu.glpk.LPXKKT,double) [ERROR] location: class org.gnu.glpk.GLPKJNI [ERROR] - [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException make[2]: *** [all] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 I get many errors like this, it appears that it cannot find the glpkjni interface, even though I configured it using the options specified in on the guide: ./configure \ CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers \ SWIGFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers what am I missing? -- View this message in context: http://old.nabble.com/Installing-glpk-java-under-mac-os-x-tp35568224p35570886.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Problem Table OUT GLPK Excel
Bonjour Julien, please, read http://support.microsoft.com/kb/178717 cite The driver will not support DELETE, UPDATE, or ALTER TABLE statements. While it is possible to update values, DELETE statements will not remove a row from a table based on an Excel spreadsheet. These operations are not supported. Basically, you can only append (insert) to a table. /cite Cordialement Heinrich Schuchardt julien lecoq wrote: Hi everybody, I started with GLPK and I have a problem with Excel. First, here is my test program : set P; /*Définition de l'ensemble P*/param B {p in P}; /*Définition du paramètre B dans l'ensemble P*/param C {p in P}; /*Définition du paramètre C dans l'ensemble P*/ table Test1 IN 'ODBC' /*Définition de la table d'importation Test1 (qui peut avoir n'importe quel nom)*/ 'DRIVER={Microsoft Excel Driver (*.xls)};dbq=.\Test.xlsx' /*Appel du driver Excel*/ 'SELECT * FROM [Test1$]': /*Sélection de la feuille du fichier Excel*/P - [Produit], B, C; /*Définition des paramètre à importer d'Excel*/ var D {p in P}; /*Définition de la variable D dans l'ensemble P*/var E {p in P}; /*Définition de la variable E dans l'ensemble P*/ s.t. c1 {p in P} : D[p] = B[p]; /*Contrainte pour recopier le paramètre B dans la variable D*/s.t. c2 {p in P} : E[p] = C[p]; /*Contrainte pour recopier le paramètre C dans la variable E*/ solve; /*Appel du solver*/ table Test2 {p in P} OUT ODBC /*Définition de la table d'exportation Test1 (qui peut avoir n'importe quel nom)*/ 'DRIVER={Microsoft Excel Driver (*.xls)};READONLY=FALSE; dbq=.\Test.xlsx' /*Appel du driver Excel*/ /*Le . de .\Test.xlsx signifie que le fichier Excel est dans le même dossier que le fichier GLPK*/ 'UPDATE [Test2$] set D = ;' /*Mise à jour de l'ensemble de la variable D de la feuille Test2*/ 'UPDATE [Test2$] set E = ;' /*Mise à jour de l'ensemble de la variable E de la feuille Test2*/ 'INSERT INTO [Test2$]' /*Insertion dans la feuille Test2*/ '(D,E)' /*Appel des variables à modifier*/ 'VALUES(?,?);': /*Nombre de valeurs à exporter, autant que de ?*/ D[p], E[p]; /*Définition des valeurs à exporter*/ end; /*Déclaration de fin de programme*/ It works fine but the table OUT makes a new lines in Excel everytimes I compile the program. I already tried DELETE FROM and WHERE .=. but I think I didn't write well. Sorry for my English ... and thank you in advance. Regards,Loustic100 ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk -- View this message in context: http://old.nabble.com/Problem-Table-OUT-GLPK-Excel-tp35565374p35570920.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] MathProg time functions
Dear João, GMPL provides time functions as described in the accompanying documentation of GLPK 4.49. What functionality are you missing? Best regards Heinrich Schuchardt http://www.xypron.de Am 08.05.13 um 16:02 schrieb João Flávio de Freitas Almeida Andrew, On AMPL we have ctime() and _solve_time to display current time and solver time respectively. As a suggestion, MathProg could have both functions also. Bests, João Flávio de Freitas Almeida ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] forall and exists?
Hello Andrew, GLPK is a linear programming solver. A constraint with an IF would not be linear. In linear programming you might introduce binary variables for your purpose. Or use a constraint programming solver. Best regards Heinrich Schuchardt http://www.xypron.de Am 07.05.13 um 07:48 schrieb Jay Hutfles Oh, I don't think there's anything wrong with them. Well, except for how I'm trying to use them. I see that the examples only use them in computable parameters, though. I was trying to use them in constraints, and was getting errors along the lines of forall function does not exist (sorry, I don't have the exact error with me). The constraints were of the form: for all a in A, if x[a] =1 then there exists a b in B such that (something or another based on a) I was having trouble directly implementing constraints of this form, so I changed the if p then q form to not p or q like this: subject to C {a in A} : (1 - x[a]) + (if exists {b in B} (...something or other based on a..) then 1 else 0) = 1; I'll have to try again in the morning when I'm more awake. Thanks for the guidance, Andrew. On Mon, May 6, 2013 at 11:36 PM, Andrew Makhorin m...@gnu.org wrote: Can you provide a link to an example of each? Any help would be appreciated. Please see glpk/examples/color.mod (for 'exists') and glpk/examples/egypt.mod (for 'forall'). What is wrong with these operators? ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] GLPK for Java - problem - exception thrown for glp_find_col
Hello Andrew The documentation leaves it unmentioned that the index is updated when a new column or row is added after calling glp_create_index. On adding/removing named rows/columns the index is updated (if exists). Kindly add this information to the glp_create_index documentation. Otherwise a user might think he has to create a new index after a structural change of the problem. Best regards Heinrich Schuchardt http://www.xypron.de Am 02.05.13 um 13:48 schrieb Andrew Makhorin please, update the documentation to clearly point out that an error is thrown in glp_find_col and glp_find row if not preceded by a call to glp_create_index. Okay, I will add a paragraph to clarify the issue. Wouldn't it be a good idea to let these functions implicitly call glp_create_index, if the index is missing? I don't think so. It would be a sort of obscure feature, when the program does something that it shouldn't do (if the feature is disabled), and the user doesn't know about that. The documentation leaves it unmentioned that the index is updated when a new column or row is added after calling glp_create_index. On adding/removing named rows/columns the index is updated (if exists). Why is the index not always created when creating a new problem? The overhead of the index seems to be negligible. This feature is optional, because in most cases the name index is not needed. If necessary, the user may easily enable this feature by a call to glp_create_index immediately after glp_create_prob. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Fwd: Crash running the RELAX-IV algorithm
Hello Sylvain, Do you think there is a way to catch this kind of errors in the Java http://www.cs.princeton.edu/~appel/papers/safejni.pdf describes how the problem might be attacked. But it seems that SafeJNI has not been developed any further. At least I could not find any download. Best regards Heinrich Schuchardt http://www.xypron.de Am 26.04.13 um 15:34 schrieb Sylvain Fournier Hello Heinrich, Do you think there is a way to catch this kind of errors in the Java wrapper in order to prevent the VM from crashing, or is this exception handling linked to the C code? I also noted that even if the new RELAX-IV algorithm is running without any error in Java, a GLPK constant may be missing: it would be GLPKConstants.GLP_JAVA_A_RC (the last parameter in the call to glp_mincost_relax4). Without this constant, I am using GLP_JAVA_V_PI but I am not sure it is a stable workaround. Regards, -- *Sylvain Fournier* Analista de Pesquisa Operacional *48 3239-2423* WPLEX Software Ltda. Rod SC 401 no. 8600 Corporate Park bloco 5 sala 101 88050-000 Santo Antônio de Lisboa, Florianópolis SC +55 48 3239-2400 wplex.com.br [image: WPLEX] -- Forwarded message -- From: Sylvain Fournier sylv...@wplex.com.br Date: 2013/4/25 Subject: Crash running the RELAX-IV algorithm To: help-glpk@gnu.org Hello, I tried to run the new min cost flow algorithm (RELAX-IV) on a problem I have using glpk-java, and the java VM crashes (it doesn't catch the error) while the algorithm is processing. Using a regular C program, it also crashes: *** glibc detected *** ./run-relax4: free(): invalid next size (normal): 0x01cfb220 *** It seems to be a memory issue but I am not a C specialist. I attach my problem in the dimacs format. The same problem runs without any problem using the old okalg, and I tried to run RELAX-IV on the sample.min example given in the graph documentation, which also works. Please let me know if I am doing something wrong. Regards, -- *Sylvain Fournier* Analista de Pesquisa Operacional *48 3239-2423* WPLEX Software Ltda. Rod SC 401 no. 8600 Corporate Park bloco 5 sala 101 88050-000 Santo Antônio de Lisboa, Florianópolis SC +55 48 3239-2400 wplex.com.br [image: WPLEX] ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
[Help-glpk] GLPK for Windows 4.49, GLPK for Java 1.0.25
GLPK for Java 1.0.25 has been released. It is available from http://glpk-java.sourceforge.net GLPK for Windows 4.49 has been released. It is available from http://winglpk.sourceforge.net It includes 32bit and 64bit Windows executables of GLPK 4.49 and GLPK for Java 1.0.25. Best regards Heinrich Schuchardt -- View this message in context: http://old.nabble.com/GLPK-for-Windows-4.49%2C-GLPK-for-Java-1.0.25-tp35303327p35303327.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] ELF Library
Hello Giorgio Giorgio Sartor wrote: However I successfully compiled the GLPK library in the server. Using --prefix=PATH with configure I was able to tell GLPK where to put my libraries. now use export LD_LIBRARY_PATH=PATH to make the library available. See http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80 Best regards Heinrich Schuchardt -- View this message in context: http://old.nabble.com/ELF-Library-tp35277407p35280167.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Bug-glpk] glpk never terminates computation
Hello Anton, LPX_K_MIPGAP are you using the current version of GLPK: 4.48? Best regards Heinrich Am 25.02.13 um 10:42 schrieb Anton Dimster Hi I am using glpk to solve a MIP problem, I am using the python binding provided by cvxopt.glpk. I have the following problem: I recently tried to solve a binary linear program, this is usually done quite rapidly, however the process is still running after 36 hours. I then tried set the LPX_K_MIPGAP to a higher level (0.06) and can see that in few seconds the search terminates, the message is RELATIVE MIP GAP TOLERANCE REACHED; SEARCH TERMINATED but the process never ends! and there is no way to access the solution. What can be the reason? I can only use glpk via python interface, so I do not know if there is a way to provide useful information/logs to solve this problem. Thanks for any hints. Anton ___ Bug-glpk mailing list bug-g...@gnu.org https://lists.gnu.org/mailman/listinfo/bug-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Performance decrease with more powerful computer
Hello Patrik did you use a single thread benchmark? Best regards Heinrich Gesendet mit der kostenlosen GMX iPhone App Am 01.02.13 um 16:49 schrieb Patrik Dufresne Hi Reginald, Here are the hardware specs i'm comparing. System 1 Windows XP SP2 Intel Core i5 650 @ 3.20GHz 4 MB Cache 3GiB DDR3 1066/1333 CPU mark (according to cpubenchmark.net) : 3154 Total computation time : 331 sec System 2 Windows XP SP2, Windows 7 64bits, Debian 64bits Core i7 CPU M 620 @ 2.67GHz 4M Cache 4GiB DDR3 1066 CPU mark (according to cpubenchmark.net) : 2718 Total computation time : 114 secs System 3 Windows XP SP2, Debian 64bits *Core 2 Duo CPU E6550 @ 2.33GHz **4 MB** Cache L2 *4GiB DDR2 800 CPU mark (according to cpubenchmark.net) : 1493 Total computation time : 172 secs I didn't run the benchmark on the computer it self, but the different between the number is big enough to expect better performance from System no 1 then System no 3. The total computation time of the problem on different platform for the same computer are almost identical. (less then 0.5 sec different). It's safe to assume the platform doesn't have any impact on the performance. I'm using GLPK 4.47 on every platform. On Linux, I did compile it from source with default flags. For Windows, I pick the pre-compiled version provided by winglpk project. To solve the problem, I need to run GLPK multiple time sequentially. I may provide dump of every instance of the problem. Patrik Dufresne On Fri, Feb 1, 2013 at 10:23 AM, Reginald Beardsley pulask...@yahoo.comwrote: Could you provide a few details? System configurations you're comparing? GLPK version? Compile time options specified? There are a huge number of possibilities. Why do you think the computer is more powerful? Reg --- On *Fri, 2/1/13, Patrik Dufresne ikus...@gmail.com* wrote: From: Patrik Dufresne ikus...@gmail.com Subject: [Help-glpk] Performance decrease with more powerful computer To: GLPK help help-glpk@gnu.org Date: Friday, February 1, 2013, 8:56 AM Hi, I'm using GLPK in one project and the time taken to compute is longer on a more powerful computer. Does it make any sense to you ? I don't have any clues about how to debug it. I would really appreciate tips to diagnose the problem. Patrik Dufresne -Inline Attachment Follows- ___ Help-glpk mailing list Help-glpk@gnu.org http://mc/compose?to=Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] java glpk
Hello David, passing zero elements to the matrix only impairs the performance and not the result of the optimization. Best regards Heinrich Schuchardt Gesendet mit der kostenlosen GMX iPhone App Am 22.01.13 um 18:53 schrieb David Gabriel Hi, Thanks a lot for your continous support. I read in the documentation that is possible to pass 0 element to matrix. It will be easier for me to insert 0 in my matrix because I am writing my Linear problem dynamically (I set the parameters in java program) basing on inputs which always change . So I want to know if I keep these 0, my program will be wrong ? Thanks you. 2013/1/15 Heinrich Schuchardt xypron.g...@gmx.de Hello David, keep care of the indexes used (e.g. calling GLPK.glp_set_col_kind). No need to pass zero elements of matrix. Memory assigned should be deleted. Integer problems are solved with glp_intopt. Cheers Heinrich package com.mycompany.mavenproject1; import org.gnu.glpk.GLPK; import org.gnu.glpk.GLPKConstants; import org.gnu.glpk.GlpkException; import org.gnu.glpk.glp_iocp; import org.gnu.glpk.glp_prob; import org.gnu.glpk.SWIGTYPE_p_int; import org.gnu.glpk.SWIGTYPE_p_double; /** * Hello world! * */ public class App { public static void main(String[] args) { /* * Minimize z = 0.5 x1 + 3 x2 + 2 x3 + 10 x4 * Subject to * x1, x2, x3, x4 = 0 * x1, x2, x3, x4 are integers * x1 + 0.7 x2 = 4 //c1 * x3 + 2 x2 = 3 //c2 * x4 + 2x1 = 4 //c3 */ glp_prob lp; glp_iocp iocp; SWIGTYPE_p_int ind; SWIGTYPE_p_double val; int ret; try { // Create problem lp = GLPK.glp_create_prob(); System.out.println(Problem created); GLPK.glp_set_prob_name(lp, myProblem); // Define columns GLPK.glp_add_cols(lp, 4); GLPK.glp_set_col_name(lp, 1, x1); GLPK.glp_set_col_kind(lp, 1, GLPKConstants.GLP_IV); GLPK.glp_set_col_bnds(lp, 1, GLPKConstants.GLP_LO, 0, 0); GLPK.glp_set_col_name(lp, 2, x2); GLPK.glp_set_col_kind(lp, 2, GLPKConstants.GLP_IV); GLPK.glp_set_col_bnds(lp, 2, GLPKConstants.GLP_LO, 0, 0); GLPK.glp_set_col_name(lp, 3, x3); GLPK.glp_set_col_kind(lp, 3, GLPKConstants.GLP_IV); GLPK.glp_set_col_bnds(lp, 3, GLPKConstants.GLP_LO, 0, 0); GLPK.glp_set_col_name(lp, 4, x4); GLPK.glp_set_col_kind(lp, 4, GLPKConstants.GLP_IV); GLPK.glp_set_col_bnds(lp, 4, GLPKConstants.GLP_LO, 0, 0); // Create constraints GLPK.glp_add_rows(lp, 3); //x1 + 0.7 x2 = 4 //c1 GLPK.glp_set_row_name(lp, 1, c1); GLPK.glp_set_row_bnds(lp, 1, GLPKConstants.GLP_FX, 4, 4); //@TODO use correct length ind = GLPK.new_intArray(3); val = GLPK.new_doubleArray(3); GLPK.intArray_setitem(ind, 1, 1); GLPK.doubleArray_setitem(val, 1, 1.0); GLPK.intArray_setitem(ind, 2, 2); GLPK.doubleArray_setitem(val, 2, 0.7); GLPK.glp_set_mat_row(lp, 1, 2, ind, val); // x3 + 2 x2 = 3 //c2 GLPK.glp_set_row_name(lp, 2, c2); GLPK.glp_set_row_bnds(lp, 2, GLPKConstants.GLP_LO, 3, 0); GLPK.intArray_setitem(ind, 1, 2); GLPK.doubleArray_setitem(val, 1, 2);//x2 GLPK.intArray_setitem(ind, 2, 3); GLPK.doubleArray_setitem(val, 2, 1);//x3 GLPK.glp_set_mat_row(lp, 2, 2, ind, val); //x4 + 2x1 = 4 //c3 GLPK.glp_set_row_name(lp, 3, c3); GLPK.glp_set_row_bnds(lp, 3, GLPKConstants.GLP_LO, 4, 0); GLPK.intArray_setitem(ind, 1, 1); GLPK.doubleArray_setitem(val, 2, 1);//x4 GLPK.intArray_setitem(ind, 2, 4); GLPK.doubleArray_setitem(val, 1, 2);//x1 GLPK.glp_set_mat_row(lp, 3, 2, ind, val); // delete Arrays after usage GLPK.delete_doubleArray(val); GLPK.delete_intArray(ind); // Define objective //Minimize z = 0.5 x1 + 3 x2 + 2 x3 + 10 x4 GLPK.glp_set_obj_name(lp, z); GLPK.glp_set_obj_dir(lp, GLPKConstants.GLP_MIN); GLPK.glp_set_obj_coef(lp, 0, 0); GLPK.glp_set_obj_coef(lp, 1, .5); GLPK.glp_set_obj_coef(lp, 2, 3); GLPK.glp_set_obj_coef(lp, 3, 2); GLPK.glp_set_obj_coef(lp, 4, 10); // Solve model // solve model iocp =
Re: [Help-glpk] [Fwd: GNU Program]
Hello Ali, you forgot the data; statement. Best regards Heinrich Am 18.01.13 um 19:48 schrieb Andrew Makhorin Forwarded Message From: Ali Raza rizvisa...@gmail.com To: help-glpk@gnu.org Subject: GNU Program Date: Tue, 15 Jan 2013 17:44:24 -0500 I have a quick question. I am trying to write a simple program in GNU software. I am having difficities and it is giving me errors. I have not used this program before and I would like to know if there is some help that is avaialable in guiding me to write the correct code. Would you please take a look at my code and let me know what am i doing wrong. Thanks var x = 0; var y = 0; param j = x; param k = y; param l := 7.25 ; var x{1..n} integer; var y{1..m} integer; minimize obj: {(x/y) / (l)}; param j : a b c d e f g h a 336 367 408 307 460 452 154 257 b 410 469 481 260 242 462 168 168 c 206 164 85 406 378 17 432 293 d 21 79 427 360 219 310 23 344 e 23 263 128 392 126 370 331 392 f 353 467 2 365 318 37 17 337 g 475 179 275 30 346 392 55 178 h 489 65 107 174 343 367 459 39 param k : a 54 b 25 c 36 d 56 e 41 f 45 g 26 h 14 ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Re: Help: How to build MIP model]
Hello Matteo, you are right that the GLPK API has some complexity, which a beginner may want to avoid. The following C++ library tries to make creating the LP matrix entries easier: http://sourceforge.net/projects/iajaarh/ More elaborate wrappers for GLPK may be found here: Python: http://pymprog.sourceforge.net/tutorial.html#a-dive-in-example Java: http://javailp.sourceforge.net/ http://www.xypron.de/projects/linopt/ Best regards Heinrich Schuchardt On 04.01.2013 20:31, Andrew Makhorin wrote: Forwarded Message From: Matteo Fischetti DEIm.fische...@gmail.com Subject: Re: [Help-glpk] Help: How to build MIP model Date: Fri, 04 Jan 2013 15:43:34 +0100 Hi Andrew. to easy writing a MIP model (in Cplex) using C, I wrote the trivial functions below www.dei.unipd.it/~fisch/easy_lp.c I do not know if you have something similar in GLPK, other than MathProg of course, that could help beginners to write models with 1-index variables (for 2-index var.s similar functions can be written) Take care --Matteo-- ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Linking error in AIX 6.1 for glpk 4.47
On 30.12.2012 15:43, Souvik Sutradhar wrote: ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_create_prob ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_set_prob_name ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_add_rows ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_add_cols ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_set_row_bnds ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_set_col_name Hello Souvik, all symbols you are missing are deprecated. Please, refer to the manual in glpk-4.47/doc/glpk.pdf. You should be using glp_create_prob instead of glp_lpx_create_prob, glp_set_prob_name instead of glp_lpx_set_prob_name, etc. Best regards Heinrich Schuchardt ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Linking error in AIX 6.1 for glpk 4.47
Hello Souvik, when going through the default installation sequence you will not have to define any library path for the compiler. For gcc you would simply add a parameter -lglpk to include the dynamic load library (libglpk.so). How did you install GLPK? Did you run: ./configure make sudo make install sudo ldconfig Which compiler do you use (e.g. IBM XL C/C++ for AIX)? What is the command line you used to compile and link your C++ program? Best regards Heinrich Schuchardt On 29.12.2012 19:30, Souvik Sutradhar wrote: Hi I am trying to run a c++ program in IBM AIX 6.1, which is using glpk 4.47. The same program is running on SOLARIS, Linux and HP-UX platform. But when I am trying to run the program on AIX, compilation is successful but at the time of linking it is giveing the following error ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_create_prob ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_set_prob_name ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_add_rows ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_add_cols ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_set_row_bnds ld: 0711-317 ERROR: Undefined symbol: ._glp_lpx_set_col_name I have included the library path of glpk and the libglpk.a library in link command. Thanks Regards, Souvik Sutradhar Senior Software Engineer | Service Group PS Srijan Tech Park, 4th Floor, DN-52, Salt Lake Sector V, Kolkata-700091, India. T : +91-33-40134880 | M : +91-9836987928 E : souvik.sutrad...@ushacomm.com | W : www.ushacomm.com | Time Zone: GMT +5:30 The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Optimization and Multicore GLPK
complex code I've ever looked at in 20+ years of working on several million lines of scientific codes. Fortunately, it's also hands down the best written large code I've ever seen which is a real delight. Any optimization work on a code as sophisticated as GLPK is a major undertaking which will take a long time to execute. The first step is profiling and coverage analysis. If there is sufficient interest in this subject, I propose to implement and document performance profiling and coverage analysis of GLPK in the wikibook using the various Netlib problem sets. This will be for convenience restricted to the *nix environment. However, it should generally be applicable to Windows if a *nix environment package such as Cygwin is used. I am particularly interested in comments from Andrew, Marc, Robbie and xypron. All have been very generous to me in different ways and this is an attempt to repay them. I come from a seismic processing background where run times are measured in tens of thousands of hours for a single dataset. Fortunately, most seismic codes are trivially parallel. So a few hundred quad core nodes and a couple of weeks will get the job done. Were that not the case, oil would be a lot more expensive than it is. But we still do a lot of work to make the codes run faster. Have Fun! Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
[Help-glpk] Tuning gcc compiled code with -mfpmath=both
When compiling GLPK with GCC on a x86 architecture a performance gain of 20 % can be gained by compiling with option -mfpmath=both. This requires SSE to be enabled. This is default for the x86-64 compiler. For the 32bit compiler SSE has to be enabled by either of -march=cpu-type, -msse, or -msse2. -mfpmath=both allows both the FPU and the SSE registers to be used. See http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/i386-and-x86_002d64-Options.html Hence I would compile GLPK with: export CFLAGS=-march=native -O3 -pipe -mfpmath=both ./configure --enable-dl --enable-mysql --enable-odbc make -j8 make check sudo make install ldconfig -march=native implies that the code may not be used on different CPUs. -pipe reduces compile time by using pipes instead of files -j8 reduces compile time by parallelization Best regards Heinrich Schuchardt ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Multithreading/parallelization
Hello Harley, think of a multi threaded application that has multiple LPs to be solved at once. Let one of the threads hit xerror or xassert. If you stick to only one environment you will not be able to use the error hook function to gracefully terminate this one thread. You will be forced to abort the whole application. It is a different story if you only want to use multiple threads within the MIP solver. In that case you might be able to stick to one environment. Best regards Heinrich Schuchardt Original-Nachricht Datum: Sat, 15 Dec 2012 20:05:43 +1100 Betreff: Re: [Help-glpk] Multithreading/parallelization Thanks for the comments. Your point is very true about the environment structures as my item 2 was meant to cover all of the data structures. However, I hadn't realised that this step was a lot larger than I had anticipated and there many dependent routines that also needed to be changed. I have only been basing my initial assessment on what needed to be done on the many discussions over the past few years. I havent engaged in any detailed assessment of the code yet. Is it necessary to have multiple structures or could a single environment structure be used with controlled access to the single structure through the use of mutexes when accessed from multiple threads? I may be missing something fundamental here. Also, I certainly definitely agree that for the code to move forward, we do need to do this work. I shall gather any further comments and put together a more detailed work plan. Harley On Sat, Dec 15, 2012, at 17:31, glpk xypron wrote: Hello Harley, GLPK not being threadsafe is hindering integration into other tools as well as reducing solution speed for MIP problems. The issue has been recurring for many years, and obviously is an issue for enough users to deserve being fixed. In your mail you indicated some necessary work steps. I see the following additional work: Currently GLPK has one environment structure which holds all memory references and which is destroyed in case of an error. To make GLPK thread safe it is necessary to have separate environment structures for each instance of a the GLPK problem object (glp_prob). This has implications on several API functions, e.g. glp_free_env, glp_error_hook, glp_malloc. Furthermore all functions calling xerror or xassert will be affected. The effort needed is considerable and hence I appreciate your idea to develop a solution in a community working environment. Before starting I would be interested to hear about Andrew's vision for GLPK. Best regards Heinrich Schuchardt ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Multithreading/parallelization
Hello Harley, you are right that multiple processes may run GLPK at the same time. But many applications like Apache or Tomcat are multi threaded. So maybe you would like to create a webservice offering route optimization by solving a TSP. You wouldn't be able to do so with the current GLPK because Apache has multiple threads per worker process, and you definitely do not want to shut down Apache if one of the TSPs has a problem because a user of your webservice came up with some strange input. Best regards Heinrich Schuchardt Original-Nachricht Datum: Sun, 16 Dec 2012 00:43:26 +1100 Betreff: Re: [Help-glpk] Multithreading/parallelization In the case of multiple LPs couldn't you just use the existing single threaded version and run separate instances of the application as I know members of this list already do? What is being gained by running this case with one instance of the application. I am just trying to understand the different scenarios that need to be considered and I suspect that it will take a bit of time to understand all of the different use cases for multi threaded execution. Harley ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Multithreading/parallelization
Hello Reg, A possible solution of particular interest is making each of the non-reentrant items an array indexed by thread number. I won't know if that's possible until I read the code, but it might yield a very elegant solution. Other possibilities will suggest themselves in due course once I understand the internal structure. On Linux pthread_t is of type unsigned long long (0 .. 2^32-1). On my 1GB Debian system /proc/sys/kernel/threads-max = 15849 but the thread id often has higher values. threads-max may be 70 depending on memory size. On Windows the number of concurrent threads can be greater than 5. So a simple array indexed by thread number will probably not be a viable choice. Best regards Heinrich Schuchardt Original-Nachricht Datum: Sat, 15 Dec 2012 06:57:42 -0800 (PST) Von: Reginald Beardsley pulask...@yahoo.com An: glpk help-glpk@gnu.org Betreff: Re: [Help-glpk] Multithreading/parallelization While we wait to hear from Andrew, I made a quick assessment. glpk is under 100k lines w/ under 600 static declarations in the src directory. I did not look in the w32 w64 directories. I consider that large, but comfortable. Particularly when I take into account the high quality of the code. I've found myself the sole support for much larger codes that were poorly written by many hands. Relative to past experience such as porting 500k lines of FORTRAN from VMS to Unix, this looks pretty simple. I've also dealt w/ running old non-reentrant FORTRAN codes in a large seismic processing system by loading and unloading named COMMON in a wrapper so the FORTRAN codes did not require modification. I don't have any experience w/ threads per se, but that's a minor detail relative to a project like this. If Andrew is amenable to an attempt to make glpk multithreaded, I'll print the source and start reading code. That will take some time, but it may save a lot of effort. In particular I want to study the possible options for doing this w/ minimum effort. The fact that the code is the work of a single, disciplined hand offers the possibility of this being rather less work than if many people had worked on it. A possible solution of particular interest is making each of the non-reentrant items an array indexed by thread number. I won't know if that's possible until I read the code, but it might yield a very elegant solution. Other possibilities will suggest themselves in due course once I understand the internal structure. For many years I supported the Seismic Unix package from the Center for Wave Phenomena at the Colorado School of Mines. It's 360k+ lines w/ 400+ programs written by many hands using key=value parameter input. A continual problem w/ that package was the lack of any error checking for typos. I had made an experiment at fixing the problem, but never implemented it because it would have taken several months to modify all the programs in the package. Then one day much later I woke up w/ an important insight into the calling structure of the package and did the entire job in under two hours from start to finish. Now unrecognized command line parameters are reported to the user, avoiding the user discovering the error after a long run when looking at the results. In general, Harley's proposal seems to me the way to go. That way if we get into trouble, it's easy to back up and start over. If my idea about indexing by thread is viable, we'd actually just do the whole package in one go. I'd like to keep the number of people working on this as small as practical. 2-3 is pretty much ideal, but certainly no more than 5. However, the most important consideration is a good fit w/ Andrew's intentions and desires. I wouldn't expect him to accept something like this until he'd seen it, but I don't want to start if he has a fundamental objection to the project. Have Fun! Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Multithreading/parallelization
Hello Robbie, The new C standard, C11, supports multithreading natively: have a look at http://sourceware.org/git/?p=glibc.git There is no threads.h in the head version of the glibc library. So GCC will not be able to support this feature. Best regards Heinrich Schuchardt ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] glpk.js
Hello Henri, your project sounds very interesting to me. I saw that you translated part of the GLPK library to javascript. Did you do so manually or with some machine translation tool? Proper error handling with the GLPK library requires a hook function. How are errors handled in your javascript version? The MIP solver provides a callback hook. Does this also exist in your library? What is the significance of files grunt.js and package.json? How would I use your library in a new project? In README.md you write something about browser and server installation. What is the overall architecture? Where will the library run - on the server or in the browser? Maybe you want to add an article on http://en.wikibooks.org/wiki/GLPK Best regards Xypron Original-Nachricht Datum: Mon, 10 Dec 2012 18:11:01 +0100 Von: Henri Gourvest hgourv...@gmail.com An: help-glpk@gnu.org Betreff: [Help-glpk] glpk.js Hi, I just started a new project to run glpk in a webbrowser in pure javascript. https://github.com/hgourvest/glpk.js actually I have LP/MIP solver running and the CPLEX parser regards ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Indexing a subset from 1..n
Hello Joel, param nPeriods := 12; set Periods, default{1.. nPeriods}; # let even period be open param FacilityOpen{p in Periods}, binary := if p mod 2 == 0 then 1 else 0; set OpenPeriods:= setof{p in Periods: FacilityOpen[p] = 1}(p); param nOpen := card(OpenPeriods); set NOpen := {1..nOpen}; # beware this will take n^2 time param pOpen{n in NOpen} := sum{p in OpenPeriods : n ==card(setof{i in OpenPeriods: i =p }i) } p; display pOpen; end; Best regards Xypron Original-Nachricht Datum: Wed, 28 Nov 2012 08:15:46 +1100 Betreff: [Help-glpk] Indexing a subset from 1..n Hello all, I have a set of Periods from which I create the subset OpenPeriods when the facility is open. param nPeriods;set Periods, default{1.. nPeriods};param FacilityOpen{p in Periods}, binary;set OpenPeriods:= setof{p in Periods: FacilityOpen[p] = 1} (p); The facility is not open during all periods and I have a constraint that considers the configuration of the facility the previous time it was open. So I am trying to index the set of OpenPeriods from 1...card(OpenPeriods) rather than with p but so far without any luck. Any help would be much appreciated. Thanks, Joel ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] MIP Solvers (i.e CBC, CPLEX, GLPK, GUROBI, LPSOLVE, SCIPC, SCIPL, SCIPS and XPRESS) Benchmark
Hello Noli, you are right that the GMPL interpreter has a value on its own. Cf. http://en.wikibooks.org/wiki/GLPK/Mixing_GLPK_with_other_solver_packages Unfortunately the interfaces between GLPK-GMPL and other solvers tend to be one time efforts without further maintenance. Best regards Xypron Original-Nachricht Datum: Sun, 18 Nov 2012 17:53:38 +1100 Betreff: [Help-glpk] MIP Solvers (i.e CBC, CPLEX, GLPK, GUROBI, LPSOLVE, SCIPC, SCIPL, SCIPS and XPRESS) Benchmark Hi, Have you seen this latest Mixed Integer Linear Programming Benchmark (MIPLIB2010) by Hans Mittelmann? # 3 Nov 2012 === Mixed Integer Linear Programming Benchmark (MIPLIB2010) === H. Mittelmann (mittelm...@asu.edu) # http://plato.asu.edu/ftp/milpc.html http://plato.asu.edu/bench.html I wonder why GLPK is not scoring high in this benchmarking. GLPK is actually quite fast / reasonable in solving my MIP models in Mac OS X (64 bit, 8 Gb, quad-core CPU, 2.4 Ghz) -- Macbookpro retina - base model. CBC is not bad in this benchmarkiing. https://projects.coin-or.org/Cbc CBC is trying to use MathProg (GMPL) according to this posting (below), it is able to read MathProg / GMPL models but not reading back the results. https://projects.coin-or.org/Cbc/ticket/108 It would be nice to have an alternative MIP solver for MathProg. Thanks. Noli ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] A MathProg question
Hello Reg, sum{i in I} w[i] is a linear function of w[i]. max{i in I} w[i] is not a linear function of w[i]. GLPK can only solve linear problems. You can still solve your problem as follows: var w{i in I}; var obj; minimize err: obj; s.t. c{i in I} obj = w[i]; Best regards Xypron Original-Nachricht Datum: Tue, 13 Nov 2012 05:54:03 -0800 (PST) Betreff: [Help-glpk] A MathProg question Why is: minimize err : sum{i in I} w[i]; acceptable, but: minimize err : max{i in I} w[i]; is not? I can get the desired result by following example cf12b.mod, but I'm puzzled why glpsol 4.47 emits an error. From reading the manual, I'd expect that any of the iterated operators would be linguistically interchangeable w/ sum. Thanks, Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: adding constraints incrementally]
Dear Alreva, your mail had to be forwarded manually because you are not subscribed to the GLPK help list, cf. https://lists.gnu.org/mailman/listinfo/help-glpk The source distribution of GLPK is available at ftp://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz In glpk-4.47/doc/glpk.pdf read the following chapters: 5.4 The cut pool routines 5.1.1 Using the callback routine Best regards Xypron On 09.11.2012 10:48, Andrew Makhorin wrote: Forwarded Message To: Help-glpk@gnu.org Subject: [Help-glpk] adding constraints incrementally Date: Fri, 9 Nov 2012 00:57:10 -0800 (PST) Dear all, I have a LP problem with a huge number of constraints which are saved into a large file. The problem is that I can't load this file into memory to use the constraints. I was thinking about using the cutting plane method in GLPK to solve the problem. However, I don't know whether it is possible to add constraints incrementally as cutting planes to a problem object, and perhaps remove some of them ? Bests, Alreva ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: .run file equivalent in GLPK?]
Hello Reg, the following wiki pages are covering the same set of themes: http://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg http://en.wikibooks.org/wiki/GLPK/Gnuplot http://en.wikibooks.org/wiki/GLPK/Scalable_Vector_Graphics May be you want to share your experiences here. Best regards Xypron Original-Nachricht Datum: Sun, 4 Nov 2012 09:57:25 -0800 (PST) Betreff: Re: [Help-glpk] [Fwd: .run file equivalent in GLPK?] FWIW I do a lot of the sort of thing Robbie described. I have the basic model in a GMPL file w/ the data in a separate file. I run a program that reads the raw data from several files to generate the GMPL data file. I found that this worked much better than trying to read 2D 3D arrays from .csv files. It looks approximately like this: #!/bin/sh LIST=`/bin/ls data ` for I in ${LIST} do myprog_1 data/${I} job/${I} glpsol -m job.mod -d job/${I} -o out/${I} myprog_2 out/${I} plot/${I} done In a *nix commandline environment (Solaris, BSD, Linux, MacOS X Cygwin), the shell and awk can easily automate many tasks. So no matter what you're using, this is a viable solution. I know a number of people who use Cygwin on Windows in preference to Linux because they have other software that is not available on Linux. All the others have this available by default. Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] order restrictions
Hello Robin, I have a MIP, very similar to the sudoku.mod example in the examples/ directory. MIP optimzers are not fast solvers for constraint programming problems. To choose the variable glpsol uses the Tomlin-Driebeek heuristic by default, cf. http://opim.wharton.upenn.edu/~guignard/916_2011/papers_to_read/Driebeck_1966_MSc.pdf and * Tomlin J.A. Branch and bound methods for integer and non-convex * programming, in J.Abadie (ed.), Integer and Nonlinear Programming, * North-Holland, Amsterdam, pp. 437-50 (1970). You can influence the branching variable if you use GLPK library and provide a callback function. See gpk-4.47/doc/glpk.pdf Best regards Xypron Original-Nachricht Datum: Thu, 1 Nov 2012 11:20:24 +1300 Von: robin hankin hankin.ro...@gmail.com An: help-glpk@gnu.org Betreff: [Help-glpk] order restrictions hello. I have a MIP, very similar to the sudoku.mod example in the examples/ directory. It's a 3D binary array. Let's say I have three restrictions, A, B, and C. A is satisfied 70% of the time and it takes a long long time to evaluate. B is very similar to A but is satisfied 80% of the time. C is satisfied 0.0001% of the time and is very very quick. A human would ignore A and B, and concentrate on C. When he found a proposed solution that satisfies C, he would then check A and B (and if either of these is not satisfied he would go back to trawling through C).' How do I tell glpsol this information about the best order to evaluate A/B/C? Or does it know? -- Robin Hankin Uncertainty Analyst hankin.ro...@gmail.com ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
[Help-glpk] Tomlin-Driebeek heuristic
Hello Andrew, in GLPK you are refer to an author Driebeck. In https://www.xypron.de/webdav/Heinrich/Literature/Linear_Programming/Branching/Driebeck_1966_MSc.pdf I find the author to be Norman J. Driebeek. @Article{RePEc:inm:ormnsc:v:12:y:1966:i:7:p:576-587, author={Norman J. Driebeek}, title={An Algorithm for the Solution of Mixed Integer Programming Problems}, journal={Management Science}, year=1966, volume={12}, number={7}, pages={576-587}, month={March}, } Could you, please check the spelling both in the coding and in the documentation. Best regards Xypron ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Tomlin-Driebeek heuristic
The URL to the article is: http://opim.wharton.upenn.edu/~guignard/916_2011/papers_to_read/Driebeck_1966_MSc.pdf Original-Nachricht Datum: Thu, 01 Nov 2012 07:54:35 +0100 Von: glpk xypron xypron.g...@gmx.de An: Help Glpk help-glpk@gnu.org Betreff: [Help-glpk] Tomlin-Driebeek heuristic Hello Andrew, in GLPK you are refer to an author Driebeck. In https://www.xypron.de/webdav/Heinrich/Literature/Linear_Programming/Branching/Driebeck_1966_MSc.pdf I find the author to be Norman J. Driebeek. @Article{RePEc:inm:ormnsc:v:12:y:1966:i:7:p:576-587, author={Norman J. Driebeek}, title={An Algorithm for the Solution of Mixed Integer Programming Problems}, journal={Management Science}, year=1966, volume={12}, number={7}, pages={576-587}, month={March}, } Could you, please check the spelling both in the coding and in the documentation. Best regards Xypron ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Read Excel data into subscripted set]
Hello, is there also a way to read two key columns, where the first consists of elements of a set (let's call them element e1 from set S1) and fill a subscripted set with the elements of the second column The following solution will need O(n^2) time, where n is the number of table lines: set T, dimen 2; set S1 := setof{(x,y) in T}x; set S2{x in S1} := setof{(x,y) in T}y; table t IN CSV test.csv : T - [x,y]; display S2; end; test.csv has the following content: x,y x1,y1 x1,y2 x3,y3 x4,y4 Best regards Xypron ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] libglpk-java
Hello Halim, one reason for the behaviour you describe could be running multiple threads calling GLPK. GLPK is not thread safe. Is your application single threaded? glp_error_hook error message Do you mean GlpkException? How do you handle exceptions? Could you, please, provide: - version of GLPK for Java - version of Cent OS - version of Java runtime - an example showing the problem It is sufficient, if you send the example code to me (not the list). Best regards Xypron Original-Nachricht Datum: Sun, 28 Oct 2012 18:04:25 + Betreff: [Help-glpk] libglpk-java Hello all, I would like to know if there are folks happy with the libglpk-java llibrary binding. I am now going through java system calls to C, with the C code calling the libglpk C library. The interface is via input and output files, which has worked very well, but I am looking for a full java solution (to avoid the file read/write). On linux CentOS, libglpk-java has been unreliable. For the same problem, I get the right solution at times, a glp_error_hook error message at times, and no exception handling message at all at other times. Several of us have built the library from source on different machines, with the same overall experience. Any success story with this library in the linux environment? Thanks a bunch. Rgds, halim ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Read Excel data into subscripted set]
Hello Christian, your mail had to be forwarded manually because you are not subscribed to the GLPK help list. See https://lists.gnu.org/mailman/listinfo/help-glpk Two dimensional tables cannot be read by GMPL. Organize your data in columns: NUTR, FOOD, amt Vitamin C, Hamburger, 0 Water, Wine, 0.93 glpk-4.47/doc/gmpl.pdf provides the syntax. GLPK for Windows has example files in glpk-4.47/examples/sql. Best regards Xypron On 26.10.2012 15:27, Andrew Makhorin wrote: Forwarded Message Subject: Read Excel data into subscripted set Date: Fri, 26 Oct 2012 14:46:44 +0200 Hi, I have troubles with reading a 2-dimensional table in MS Excel and putting the data into a subscripted set. In a first step, I try to read a 2-dimensional table and fill its data into a 2-dimensional parameter. The example from the AMPL book pp.196-197 (can be found online: http://www.ampl.com/BOOK/CHAPTERS/13-tables.pdf) describes exactly this situation. It uses the diet problem to demonstrate, how the parameter amt (param amt {NUTR,FOOD} = 0) can be read from MS Excel by table dietAmts IN ODBX DIET2D.xls: [i ~ NUTR], {j in FOOD} amt[i,j] ~ (j); Since the database connection in GMPL looks a little bit different, I adopted my working command for reading in the data of a 1-dimensional MS Excel table to the 2-dimensional case like that: table dietAmts IN 'ODBC' 'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};dbq=.\test.xlsx' 'SELECT * FROM [Tabelle2$]' : [i ~ NUTR], {j in FOOD} amt[i,j] ~ (j); Putting everything together in one model file (why the table definition needs to be before the data part, I still do not understand..), Gusek gives me an error message: syntax error in field list Context: , FOOD } = 0 ; table dietAmts IN '...' '...' '...' : [ i ~ MathProg model processing error I would appreciate every help! Regards, Christian ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] 200Mb of Tables - xmalloc error
Hello Andrew, for 0; csv needs only two bytes. A double in C needs 8 bytes. Add pointers in linked lists, memory for building the constraints in GMPL, memory for the model in the GLPK library, and so forth. Yes reading the model into GMPL will need a whole lot more memory than your CSV file. GLPK runs fine on 64bit. So you might just try on a bigger machine. Given 200 Mb of raw data you may have to write a program that directly calls the GLPK library. If you do not like C, there is a good choice of language bindings available, see http://en.wikibooks.org/wiki/GLPK Best regards Xypron On 22.10.2012 21:49, Andrew B. Martin wrote: Hello, I'm running a Windows XP 32bit with 1.95 Gb of RAM. I'm am trying to build a model using .csv files, but am running out of memory (see xmalloc error below). What is confusing me is that the combined size of the .csv files is no more than 200 Mb; when I hit Ctrl+Alt+Del and watch memory consumption in the 'performance' window CPU Usage does not crack 60% and PF Usage gets to 2.58 Gb when glpk stops building and the error pops up. It doesn't seem like a model of this size should exhaust my RAM, and the performance readings suggest it isn't. However, the error remains. Does anyone have any suggestions as to why this might be happening? Cheers, Andrew GLPSOL: GLPK LP/MIP Solver 4.38 Reading model section from 22_Oct_Model.mod... 318 lines were read Reading tab_Stands... Reading tab_Prescriptions... Reading tab_All_Stand_Types... Reading tab_Yield_Types... Reading tab_Ecodistricts... Reading tab_Mills... Reading tab_Segs... Reading tab_Tsheds... Reading tab_Ndrs... Reading tab_Excl... Reading tab_Buffer... Reading tab_Stand_Area... Reading tab_Stand_Age... Reading tab_Stand_Types... Reading tab_Stand_Types_Eco... Reading tab_Stand_Ecod... Reading tab_Stand_Tshed... Reading tab_Stand_Ndr... Reading tab_Stand_Buffer... Reading tab_Yields... xmalloc: no memory available Error detected in file ..\src\glplib07.c at line 72 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Exit code: 3Time: 93.715 ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Printing non-zero parts of a solution matrix
Hello Reg, # Generate some random data. set S := {1..1000}; param x{S} := if Uniform01() .99 then Uniform01() else 0; # Print nonzero elements only. printf {s in S: x[s] 0 } x[%d] = %f\n, s, x[s]; end; Best regards Xypron Original-Nachricht Datum: Fri, 19 Oct 2012 14:44:15 -0700 (PDT) Betreff: [Help-glpk] Printing non-zero parts of a solution matrix The problem I'm solving has a small number of non-zero results in the solution matrix. Is there a way to print just the non-zero elements w/ GMPL? The obvious approach of iterating over the matrix w/ for doesn't allow a conditional inside the actions. thanks, Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] CSV buffer limits
Hello Reginald, in glpk-4.47/src/glpmpl06.c you find the following limitations: #define CSV_FIELD_MAX 50 /* maximal number of fields in record */ #define CSV_FDLEN_MAX 100 /* maximal field length */ The following works: # test1.mod writes csv set I := {1..300}; set J := {1..20}; set K := {1..100}; param x{I,J,K} := Uniform01(); table to {i in I, j in J, k in K} OUT CSV test.csv : i, j, k, x[i,j,k]; end; test2.mod reads csv set I, dimen 3; param x{I}; table ti IN CSV test.csv : I - [i,j,k], x; printf Number of values: %d\n, card(I); printf Average value: %f\n, (sum{(i,j,k) in I} x[i,j,k]) / card(I); end; Best regards Xypron Original-Nachricht Datum: Wed, 17 Oct 2012 10:03:28 -0700 (PDT) Betreff: [Help-glpk] CSV buffer limits Are there limits on the dimensions of .csv input and output in gmpl? I don't see any mention of limits in the wiki or in the 4.45 gmpl.pdf file in the csv section, but I did notice a 100 character line length limit mentioned in the SQL section. I'm working w/ 3D arrays on the order of 300x20x100, so it would be easy to collide w/ buffer limits pretty much any way I organize the data. Thanks, Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Specifying a constraint in CPLEX notation
Hello Reg, which problems you can formulate does not depend on the input language to GLPK. Using the GMPL language would make writing the input file much easier. See glpk-4.47/doc/gmpl.pdf I want to constrain A[i] to be zero if all the B[i][j] in n are zero. Checking if B[i][j] is zero will get you into trouble, if B[i,j] are not binary or integer. Would you consider 1E-30 as zero? You will either have to introduce additional binary variables definining if B[i,j] is zero, or accept inaccuracies, e.g. in: -M * sum{i in I, j in J} B[i,j] = A[i] = M * sum{i in I, j in J} B[i,j]; Best regards Xypron Original-Nachricht Datum: Wed, 3 Oct 2012 09:55:18 -0700 (PDT) Betreff: [Help-glpk] Specifying a constraint in CPLEX notation I'm doing basis pursuit using glpsol w/ input in CPLEX LP format. This has worked extremely well, but I decided to modify my problem formulation and have gotten myself into trouble. The new problem formulation is: D[k] = sum(i in m)(A[i] + sum(j in n)( B[i][j]*S[j][k])) where the A[i] B[i][j] are unknowns. I want to constrain A[i] to be zero if all the B[i][j] in n are zero. A[i] is free B[i][j] = 0 m 10 n 300 Can I do this in CPLEX LP format or do I need to switch to another notation or C? Are there any references on doing this? The closest thing I found was section 20.2 in the AMPL book, but I don't see how to apply that to my problem. I'm a geoscientist and a long way from home. So even the obvious can be baffling to me. Thanks, Reg ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Get number of columns from callback routine
See the appendix for an example using the Driebeck Tomlin heuristic implemented as callback function for branching down. Best regards Xypron On 21.09.2012 19:16, Michael Hennebry wrote: On Fri, 21 Sep 2012, glpk xypron wrote: for branching down on the most fractional variable you could use: I've read that that is not a particularly good criterion. That said, better criteria make more complex examples. BranchDown.java.gz Description: application/tgz ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Get number of columns from callback routine
Hello Patrik, for branching down on the most fractional variable you could use: @Override public void callback(glp_tree tree) { int reason = GLPK.glp_ios_reason(tree); if (reason == GLPKConstants.GLP_IBRANCH) { glp_prob lp = GLPK.glp_ios_get_prob(tree); double n = GLPK.glp_get_num_cols(lp); double frac = -1; int ifrac = 0; for (int i = 1; i = n; i++) { if (0 != GLPK.glp_ios_can_branch(tree, i)) { double value = GLPK.glp_mip_col_val(lp, i); if (frac = value - Math.floor(value)) { ifrac = i; frac = value - Math.floor(value); } if (frac = Math.ceil(value) - value) { ifrac = i; frac = Math.ceil(value) - value; } } } GLPK.glp_ios_branch_upon(tree, ifrac, GLPKConstants.GLP_DN_BRNCH); } } Best regards Xypron Original-Nachricht Datum: Thu, 20 Sep 2012 13:37:43 -0400 Von: Patrik Dufresne ikus...@gmail.com An: help-glpk@gnu.org Betreff: [Help-glpk] Get number of columns from callback routine Hi, I want to implement a simple always-down branching heuristic in GLPK. So I need to call the function glp_ios_can_branch() to check if the column is the right candidate for branching. But I'm wondering how to I determine the maximum number of column since my original problem may be changed by the pre-processor. Reading the documentation the following line should do it: GLPK.glp_get_num_cols(GLPK.glp_ios_get_prob(tree)); Am I right ? Thanks Patrik Dufresne ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Newbie questions encouraged?
Hello Raj, GLPK does not support multithreading. You could run multiple programs in parallel that use GLPK. Best regards Xypron Original-Nachricht Datum: Mon, 17 Sep 2012 09:23:44 +0530 Von: Raj Mathur (राज माथुर) r...@linux-delhi.org An: help-glpk@gnu.org help-glpk@gnu.org Betreff: [Help-glpk] Newbie questions encouraged? Hi, Does this list encourage (or at least tolerate) questions from rank newbies, in both LP and GLPK? To start off, is there any easy way to utilise all cores on a multi-CPU machine through GLPK? I.e. run a problem parallely in a multi-CPU environment? Regards, -- Raj -- Raj Mathur || r...@kandalaya.org || GPG: http://otheronepercent.blogspot.com || http://kandalaya.org || CC68 It is the mind that moves || http://schizoid.in || D17F ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Aborting a long-running algorithm in GLPK
Hello Marc, in the callback function you can use glp_ios_terminate(tree) to stop the branch and bound search. In the terminal listener or in the callback function you can use function glp_error to abort GLPK. You should use glp_error_hook to safely exit glp_intopt. This is the coding I use in GLPK for Java for this purpose: ... jmp_buf glp_java_env; if (setjmp(glp_java_env)) { printf function glp_intopt failed); } else { glp_error_hook(glp_java_error_hook, glp_java_env); glp_intopt(...); } glp_error_hook(NULL, NULL); ... void glp_java_error_hook(void *in) { /* free GLPK memory */ glp_free_env(); /* safely return */ longjmp(*((jmp_buf*)in), 1); } Best regards Xypron Original-Nachricht Datum: Mon, 10 Sep 2012 16:05:49 -0400 Von: Marc Goetschalckx marc.goetschal...@isye.gatech.edu An: GLPK help help-glpk@gnu.org Betreff: [Help-glpk] Aborting a long-running algorithm in GLPK Is there a way to safely signal a long running algorithm (glp_intopt) to stop executing and clean up memory and to terminate operation from outside the function call for the API. This would be similar to pressing CTRL+C during the operation of glpsol. What I need is different from setting the execution time limit before an long-running operation has started. Thanks -- Marc Goetschalckx Industrial and Systems Engineering Georgia Institute of Technology, Atlanta, GA, USA ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Specify initialization for MIP]
Dear Ankit, your message had to be forwarded manually, because you are not member of the GLPK help list, see https://lists.gnu.org/mailman/listinfo/help-glpk In glpk-4.47/doc/glpk.pdf, chapter 5 - Branch-and-Cut API Routines you will information about the usage of a callback function to specify a heuristic solution. Best regards Xypron Forwarded Message Subject: Specify initialization for MIP Date: Mon, 10 Sep 2012 02:10:56 +0530 Hi, I have been trying to solve MIP which contains around 1 integer variables. Well, problem is very large so it is expected that glpk will take infinitely huge amount of time. But also, I have good initialization for the branch and bound technique used by MIP. Anyone having any idea how to specify initialization for the MIP as couldn't find in the user's guide ? Thanks, regards, Ankit Gandhi ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Profiler for glpsol
Hello Asma, on Linux you can use oprofile to profile the glpk library: http://oprofile.sourceforge.net Best regards Xypron Original-Nachricht Datum: Fri, 7 Sep 2012 07:15:43 +0100 (BST) Von: esma mehiaoui esma...@yahoo.fr An: help-glpk@gnu.org Betreff: [Help-glpk] Profiler for glpsol Hello, I would like to know if there are some profilers for glpsol ? Thank to you Asma ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] financial compensation
Hello Zvonko, this is a pure LP problem: # partners set S; # given flows; set F, dimen 3; # minimized flows var f{S,S}, =0; minimize obj : sum{i in S, j in S} f[i,j]; s.t. c1{i in S} : sum{(j,i,x) in F} x - sum{(i,j,x) in F} x = sum{j in S} f[j,i] - sum{j in S} f[i,j]; solve; display f; data; set S := A B C; set F := A B 7000 B C 5000 C A 2000; end; Best regards Xypron Original-Nachricht Datum: Wed, 5 Sep 2012 08:13:18 + Von: Zvonko Bregar zvonko.bre...@eimv.si An: help-glpk@gnu.org help-glpk@gnu.org Betreff: [Help-glpk] financial compensation Hello everyone, I came across a certain combinatorial problem. Of a mandatory debt compensation between firms. The problem can be stated as: You have a directed graph. Each vortex presents a firm (a company). Each (directed) link from A to B presents the money amount that the A-firm must pay to the B-firm. And the problem is to reduce all the redundant cycles, For example if A owes 7000 to B and B owes 5000 to C and C owes 2000 back to A then this cycle could be reduced by 2000 and the link between C and A becomes obsolete. My question is whether or not this problem can be formulated as a mixed integer linear program. If Yes, does it makes sense or it would be much better to apply some graph theory alghoritms for minimal trees, cycles etc. If it does make sense to apply MILP please point me to the literature. Thank you in advance Zvonko OPOZORILO: To elektronsko sporo?ilo in vse njegove morebitne priloge lahko vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroin?tituta Milan Vidmar in so namenjene izklju?no naslovniku. ?e ste sporo?ilo prejeli pomotoma zaradi napake v naslovu ali pri prenosu sporo?ila, Vas prosimo, da nas o tem obvestite s povratno po?to. V tem primeru vsebine prejetega sporo?ila ne smete uporabiti, kopirati, tiskati, objaviti ali distribuirati, ampak ga morate takoj uni?iti. DISCLAIMER: This e-mail is for the intended recipient only. It contains proprietary information some or all of which may be legally privileged. If you received this e-mail by mistake please notify us by replying to this e-mail. Consequently, the contents of this e-mail must be deleted and not be used, copied, printed, disclosed or distributed. ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] C API: Setting up a least-absolute-deviation
Hello Jared, you will have to keep the u[i] variables as columns in your problem. And the objective will only have nonzereo coefficients w[i] for these columns. Have a look at http://www.xypron.de/projects/linopt/examples.html to see how accessing the GLPK API can be eased by a wrapper. Best regards Xypron Original-Nachricht Datum: Tue, 4 Sep 2012 17:39:54 -0700 Von: Jared Miller jarednmil...@gmail.com An: GLPK help help-glpk@gnu.org Betreff: Re: [Help-glpk] C API: Setting up a least-absolute-deviation Robbie, Thanks for the reply. To clarify, I'm not asking for help with the basics of the C API (it looks pretty straightforward if your problem is in the right form); rather I'm asking how to translate my high-level formulation (which includes the dummy u[i]'s) into the low-level formulation (with only auxiliary and structural variables, objective only in terms of the structural, and all the bounds constant). I'll try loading/translating my MathProg file into a glp_prob struct and examining the internal translation. Eventually I need to work on abstracting a way of getting problems of this type into the GLPK low-level form. On Sep 1, 2012, at 11:25 AM, Robbie Morrison wrote: Hello Jared To: help-glpk@gnu.org Subject: [Help-glpk] C API: Setting up a least-absolute-deviation Message-ID: 2f1bd370-dd45-45b3-af7e-6d41d9ccb...@gmail.com From: Jared Miller jarednmil...@gmail.com Date: Fri, 31 Aug 2012 15:52:11 -0700 I have an absolute value objective function, minimizing the sum of abs( s[i] - x[i] ) for two vectors s and x, with the constraints given by Ax = b where A is a large but very sparse matrix. So I'm using a dummy vector u in a MathProg model: minimize least_abs_dev: sum {i in I} (u[i]); s.t. constr1{i in I} : b[i] = sum{j in I} (A[i,j] * x[j]); s.t. constr2{i in I} : u[i] = (s[i] - x[i]); s.t. constr3{i in I} : u[i] = -(s[i] - x[i]); I also eventually want to incorporate weights into the objective: minimize least_abs_dev: sum {i in I} (u[i] * w[i]); I've got this type of model working using MathProg and glpsol, but now I'm trying to figure out how to translate it to the strict form required by the C API. Has anyone done this? What's the best way to go about it? I'm going to need high performance on some large problems. I am fairly new to optimization and GLPK. Any help would be much appreciated. - JM I'm not exactly sure what your question is, but here are some observations base on my experiences. I'm going to assume C++ too. First, there are some GLPK wikibook pages: http://en.wikibooks.org/wiki/GLPK/Using_the_GLPK_callable_library http://en.wikibooks.org/wiki/GLPK sections 14.1 thru 14.6 Second, you will probably need to understand how the GLPK MathProg translator translates your high-level model into a low-level problem -- unless you have some other insights based on the theoretical formulation of your problem. One way of doing this is to formulate simple instances of your model and examine the problem in say CPLEX LP format. http://en.wikibooks.org/wiki/GLPK/Interoperability#CPLEX.C2.A0LP_format I ended up writing a C++ class that interrogated the GLPK problem object and produces an HTML table to view in a web browser. Detailed routine work which invariably took several loops to get right. Third, some kind of abstraction between your model formulation and the raw GLPK calls could be useful. One relatively simple example can be found here: http://en.wikibooks.org/wiki/GLPK/IAJAAR.H_project I wrote a large class to provide a semi-intelligent interface with GLPK. This class tracked rows and columns as they were added and performed integrity checks too. Then I had another abstraction above this related to my domain modeling needs. A background in computer science can help here. In any event, I am guessing that you will need to know exactly how your structural matrix and your objective vector are being build, one API call at a time. REFERENCES One reference. Not sure exactly how useful it is. I could dig out some more if you can give me a better idea of where exactly you are headed. @incollection{ Author = {Hultberg, Tim H.}, Title = {Formulation of linear optimization problems in C++ [includes MIP]}, BookTitle = {Programming languages and systems in computational economics and finance}, Editor = {Nielsen, Soren S.}, Publisher = {Kluwer Academic Publishers}, Address = {Boston, MA, USA}, Pages = {199-229}, Note = {Chapter 6}, Year = {2002} } HTH, Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical
Re: [Help-glpk] Parallelisation of MILP
Hello Esma, yes parallelization of MIP solving is possible and reportedly beneficial. Different approaches exist, e.g. - parallelization of the solution of the LPs of different nodes using the different cores of the CPU http://www-01.ibm.com/support/docview.wss?uid=swg21400049 - parallelization of the simplex algorithm making use of the CPU http://web.njit.edu/all_topics/Prog_Lang_Docs/cplex80/doc/userman/html/moreUsing31.html - parallelization of the simplex algorithm making use of the GPU http://homepages.laas.fr/elbaz/PCO11.pdf GLPK is not threadsafe and hence cannot easily be used for parallelization. Making GLPK threadsafe would require major design changes. Best regards Xypron Original-Nachricht Datum: Tue, 4 Sep 2012 13:18:42 +0100 (BST) Betreff: [Help-glpk] Parallelisation of MILP Hello everyone, I would like to know if is it possible to parallelize the of an Mixed Integer Linear Program over a distributed architecture? Thank you in advanceAsma ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] different result
Hello Ajeng, you do not provide the excel solution. Hence it is impossible to tell if it is valid. glpsol has option -r to read a solution from a file. Use command printf to calculate the right hand side of each constraint and to check if it is met by the Excel solution. Best regards Xypron On 02.09.2012 11:57, Ajeng Dewi Citra Langeni wrote: i already solve a problem with glpk, but i want to validate it with calculate the objective function in excel but i have the different value between objective function in glpk and excel. glpk's objective function was 1805582104 , but if i calculate it with excel it was 1838084829 hereby i attached my problem, thanks in advance warm regards Ajeng Dewi Citra Langeni Industrial Engineering Bandung Institute of Technology ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] C API: Setting up a least-absolute-deviation problem
Hello Jared, take a look at glpk-4.47/examples/sample.c Best regards Xypron Original-Nachricht Datum: Fri, 31 Aug 2012 15:52:11 -0700 Betreff: [Help-glpk] C API: Setting up a least-absolute-deviation problem I have an absolute value objective function, minimizing the sum of abs( s[i] - x[i] ) for two vectors s and x, with the constraints given by Ax = b where A is a large but very sparse matrix. So I'm using a dummy vector u in a MathProg model: minimize least_abs_dev: sum {i in I} (u[i]); s.t. constr1{i in I} : b[i] = sum{j in I} (A[i,j] * x[j]); s.t. constr2{i in I} : u[i] = (s[i] - x[i]); s.t. constr3{i in I} : u[i] = -(s[i] - x[i]); I also eventually want to incorporate weights into the objective: minimize least_abs_dev: sum {i in I} (u[i] * w[i]); I've got this type of model working using MathProg and glpsol, but now I'm trying to figure out how to translate it to the strict form required by the C API. Has anyone done this? What's the best way to go about it? I'm going to need high performance on some large problems. I am fairly new to optimization and GLPK. Any help would be much appreciated. - JM ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Concatenate Parameter Fields Question
Hello Robert, set DMD_t, dimen 4; param Demand_t{DMD_t}; set DMD, dimen 3 := setof{(s, c, st, m) in DMD_t}(s, c , st, m); param Demand{(s,cst,m) in DMD} := sum{(s, c, st, m) in DMD_t: cst == c , st}Demand_t[s, c, st, m]; display DMD, Demand; data; set DMD_t := p1,'Dover',DE,1, p2,'Dover',DE,1, p2,'Tallahassee',FL,1, p3,'Atlanta',GA,1, p4,'Honolulu',HI,1, p5,'Boise',ID,1, p6,'Springfield',IL,1, p7,'Indianapolis',IN,1, p8,'Des Moines',IA,1; param Demand_t := [p1,'Dover',DE,1]303, [p2,'Dover',DE,1]697, [p2,'Tallahassee',FL,1]236, [p3,'Atlanta',GA,1]105, [p4,'Honolulu',HI,1]163, [p5,'Boise',ID,1]480, [p6,'Springfield',IL,1]375, [p7,'Indianapolis',IN,1]703, [p8,'Des Moines',IA,1]775; end; Best regards Xypron Original-Nachricht Datum: Fri, 31 Aug 2012 00:45:44 -0500 Betreff: [Help-glpk] Concatenate Parameter Fields Question I'm currently importing demand as a set of SKU(s), City(c ), State(s), TransMode(m) tuple parameters. I'd like to eliminate a dimension by concatenating the City and State into one element. I see how to do this for a set: set LOC := setof{(s, c, st, m) in DMD_t}(c, st); #the set of valid City/State combination set DMD := setof{(s, c, st, m) in DMD_t}(s, c, st, m); #The demand set: SKU, City/State, Mode Where DMD_t is my temporary demand set of imported data with dimension 4, and DMD is the 3 dimension set I'd like to work with in the model. My question: Is there a similar construct for converting a 4-tuple parameter to a 3-tuple? That is, can I somehow convert: Parameter Demand_t[s, c, st, m] to Parameter Demand[s, l, m] by concatenating the city and state dimenstions. I realize I could concatenate the fields in my input data, but I'm curious if there is a way to accomplish this with parameter manipulation. I'm new to glpk, so apologies in advance if this is a silly question. Thanks for your help, Rob ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Implementation problems]
Hello Sascha, variables cannot be used to define which row of the problem exists. s.t. Position{c in Krane, i in Aktionen[c], t in {S[c,i]..(S[c,i]+P[c,i])}} : x[c,t] = X[c,i]; You could replace S[c,i] by binary variables and use a big M approach. Best regards Xypron Forwarded Message Subject: Implementation problems Date: Thu, 30 Aug 2012 03:30:13 +0200 Hi, I am trying to implement a model that is only given to me in a conceptual form in GUSEK using GLPK. When I try to solve the following model, I receive an error message concerning an operand with invalid type. I was wondering if someone could give me a pointer on how to fix this. I am rather new to GUSEK and GLPK and your help is highly appreciated. Kind regards. Model: set Krane; set Aktionen {c in Krane}; set Zeiten; param P {c in Krane, i in Aktionen[c]}; param D; param L; param X {c in Krane, i in Aktionen[c]}; param V {c in Krane}; var S {c in Krane, i in Aktionen[c]} = 0, integer; var x {c in Krane, t in Zeiten} = 0, integer; minimize z: sum{c in Krane} S[c,card(Aktionen[c])]; s.t. Reihenfolge{c in Krane, i in {1..card(Aktionen[c])-1}} : S[c,i] + P[c,i] = S[c,i+1]; s.t. Position{c in Krane, i in Aktionen[c], t in {S[c,i]..(S[c,i]+P[c,i])}} : x[c,t] = X[c,i]; s.t. Geschwindigkeit1{t in Zeiten, c in Krane} : x[c,t] - V[c] = x[c,t +1] s.t. Geschwindigkeit2 {t in Zeiten, c in Krane} : x[c,t] + V[c] = x[c,t +1] s.t. Sicherheitsabstand{c == G, i in Aktionen, t in {S[i]..S[i]+P[g,i]}} : abs(x[K,t]-x[G,t]) = D s.t. Startposition{c in Krane} : x[c,0] == X[c,0] s.t. max_Position{t in Zeiten, c in Krane} : x[c,t] = L s.t. min_Position{t in Zeiten, c in Krane} : x[c,t] = 0 data; set Krane := K G; set Aktionen := K 1 2 3 4 5 6 7 8 9 10 11 12 G 1 2 3 4 5 6 7 8 9 10 11 12; set Zeiten := {0..900} param P: 1 2 3 4 5 6 7 8 9 10 11 12:= K 20 20 20 20 20 20 20 20 20 20 20 20 G 20 20 20 20 20 20 20 20 20 20 20 20; param D := 5; param L := 81; param X: 1 2 3 4 5 6 7 8 9 10 11 12:= K 2 10 9 14 9 14 9 3 80 6 40 2 G 79 5 1 77 77 3 40 41 40 39 80 30; param V:= K (1/5) G (1/5); end; Error: GLPSOL: GLPK LP/MIP Solver, v4.45 Parameter(s) specified in the command line: --check --cover --clique --gomory --mir -m Dorndorf.mod Reading model section from Dorndorf.mod... Dorndorf.mod:26: operand preceding .. has invalid type Context: ...n { c in Krane , i in Aktionen [ c ] , t in { S [ c , i ] .. MathProg model processing error Exit code: 1Time: 0.212 ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Implementation problems]
Hello Sasch, GLPK can solve linear optimization problems of type min{ c^T x; A x = b} Cf. http://en.wikipedia.org/wiki/Linear_programming It is required that matrix A and vector b are constant. You try to switch on and of some equations depending on a variable. This is possible as follows: s.t. c1{t in Zeiten, c in Krane, i in Aktionen[c]} X[c,i] + M1 * b[c,i,t] = x[c,t] = X[c,i] - M2 * b[c,i,t]; Here b[c,i,t] are binary variables. Of cause you will need additional constraints to force b[c,i,t] to model continuous time streams. M1 and M2 should be chosen as small as possible. abs() is a nonlinear function. Hence the following constraint cannot exist in a linear program: s.t. Sicherheitsabstand{c == G, i in Aktionen, t in {S[i]..S[i]+P[g,i]}} : abs(x[K,t]-x[G,t]) = D Try to replace the constraint by two linear inequalities using a binary variable describing if crane K is left or right of crane G. Best regards Xypron Original-Nachricht Datum: Thu, 30 Aug 2012 23:10:39 +0200 Betreff: Re: [Help-glpk] [Fwd: Implementation problems] Hello Xypron, thank you for your prompt reply. I am afraid, that I can't follow completely. Can you elaborate? Thank you Sascha 2012/8/30 glpk xypron xypron.g...@gmx.de Hello Sascha, variables cannot be used to define which row of the problem exists. s.t. Position{c in Krane, i in Aktionen[c], t in {S[c,i]..(S[c,i]+P[c,i])}} : x[c,t] = X[c,i]; You could replace S[c,i] by binary variables and use a big M approach. Best regards Xypron Forwarded Message Subject: Implementation problems Date: Thu, 30 Aug 2012 03:30:13 +0200 Hi, I am trying to implement a model that is only given to me in a conceptual form in GUSEK using GLPK. When I try to solve the following model, I receive an error message concerning an operand with invalid type. I was wondering if someone could give me a pointer on how to fix this. I am rather new to GUSEK and GLPK and your help is highly appreciated. Kind regards. Model: set Krane; set Aktionen {c in Krane}; set Zeiten; param P {c in Krane, i in Aktionen[c]}; param D; param L; param X {c in Krane, i in Aktionen[c]}; param V {c in Krane}; var S {c in Krane, i in Aktionen[c]} = 0, integer; var x {c in Krane, t in Zeiten} = 0, integer; minimize z: sum{c in Krane} S[c,card(Aktionen[c])]; s.t. Reihenfolge{c in Krane, i in {1..card(Aktionen[c])-1}} : S[c,i] + P[c,i] = S[c,i+1]; s.t. Position{c in Krane, i in Aktionen[c], t in {S[c,i]..(S[c,i]+P[c,i])}} : x[c,t] = X[c,i]; s.t. Geschwindigkeit1{t in Zeiten, c in Krane} : x[c,t] - V[c] = x[c,t +1] s.t. Geschwindigkeit2 {t in Zeiten, c in Krane} : x[c,t] + V[c] = x[c,t +1] s.t. Sicherheitsabstand{c == G, i in Aktionen, t in {S[i]..S[i]+P[g,i]}} : abs(x[K,t]-x[G,t]) = D s.t. Startposition{c in Krane} : x[c,0] == X[c,0] s.t. max_Position{t in Zeiten, c in Krane} : x[c,t] = L s.t. min_Position{t in Zeiten, c in Krane} : x[c,t] = 0 data; set Krane := K G; set Aktionen := K 1 2 3 4 5 6 7 8 9 10 11 12 G 1 2 3 4 5 6 7 8 9 10 11 12; set Zeiten := {0..900} param P: 1 2 3 4 5 6 7 8 9 10 11 12:= K 20 20 20 20 20 20 20 20 20 20 20 20 G 20 20 20 20 20 20 20 20 20 20 20 20; param D := 5; param L := 81; param X: 1 2 3 4 5 6 7 8 9 10 11 12:= K 2 10 9 14 9 14 9 3 80 6 40 2 G 79 5 1 77 77 3 40 41 40 39 80 30; param V:= K (1/5) G (1/5); end; Error: GLPSOL: GLPK LP/MIP Solver, v4.45 Parameter(s) specified in the command line: --check --cover --clique --gomory --mir -m Dorndorf.mod Reading model section from Dorndorf.mod... Dorndorf.mod:26: operand preceding .. has invalid type Context: ...n { c in Krane , i in Aktionen [ c ] , t in { S [ c , i ] .. MathProg model processing error Exit code: 1Time: 0.212 ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Compiling GLPK project in Ubuntu / Linux (was ---no subject)
Hello Antonio, which version of Ubuntu do you use? See http://www.ubuntu.com/download/desktop/upgrade for upgrade information. The current version is Ubuntu 12.04.1. LTS. Package libglpk-dev contains version glpk.h for version 4.45 of GLPK. File glpk.h only has the following include statements: #include stdarg.h #include stddef.h Best regards Xypron Original-Nachricht Datum: Sun, 26 Aug 2012 10:43:41 +1000 Von: Noli Sicad nsi...@gmail.com An: Antonio Carlos Moretti more...@ime.unicamp.br CC: help-glpk@gnu.org Betreff: Re: [Help-glpk] Compiling GLPK project in Ubuntu / Linux (was ---no subject) Hi Antonio, Whenever a post for help / request, please specify a subject matter. I installed GLPK as a package in UBUNTU. I did exactly how is wrutten in http://en.wikibooks.org/wiki/GLPK/Linux_packages When I tried to compile my file in C which calls the api routines I got a message that glpk.h:29:20: fatal error: glpios.h: No such file or directory. Looks like gcc is not find the library. Could you please help me. I think the ubuntu package only includes glpk.h, not all the glpk headers (i.e. include files) since it is binary package. You can verify this by looking at the /usr/include or /usr/local/include folder. (BTW, the glpk include files in not present in Mac OS X gkpk install (usr/local/include folder. It is only glpk.h is installed. This is default binary install by glpk, I suppose). I think you have to get the glpk-4.47 tarball and use the include files in /glpk-4.47/src/ folder for your glpk C project, if I am not mistaken. I am not done any C glpk project, how others manage to have glpk-dev in their system? Noli ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Re: [No Memory Available Error]]
Hello Aly, DRIVER={Microsoft Excel Driver (*.xls)} You want to use DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb); See http://en.wikibooks.org/wiki/GLPK/ODBC#Microsoft_Excel Please, subscribe to the GLPK help list, so Andrew does not have to forward your mails manually, see https://lists.gnu.org/mailman/listinfo/help-glpk Best regards Xypron Forwarded Message Subject: Re: [Help-glpk] [Fwd: No Memory Available Error] Date: Sat, 18 Aug 2012 08:31:16 -0400 (EDT) Thanks a lot for your replies, Robbie and Xypron. I did understand your excellent remarks, but I still do have a couple of questions, please: 1. So, I tried to use the 64 bit GLPK on a machine with windows 7 64 bit and Excel and Access 64 bit. However, when connecting to the Excel or the access database through ODBC, I get the following error: data source name not found and no default driver specified. I use a .dsn file to connect to the database, and that has been working perfectly with the 32 bit GLPK. In that .dsn file, I have this written: [ODBC] DRIVER={Microsoft Excel Driver (*.xls)} dbq=TestOne.xls Any thoughts why this is not working, and how can I get it to work? I understand Xypron's advice regarding switching my database to MySql. I could potentially do this in the future, but for now, I really need to connect to Excel and Access! 2. I used to use CPLEX through generating the .lp or the .mps file through GLPK, then solve that using CPLEX. However, I was wondering if there is a way to automatically call CPLEX within the GLPK code (which would enable me to get the solutions from CPLEX back, and play with them,etc). I saw in one of the links that Robbie sent, a C code that apparently does this. Is there any other direct easier way to do that? Your help will be greatly appreciated! Best, Aly ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] verify equation
Hello Sagor, linear programming with GLPK can only minimize or maximize one term. So what do you mean by max(x+y,x'+y') Do you want maximize the maximum of both terms (x+y and x'+y')? Best regards Xypron Original-Nachricht Datum: Tue, 14 Aug 2012 22:55:49 -0700 (PDT) Betreff: [Help-glpk] verify equation Hi, Is it possible to solve this equation using glpk? max(x+y,x'+y') x + x' = 1 y + y' = 1 variables are binary. It can only take 0 or 1. Maybe the constraints are not necessary. Can you please help if the equations are correct? I am kind of new in linear programming and will appreciate the help. Thanks Sagor ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: No Memory Available Error]
Hello Aly, a 32bit application can not address more than 2**32 bytes (4GB). You can use the task manager to analyze which application is using how much memory. Please, read https://en.wikibooks.org/wiki/GLPK/ODBC#Machine_architecture I suggest you put your data into a SQL data base like MySQL and use the 64bit version of GLPK. Best regards Xypron Forwarded Message Subject: No Memory Available Error Date: Wed, 15 Aug 2012 09:58:24 -0400 (EDT) Hi guys, I have two questions: I am trying to solve a model that I generate its data from Excel (connecting to it through ODBC). After the model is generated, glpk terminates with a memory error. The message is: glp_malloc: no memory available Error detercted in file ..\src\glpenv05.c at line 70. Then, it terminates with a Microsoft Visual C++ Runtime Library runtime error. I am using glpk 32 bit on a 64 bit windows 7 machine, and I use a 32 bit Excel. Any ideas how to get rid of this error? Seems like GLPK is not using all the available memory, since I also did solve the same model on a machine with 50 GB of Ram, and I still got the same error. Would using a 64 bit GLPK solve this? And in such case, would it work with the 32 bit Excel? or how could I force glpk in general to use all the available memory and solve this error? 2. Is there any way I can call CPLEX or Gurobi as the solver for the models I generate on GLPK? Your help will be highly appreciated. Thanks a lot. Aly ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: GLPK Implementation help]
Hello João, you would not add the glpk source folder if you have a library. Error 1 error LNK2019: unresolved external symbol _glp_version referenced This error means the your library path in the linker settings does not contain glpk_4_47.lib Best regards Xypron ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: GLPK Implementation help]
Hello João, your mail had to be forwarded manually because you are not subscribed to the GLPK help list, cf. https://lists.gnu.org/mailman/listinfo/help-glpk Probably the library path is not correctly specified. It worked for me as following on a 32bit Windows 7 system: Download winglpk-4.47.1.zip from http://sourceforge.net/projects/winglpk/ Extract it and copy to c:\program files\glpk. Copy glpk-4.47\w32\glpk_4_47.dll to C:\windows\system32. Open Visual Studio Express 2010 C++. Create new Win32 Console Application Do not choose compiled headers. Open project properties. In Linker-Additonal Dependencies add c:\program files\glpk\glpk-4.47\w32\glpk_4_47.lib In Configuration Properties-VC++ Directories add c:\Program Files\GLPK\glpk-4.47\src Enter the following code: #include stdio.h #include conio.h #include glpk.h int main(int argc, char* argv[]) { printf (GLPK version %s\n, glp_version()); printf (Press any key\n); while (!kbhit()){} getch(); return 0; } Press F5 to build and run. On Windows 64bit adjust the pathes accordingly. Best regards Xypron Forwarded Message Subject: GLPK Implementation help Date: Tue, 31 Jul 2012 11:57:28 +0100 hi, I am João Guedes, master student of University of Minho, in Portugal. I'm developing a LP tool for my thesis, and dicide to use GLPK as my solver, however i am having some issues in the implementation I'm using MS Visual Studio 2010, and in my project i include your lib, and add your glpk.h to my addicionals c++ lib, but when i compile the program i have a error on linker in all your funcions like this error LNK2001: unresolved external symbol _glp_add_cols Can you please help me? The exemple that i'm trying to use is this: #include stdio.h #include stdlib.h #include glpk.h int main(void) { glp_prob *lp; int ia[1+1000], ja[1+1000]; double ar[1+1000], z, x1, x2, x3; lp = glp_create_prob(); glp_set_prob_name(lp, sample); glp_set_obj_dir(lp, GLP_MAX); glp_add_rows(lp, 3); glp_set_row_name(lp, 1, p); glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 100.0); glp_set_row_name(lp, 2, q); glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 600.0); glp_set_row_name(lp, 3, r); glp_set_row_bnds(lp, 3, GLP_UP, 0.0, 300.0); glp_add_cols(lp, 3); glp_set_col_name(lp, 1, x1); glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0); glp_set_obj_coef(lp, 1, 10.0); glp_set_col_name(lp, 2, x2); glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0); glp_set_obj_coef(lp, 2, 6.0); glp_set_col_name(lp, 3, x3); glp_set_col_bnds(lp, 3, GLP_LO, 0.0, 0.0); glp_set_obj_coef(lp, 3, 4.0); ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */ ia[2] = 1, ja[2] = 2, ar[2] = 1.0; /* a[1,2] = 1 */ ia[3] = 1, ja[3] = 3, ar[3] = 1.0; /* a[1,3] = 1 */ ia[4] = 2, ja[4] = 1, ar[4] = 10.0; /* a[2,1] = 10 */ ia[5] = 3, ja[5] = 1, ar[5] = 2.0; /* a[3,1] = 2 */ ia[6] = 2, ja[6] = 2, ar[6] = 4.0; /* a[2,2] = 4 */ ia[7] = 3, ja[7] = 2, ar[7] = 2.0; /* a[3,2] = 2 */ ia[8] = 2, ja[8] = 3, ar[8] = 5.0; /* a[2,3] = 5 */ ia[9] = 3, ja[9] = 3, ar[9] = 6.0; /* a[3,3] = 6 */ glp_load_matrix(lp, 9, ia, ja, ar); glp_simplex(lp, NULL); z = glp_get_obj_val(lp); x1 = glp_get_col_prim(lp, 1); x2 = glp_get_col_prim(lp, 2); x3 = glp_get_col_prim(lp, 3); printf(\nz = %g; x1 = %g; x2 = %g; x3 = %g\n, z, x1, x2, x3); glp_delete_prob(lp); return 0; } -- Cumprimentos João Guedes ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: glpsol not converging]
Hello Narendra, if tmlim is 10 (10E5) the optimization should have stopped after 28 hours. Please, check you did not enter 100 (10E6). On Linux you can use ps -df to check the parameters of your running process. To better understand your problem, please, provide: - last output lines of your endless run - operating system you run on (including whether its 32 or 64bit) - version of GLPK you are using. - output of glpsol -m tam.mod -d step1.dat --check The parameter --first typically will slow down the solution. You should only specify it, if you are sure about how your variables are sorted and why you want to always branch on the first integer variable. Best regards Xypron Original-Nachricht Datum: Tue, 31 Jul 2012 15:18:27 -0700 Von: Narendra Devta-Prasanna narendr...@gmail.com Betreff: Re: [Help-glpk] [Fwd: glpsol not converging] Hi Xypron, other Experts, I have tried with a time limit of 10 and the run has been going on for the last 5 days with no end in sight. It has so far completed 16 million iterations with no converging in sight. And the obj value has remained the same since ~124000 iteration. The options I used to run glpsol are: glpsol -m tam.mod -d step1.dat -o step1.out -y step1.res --first --cuts --tmlim 10 --mipgap 0.25 Can you please suggest to me what I can try to limit this and generate *some* solution even if it is not completely optimal but *close* enough. Thanks and Regards, -Narendra On Thu, Jul 26, 2012 at 3:19 PM, Xypron xypron.g...@gmx.de wrote: Hello Narendra, + 34748: mip = not found yet = 1.05880e+04(1; 0) TIME LIMIT EXCEEDED; SEARCH TERMINATED you have to choose a time limit which is high enough to have a MIP solution. Best regards Xypron On 26.07.2012 23:40, Narendra Devta-Prasanna wrote: Hi Xypron, When I try with --tmlim 100, the printf commands just print null strings for the variables in the ILP. The output file does not have any values assigned for the variables as well. In the end of the output file, I see this: Integer feasibility conditions: KKT.PE: max.abs.err = 0.00e+00 on row 0 max.rel.err = 0.00e+00 on row 0 High quality KKT.PB: max.abs.err = 1.60e+01 on row 34 max.rel.err = 9.41e-01 on row 34 SOLUTION IS INFEASIBLE End of output The log file has this information: * 29500: obj = 1.058950243e+04 infeas = 2.460e-13 (2) * 29725: obj = 1.05880e+04 infeas = 6.601e-13 (2) OPTIMAL SOLUTION FOUND Integer optimization begins... + 29725: mip = not found yet = -inf(1; 0) | 32500: obj = 1.05880e+04 infeas = 3.451e-10 (2) | 33000: obj = 1.05880e+04 infeas = 4.318e-10 (2) | 33500: obj = 1.05880e+04 infeas = 4.521e-10 (2) | 34000: obj = 1.05880e+04 infeas = 5.004e-10 (2) | 34500: obj = 1.05880e+04 infeas = 2.476e-10 (2) | 34748: obj = 1.05880e+04 infeas = 4.083e-10 (2) + 34748: mip = not found yet = 1.05880e+04(1; 0) + 34748: mip = not found yet = 1.05880e+04(1; 0) TIME LIMIT EXCEEDED; SEARCH TERMINATED Time used: 120.8 secs Memory used: 160.7 Mb (168467811 bytes) Writing MIP solution to `./glpk_ex3/ex3_TAM_IP_glpk_step1.out'... Is it possible to print out the OPTIMAL SOLUTION FOUND in some way? The actual routing problem I am solving is a non-linear problem which I am modeling as a ILP to get a solution which is anyways not optimal for the problem but happens to be much better than a random solution. So, for the ILP, even if it is not an optimal solution, it is acceptable for my situation. Really appreciate your suggestions regarding this... Thanks Regards, -Narendra ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: glpsol not converging]
Hello Andrew, looking at the output Narendra provided GLPK is stuck in the warm up phase and cannot find an initial LP solution. Here the time limit of the mip solver is ignored. Would it be possible to pass the tmlim parameter to the simplex solver? @Narendra Looking at the value of your objective function obj = 3.241402100e+07 could it be that you have very large ratios between the smallest and largest matrix elements of your problem? Please, start your model again without --check and provide start of the output, e.g. Model has been successfully generated GLPK Integer Optimizer, v4.47 289 rows, 480 columns, 1680 non-zeros 240 integer variables, all of which are binary Preprocessing... 288 rows, 480 columns, 1440 non-zeros 240 integer variables, all of which are binary Scaling... A: min|aij| = 1.000e+00 max|aij| = 1.500e+01 ratio = 1.500e+01 GM: min|aij| = 9.586e-01 max|aij| = 1.043e+00 ratio = 1.088e+00 EQ: min|aij| = 9.189e-01 max|aij| = 1.000e+00 ratio = 1.088e+00 2N: min|aij| = 9.375e-01 max|aij| = 1.000e+00 ratio = 1.067e+00 Constructing initial basis... Size of triangular part = 286 Solving LP relaxation... GLPK Simplex Optimizer, v4.47 The ratio provided in the scaling phase gives a good indication if your model is well conditioned. Analyze your model whether you are using some big M approach or dummy costs with very high numbers and try to find a better scaled formulation. Best regards Xypron Original-Nachricht Datum: Tue, 31 Jul 2012 16:41:40 -0700 Betreff: Re: [Help-glpk] [Fwd: glpsol not converging] Hi Xypron, Yes, I have re-checked the parameters again. I used 1 (10E5) and not 10E6 for --tmlim. The last 10 lines of output from the run are: |16587000: obj = 3.241402100e+07 infeas = 1.037e-09 (2) |16587500: obj = 3.241402100e+07 infeas = 7.363e-10 (2) |16588000: obj = 3.241402100e+07 infeas = 5.294e-10 (2) |16588500: obj = 3.241402100e+07 infeas = 6.339e-10 (2) |16589000: obj = 3.241402100e+07 infeas = 9.333e-10 (2) |16589500: obj = 3.241402100e+07 infeas = 1.177e-09 (2) |1659: obj = 3.241402100e+07 infeas = 3.791e-09 (2) |16590500: obj = 3.241402100e+07 infeas = 1.787e-09 (2) |16591000: obj = 3.241402100e+07 infeas = 8.604e-10 (2) |16591500: obj = 3.241402100e+07 infeas = 1.154e-09 (2) This process is running on a 64-bit Linux m/c with 2G of memory reserved for this process. I also know that there is no slowdown happening because of any memory swapping etc. I am using v4.47 version as indicated by this message in the output of the run: GLPSOL: GLPK LP/MIP Solver, v4.47 I also ran with --check option and the tool output is as below: GLPSOL: GLPK LP/MIP Solver, v4.47 Parameter(s) specified in the command line: -m tam.mod -d step1.dat --check Reading model section from tam.mod... 226 lines were read Reading data section from step1.dat... 2390 lines were read Generating IOSingleMode... Generating TotalInputIOs... Generating TotalOutputIOs... Generating IOPreInputMode... Generating IOPreOutputMode... Generating PreDefInput... Generating PreDefOutput... Generating UsedIOIsInput1... Generating UsedIOIsInput2... Generating UsedIOIsOutput1... Generating UsedIOIsOutput2... Generating InputIOUsedOnce... Generating OutputIOUsedOnce... Generating BlockInputIOUsedOnce... Generating BlockOutputIOUsedOnce... Generating FlatPreDefInput... Generating FlatPreDefOutput... Generating BlockInputFlatUnused... Generating BlockOutputFlatUnused... Generating FlatUsedIOIsInput... Generating FlatUsedIOIsOutput... Generating FlatBlockInputAssigned... Generating FlatBlockOutputAssigned... Generating FlatIOUsedOnceIn... Generating FlatIOUsedOnceOut... Generating FlatWireLengthIn... Generating FlatWireLengthOut... Generating WireLengthOut... Generating WireLengthIn... Generating WireLength... Generating Routing... Model has been successfully generated I specified the --first option as I was trying different things to check if it helps in speeding up. I have also tried without that option, but I still get stuck in an endless run. I really appreciate your help on this. Thanks again and Best regards, -Narendra On Tue, Jul 31, 2012 at 4:22 PM, glpk xypron xypron.g...@gmx.de wrote: Hello Narendra, if tmlim is 10 (10E5) the optimization should have stopped after 28 hours. Please, check you did not enter 100 (10E6). On Linux you can use ps -df to check the parameters of your running process. To better understand your problem, please, provide: - last output lines of your endless run - operating system you run on (including whether its 32 or 64bit) - version of GLPK you are using. - output of glpsol -m tam.mod -d step1.dat --check The parameter --first typically will slow down the solution. You should only specify it, if you are sure about how your variables are sorted and why you want
Re: [Help-glpk] info
Hello Daniele, * The routine ios_relative_gap computes the relative mip gap using the * formula: * * gap = |best_mip - best_bnd| / (|best_mip| + DBL_EPSILON) Minimization example: - Best integer solution 2 - Best bound -1.3 = Gap = (2 - -1.3) / 2 = 1.65 If you called glpsol --mipgap 1.7 -m problem.mod the solver would stop with this soution. Beware: The mip gap may rise while you solution gets better: Integer optimization begins... + 213: mip = not found yet = +inf(1; 0) + 481: -4.0e+00 = 7.0e+00 275.0% (10; 0) + 875: -3.0e+00 = 2.6e+00 186.7% (15; 3) + 1215: -1.0e+00 = 1.0e+00 200.0% (15; 11) + 1397: mip = -1.0e+00 = tree is empty 0.0% (0; 47) INTEGER OPTIMAL SOLUTION FOUND The mip gap rose from 1.867 to 2. while the objective rose from -3 to -1 in this maximization problem. Best regards Xypron On 30.07.2012 16:22, Daniele Micarelli wrote: hi I wanted to know more precisely what is the command: *mipgap tol* and the number that goes in place of tol to indicate precisely what is? thank you very much ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: Problem with GLPK when trying to find value functions]
Hello Sergey, a segmentation fault implies that you access memory for variables without having allocated the memory. In the GLPK library index 0 is often not used. E.g. if you want to use function glp_set_mat_row to set 3 values you need to allocate memory for arrays with 4 elements. Please, have a close look at glpk-4.47/doc/glpk.pdf. Best regards Xypron Forwarded Message From: Sergey Kuznetsov latg...@gmail.com To: help-glpk@gnu.org Subject: Problem with GLPK when trying to find value functions Date: Wed, 25 Jul 2012 19:19:39 + Hello, I'm using GLPK to find value functions, it's a family of linear programs with right-hand side as parameter. For instance, I'm constructing 3D integer lattice and at each site (point) I need to find optimal solution using site coordinates as right-hand side (in this case it's 3D vector). I wrote a function that solves the linear program using GLPK. At first it crashed on the second call. I replaced glp_delete_prob() on gpl_erase_prob() and it worked well for [0;3]^3 lattice (and [0;3]^2 lattice). The problems began [0;4]^2 (2D) lattice. I have segmentation fault and it's unusual because in [0;3]^3 I'm solving more programs. OS : Linux Debian, i686; Compiler: GCC 4.7.1 Test instances: 3D: 4 columns, 3 rows; 2D: 3 columns, 2 rows; all the entries (matrix, objective function coeff, right-hand side) are integers. Clearly, the problems begin when I'm setting span of the lattice to 4 (5, 6, etc.). If anybody has any idea how to fix this, please help me. Thanks Sergey Kuznetsov ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: glpsol not converging]
Hello Narendra, glpsol has a command line parameter --tmlim nnn limit solution time to nnn seconds Best regards Xypron On 26.07.2012 22:13, Andrew Makhorin wrote: Forwarded Message From: Narendra Devta-Prasanna narendr...@gmail.com To: help-glpk@gnu.org Subject: glpsol not converging Date: Thu, 26 Jul 2012 12:23:43 -0700 Hi, I am relatively new to using ILP solvers and do not understand all the underlying mathematics. I am using glpsol to solve a routing problem. For most instance of the problem, I get a solution within minutes. But in one case, when the size of the problem is bigger, it is not converging after running for more than 3 days and 10 million iterations. After about 12500th iteration, the objective function value does not improve but the tool does not ever stop. I have tried different options such as --first, --dfs, --pcost etc but nothing seems to help. I have also included --mipgap 0.1 and also tried with other values but still does not help. Is there a way I can tell the tool to stop after a certain number of iterations and print the most optimal solution identified so far and make the results available through printf commands etc. I have looked all over the web for any further clues to solving this. I really appreciate it if the experts on this mailing list can help with how to address this issue. Thanks and Regards, -Narendra ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: glpsol not converging]
Hello Narendra, + 34748: mip = not found yet = 1.05880e+04(1; 0) TIME LIMIT EXCEEDED; SEARCH TERMINATED you have to choose a time limit which is high enough to have a MIP solution. Best regards Xypron On 26.07.2012 23:40, Narendra Devta-Prasanna wrote: Hi Xypron, When I try with --tmlim 100, the printf commands just print null strings for the variables in the ILP. The output file does not have any values assigned for the variables as well. In the end of the output file, I see this: Integer feasibility conditions: KKT.PE http://KKT.PE: max.abs.err = 0.00e+00 on row 0 max.rel.err = 0.00e+00 on row 0 High quality KKT.PB: max.abs.err = 1.60e+01 on row 34 max.rel.err = 9.41e-01 on row 34 SOLUTION IS INFEASIBLE End of output The log file has this information: * 29500: obj = 1.058950243e+04 infeas = 2.460e-13 (2) * 29725: obj = 1.05880e+04 infeas = 6.601e-13 (2) OPTIMAL SOLUTION FOUND Integer optimization begins... + 29725: mip = not found yet = -inf(1; 0) | 32500: obj = 1.05880e+04 infeas = 3.451e-10 (2) | 33000: obj = 1.05880e+04 infeas = 4.318e-10 (2) | 33500: obj = 1.05880e+04 infeas = 4.521e-10 (2) | 34000: obj = 1.05880e+04 infeas = 5.004e-10 (2) | 34500: obj = 1.05880e+04 infeas = 2.476e-10 (2) | 34748: obj = 1.05880e+04 infeas = 4.083e-10 (2) + 34748: mip = not found yet = 1.05880e+04(1; 0) + 34748: mip = not found yet = 1.05880e+04(1; 0) TIME LIMIT EXCEEDED; SEARCH TERMINATED Time used: 120.8 secs Memory used: 160.7 Mb (168467811 bytes) Writing MIP solution to `./glpk_ex3/ex3_TAM_IP_glpk_step1.out'... Is it possible to print out the OPTIMAL SOLUTION FOUND in some way? The actual routing problem I am solving is a non-linear problem which I am modeling as a ILP to get a solution which is anyways not optimal for the problem but happens to be much better than a random solution. So, for the ILP, even if it is not an optimal solution, it is acceptable for my situation. Really appreciate your suggestions regarding this... Thanks Regards, -Narendra ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Feasibility pump heuristic
Hello Patrik, glpios10.c has the following lines: * M.Fischetti, F.Glover, and A.Lodi. The feasibility pump. Math. * Program., Ser. A 104, pp. 91-104 (2005). */ You can find the article at http://www.dei.unipd.it/~fisch/papers/feasibility_pump.pdf Further reading is: http://www.dei.unipd.it/~fisch/papers/feasibility_pump_201.pdf http://www.zib.de/Publications/Reports/ZR-05-42.pdf Best regards Xypron On 26.07.2012 20:24, Robbie Morrison wrote: Hello Patrik To: help-glpk@gnu.org Subject: [Help-glpk] Feasibility pump heuristic From: Patrik Dufresne ikus...@gmail.com Date: Thu, 26 Jul 2012 12:51:55 -0400 Hi, I'm using GLPK to model an integer linear problem and then solve it using glp_intopt(). Since, I'm a beginner with linear problem, I've try different option of the solver. One of them is the Feasibility pump heuristic (fp_heur). Enabling this option solve the problem within 24sec instead of 192sec when disabled. My first question, do you have any reference material to explain how the feasibility pump heuristic is working ? This publication describes changes to GLPK 4.28 to test novel MILP branching techniques. I don't know if it covers the heuristic you mentioned but it should provide some useful background: Pryor, Jennifer; Chinneck, John W (2011), Faster integer-feasibility in mixed-integer linear programs by branching to force change, Computers and Operations Research 38 (8): 1143-1152, doi:10.1016/j.cor.2010.10.025 paywalled : http://www.sciencedirect.com/science/article/pii/S0305054810002546 preprint : http://www.sce.carleton.ca/faculty/chinneck/docs/PryorChinneck.pdf When enabled, is the optimality is still garanteed ? Yes, barring unknown errors in chipset, compilers, libraries, and models. This might be of interest in relation to GLPK: http://en.wikibooks.org/wiki/GLPK/Background_theory Then read up about the Karush-Kahn-Tucker (KKT) optimality conditions elsewhere: http://en.wikipedia.org/wiki/Karush%E2%80%93Kuhn%E2%80%93Tucker_conditions Thanks for you'r help. Patrik Dufresne -- next part -- An HTML attachment was scrubbed... URL: http://lists.gnu.org/archive/html/help-glpk/attachments/20120726/ba56f1bc/attachment.html HTH, Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical University of Berlin (TU-Berlin), Germany University email (redirected) : morri...@iet.tu-berlin.de Webmail (preferred) : rob...@actrix.co.nz [from Webmail client] ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] presolving
Hello Daniele, http://en.wikibooks.org/wiki/GLPK/Terminal_output#MIP_branch-and-cut_output describes how to read the output to find out, when the first integer solution was found and which value it had. If you have no need to prove optimality, you can use the following parameters for glpsol: --tmlim nnn limit solution time to nnn seconds --mipgap tol set relative mip gap tolerance to tol Best regards Xypron Original-Nachricht Datum: Tue, 24 Jul 2012 11:08:23 +0200 Betreff: Re: [Help-glpk] presolving the problem has no solution because of the constraints: *VincStraordinari1*and *VincStraordinari2* If i don't consider them, the problem has solution but takes days to find the solution. There is a procedure to shorten the search? Because I think that GLPSOLalmost immediately finds the solution but all this takes time to verify the optimality of this (p.s. I use the command CUTS for resolve the problem) Thanks 2012/7/21 Daniele Micarelli danielemicare...@gmail.com Hello I have these two files that i attached because when i fix these two files with GLPSOL, it used too long (even days) using the commands - math - cuts, and I wanted to know if there are ways of presolving to speed the resolution thank you very mutch Best Daniele ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Single index for multidimensional sets
Hello Mate, a index symbol is always scalar and never a tuple. But you can use string concatenation for merging your indices: set S1; set S2; set S3 := setof {s1 in S1, s2 in S2: s1!=s2} s1,s2; set S4 := setof {s1 in S1, s2 in S2: s1s2} s1,s2; param p{S3}, default 3; var x{s3 in S3}; s.t. constraint1{s3 in S3}: x[s3]=p[s3]; s.t. constraint2{s4 in S4}: x[s4] = 2 * p[s4]; data; set S1 := s11 s12; set S2 := s21 s22 s23; end; Best regards Xypron Original-Nachricht Datum: Tue, 17 Jul 2012 15:30:07 +0200 Von: Mate Hegyhati hegyh...@dcs.uni-pannon.hu An: help-glpk@gnu.org Betreff: [Help-glpk] Single index for multidimensional sets Dear All, is it somehow possible to use a single index symbol for addressing an n-tuple? In one of my problems I have a 3 dimensional set, that is used as a basis for other sets, etc. I'm trying to do something like this: set S1; set S2; set S3 := setof {s1 in S1, s2 in S2: s1!=s2} (s1,s2); param p{s1 in S1, s2 in S2}, default 3; var x{s3 in S3}; # this is, that should be (s1,s2) in S3 s.t. constraint1 {s3 in S3}: # similar here x[s3]=p[s3]; s.t. constraint2{s1 in S1, s2 in S2: s1s2}: x[s1,s2] = 2 * p[s1,s2]; It is not working, and according to the manual, an index should match the dimension of the set. Is it somehow possible to avoid writing (s1,s2) everywhere? Thank You very much in advance, best regards, Mate Hegyhati ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] problem with parameter
Hello Daniele, where is your problem in writing the data file? A data file can have as many lines as you want. set I:= {0..100}; set T:= {0..600}; param w{I,T}; data; param w := [ 0, 0] 0.128312 [ 0, 1] 0.009597 ... [ 0,600] 0.029687 [ 1, 0] 0.553792 ... [ 1,600] 0.818264 ... [100,600] 0.029687 ... [100,600] 0.412226 end; Just replace ... by the missing lines. Best regards Xypron Original-Nachricht Datum: Mon, 16 Jul 2012 18:42:59 +0200 Betreff: [Help-glpk] problem with parameter i have to write in file.DAT one parameter in two dimensions *w[i,t]* when *i* the index of the activity and *t* is the index of the time interval My problem is that the time interval is 0..600 and i don't know how to write it on file.DAT because it is too large I know its not about GLPK but i hope it's already happened to someone thank you very much best ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] glp_malloc: no memory available
Hello David, normally the matrices of LP problems are sparse. Probably you will be using glp_set_mat_row, glp_set_mat_col, or glp_load_matrix in your code. Make sure that you only copy values that are not zero. Make sure that you delete the vectors you are passing to said methods after usage. ind = GLPK.new_intArray(3); GLPK.intArray_setitem(ind, 1, 1); GLPK.intArray_setitem(ind, 2, 2); val = GLPK.new_doubleArray(3); GLPK.doubleArray_setitem(val, 1, 1.); GLPK.doubleArray_setitem(val, 2, -1.); GLPK.glp_set_mat_row(lp, 1, 2, ind, val); GLPK.delete_doubleArray(val); GLPK.delete_intArray(ind); Best regards Xypron Original-Nachricht Datum: Mon, 16 Jul 2012 13:44:19 -0400 Betreff: [Help-glpk] glp_malloc: no memory available Hello, I am building an LP using GLPK_4_47 in eclipse and am receiving the error: glp_malloc: no memory available Error detected in file ..\src\glpenv05.c at line 70 Exception in thread main org.gnu.glpk.GlpkException: function glp_add_rows failed at org.gnu.glpk.GLPKJNI.glp_add_rows(Native Method) at org.gnu.glpk.GLPK.glp_add_rows(GLPK.java:230) at cmif.LPWeighting.LPWeighting.developIMinusKConstraintsMax(LPWeighting.java:234) at cmif.LPWeighting.LPWeighting.singleOutputMaxLP(LPWeighting.java:56) at tests.MassSamplingLPTest.main(MassSamplingLPTest.java:30) If anyone has any help at all, it would be much appreciated. Thanks. --David ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] set of commands
Hello Daniele, the options of glpsol are explained in appendix D of glpk-4.47\doc\glpk.pdf. Or type glpsol --help To get an idea of what cuts are you may take a look at: http://www.dei.unipd.it/~fisch/papers/slides/2010%20Toward%20a%20MIP-cut%20metascheme%20%5BFischetti%20CPAIOR%5D.ppt Best regards Xypron Original-Nachricht Datum: Fri, 13 Jul 2012 00:49:49 +0200 Betreff: [Help-glpk] set of commands what is the difference between the commands: math, cuts, no cuts and nointompt ??? thank you very much best ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: GLPK NOT FUNCTIONING ON MY SYSTEM]
Hello Imsmaila, your message hat to be forwarded manually because you are not subscribed to the GLPK help list, see https://lists.gnu.org/mailman/listinfo/help-glpk If you want to compile GLPK yourself, see http://en.wikibooks.org/w/index.php?title=GLPK/Obtaining_GLPK http://en.wikibooks.org/wiki/GLPK/Windows Otherwise download a precompiled version, see http://en.wikibooks.org/wiki/GLPK/Windows_executables Best regards Xypron Forwarded Message Subject: GLPK NOT FUNCTIONING ON MY SYSTEM Date: Wed, 11 Jul 2012 11:28:09 -0700 (PDT) Dear sir/madam, am a student of operations research from Nigeria.First i want to thank you for the free linear programing kit project.I download it on my system (windows 7 operating sys) plus the corresponding sig file but when i try to open it,a dialogue box pup up saying window cannot open this file.what should i do? Where can i get the tutorial?. Please advice. Ismail ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] How did you rewrite the cplex API?
Hello Christophe-Marie, whether API definitions are copyrightable has been subject to legal disputes. In a case between Google and Oracle in the US it was decided that API definitions are not copyrightable: So long as the specific code used to implement a method is different, anyone is free under the Copyright Act to write his or her own code to carry out exactly the same function or specification of any methods used in the Java API. It does not matter that the declaration or method header lines are identical. Under the rules of Java, they must be identical to declare a method specifying the same functionality — even when the implementation is different. When there is only one way to express an idea or function, then everyone is free to do so and no one can monopolize that expression. And, while the Android method and class names could have been different from the names of their counterparts in Java and still have worked, copyright protection never extends to names or short phrases as a matter of law. http://www.courthousenews.com/2012/06/01/Gcopyright.pdf A likewise decision exists for the EU: http://curia.europa.eu/juris/documents.jsf?num=C-406/10 Best regards Xypron Original-Nachricht Datum: Sun, 8 Jul 2012 13:13:14 +0200 Betreff: [Help-glpk] How did you rewrite the cplex API? Hi, Browsing the glpk sources, I found the following file: examples/cplex/cplex.h I am the author of lazylpsolverlibs [1], a project aiming at generating proxy libraries for commercial lp solvers. My goal is to provide opensource libraries to link to for open source programs that use commercial lp solvers. These libraries transparently proxy calls to the closed-source ones whenever the solver can be found on the machine. My primary target is Osi [2], but I think other opensource implementations can benefit from such a work. Right now, what bothers me the most is copyright issues. Implementing proxy functions is not a problem, but writing headers in a way I can redistribute them freely gives me headaches. As a consequence, I am interested in knowing about the way you wrote this file. Did you start from the actual cplex.h? Did you rewrite it from scratch? Cheers, Christophe-Marie [1]: https://code.google.com/p/lazylpsolverlibs/ [2]: https://projects.coin-or.org/Osi ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Retrieving Solution Values
Hello David, unfortunately your mail does not give sufficient information to analyze your problem. Please, provide: - version of GLPK - version of the GLPK to Java binding used - a reproducable example. A .simplex() method existed in the GLPK 4.8 Java Interface published by Björn Frank, which is no longer maintained and cannot be used with current versions of GLPK, cf. http://en.wikibooks.org/wiki/GLPK/Java The current version of GLPK is 4.47. The current version of GLPK for Java is 1.0.22 and is available at http://sourceforge.net/projects/glpk-java/ Best regards Xypron Original-Nachricht Datum: Sun, 8 Jul 2012 21:16:10 -0400 Betreff: [Help-glpk] Retrieving Solution Values Hi All, I am a PhD Student that is using GLPK in Java and my problem is that when I create a problem, solve it, and attempt to retrieve the primal values of variables, it seems to be doing things out of order even though my code has the problem creation, .simplex() solution method, and then the retrieval code afterwards. Even if I replace the retrieval code with just a System.out.println(SOMETHING) it still prints that before the console print of the actual solution of the problem. Any help at all is much appreciated. -- David Myers ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Huge Parameter Sets
Hello Andrew, the GMPL language causes a huge memory overhead. Hence you should not use glpsol but the GLPK library, which you can call from C, C++, Java, Python, and some other programming languages. Best regards Xypron Original-Nachricht Datum: Fri, 6 Jul 2012 17:04:40 -0300 Betreff: [Help-glpk] Huge Parameter Sets Hello, I'm trying to build a .mod model with data from ten 25,000,000 row .csv files (approx 500,00Mb each). Even building a model with one of them gives an insufficient memory error. Is there a better way to go about this than massive .csv files? Does anyone have any experience with building models from such huge data sets? cheers, Andrew ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Problem Has no Primal Feasible Solution
Hello Daniele, take a look at this constraint: /* temporal precedence constraint */ subject to PrecTemp{i in A,j in A}: sum{t in T} tt[t]*x[j,t] = sum{t in T} tt[t]*x[i,t] + d[i]; For i = j it requires non-positive durations 0 = d[i]. Best regards Xypron Original-Nachricht Datum: Fri, 6 Jul 2012 12:25:58 +0200 Von: Daniele Micarelli danielemicare...@gmail.com An: help-glpk@gnu.org Betreff: [Help-glpk] Problem Has no Primal Feasible Solution Hi, i'm attaching the two file .mod and .dat to let you know When i run these files with glpsol, i get these two messages at the end: *Model has been successfully generated and PROBLEM HAS NO PRIMAL FEASIBLE SOLUTION *in my opinion should exist one solution it's possible? ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] manipulating parameter indices
Hello Kevin, setABC will be calculated once only. Best regards Xypron Original-Nachricht Datum: Wed, 04 Jul 2012 15:32:51 -0400 Betreff: Re: [Help-glpk] manipulating parameter indices At 10:03am -0400 Wed, 04 Jul 2012, Andrew Makhorin wrote: In the current mathprog implementation no query optimization is performed, that is, all intermediate and resulting objects are evaluated literally as specified by corresponding expressions. (This is exactly the same problem that appears in the relational database systems.) For example, param foo{i in I} := sum{j in J: (i,j) in E} x[i,j]; will be evaluated as follows: for all i in I do { s := 0; for all j in J do { if (i,j) in E then s := s + x[i,j] } foo[i] := s } Ah, I see. So how about a compound situation like below? # i.e. a generated set. Does this get created once and then used as # a first class set? Or does the such that operator get # evaluated for every use if setABC? set setABC := {a in setA, b in setB, c in setC : a + b = c }; set setABCD := {(a, b, c) in setABC, d in setD : a + c = d }; s.t. C1 {(a, b, c) in setABC} : VarX[a, b, c] = sum{(a, b, c, d) in setABCD} ParamX[a, b, c, d]; s.t. C2 {(a, b, c) in setABC} : VarX[a, b, c] = -sum{(a, b, c, d) in setABCD} ParamY[a, b, c, d]; So, when executing the s.t. line of C1, if setABC has not yet been used, does it get instantiated before C1 gets to use it, or is the code '(a, b, c) in setABC' effectively now an alias for: {a in setA, b in setB, c in setC : a * c 10} such that it's use in the C2 constraint does not get the benefit of the cached result? In a similar vein, is there a more efficient method to sum over common indices? In other words, the fact that a, b, and c are already set in the loop for '(a, b, c, d) in setABCD'? As I understand the pseudo-code above, those lines translate to something like { s := 0 for all (da, db, dc, d) in setABCD do { # da = dummy a if a == da and b == db and c == dc then s := s + ParamX[a, b, c, d] } } If this is case, would it behoove to me create my own specific cache subsets, like # return sets of (a,b,c) that return d in setABCD set D_ABC{(a, b, c) in setABC} := setof{(a,b,c,d) in setABCD} d; And then use as: s.t. C1 {(a, b, c) in setABC} : VarX[a, b, c] = sum{d in setD_ABC[a, b, c]} ParamX[a, b, c, d]; Many thanks for your input, Andrew! Kevin ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] out of domain
Hello Daniele, set K; data; set K := 0..Deadline ; end; defines that K is a set containing one string with value 0..Deadline. There is no operator .. available in the data section. Might it be that you wanted to write something like: set SLA; param Deadline{SLA}; set K{i in SLA} := {0..Deadline[i]}; solve; display K; data; set SLA := A17 A18 A25; param Deadline := A17 32 A18 40 A25 44 ; end; Best regards Xypron Original-Nachricht Datum: Tue, 3 Jul 2012 23:15:39 +0200 Von: Daniele Micarelli danielemicare...@gmail.com An: help-glpk@gnu.org Betreff: [Help-glpk] out of domain Hi, i have this bond: *subject to DLINE{i in SLA}: sum{t in K} x[i,t]=1 ; */* vincolo di Deadline sulle SLA */ in the file.mod where the set K is defined as: *set K := 0..Deadline ; *in the file.dat * *Deadline is a parameter defined in the file.dat : *param Deadline := A17 32 A18 40 A25 44 ;* When A17,A18 and A25 are activities and 32,40 and 44 are the values of the corresponding deadline But when i try i get this error: x[A17, 0..Deadline] out of domain what it means? how can i fix it? thank you very much ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] cannot convert 1..720 to floatin-point number
Dear Daniele, the data section does not allow the same syntax as the model section. Please read chapter 5.2 Set data block of glpk-4.47/doc/gmpl.pdf You could write: param tmax; set T:= {1..tmax}; data; param tmax := 720; end; Best regards Xypron Original-Nachricht Datum: Mon, 2 Jul 2012 22:50:48 +0200 Von: Daniele Micarelli danielemicare...@gmail.com An: help-glpk@gnu.org Betreff: [Help-glpk] cannot convert 1..720 to floatin-point number Hi in the file.MOD i declare the set T set T; I wrote in the file.dat set T: = 1 .. 720; but when i try i get the error: *cannot convert 1..720 to floatin-point number * What should I do? If needed I can attach file.mod file.dat complete thank you very much ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] pick element from set?
Hello Kevin, there is no function that will return an element of a set (except for one-dimensional numeric sets). You can create subsets. e.g. set X, dimen 2 := {(5, 7), (1, 10), (23, -3), (y, x), (a, abc)}; set S := setof{(i,j) in X : forall{(k,l) in X} i =k j = l} (i,j); see http://en.wikibooks.org/wiki/GLPK/GMPL_Workarounds#Sorted_output Best regards Xypron Original-Nachricht Datum: Sun, 01 Jul 2012 03:11:00 -0400 Betreff: [Help-glpk] pick element from set? Hello GLPK List, Is there a method to pick an arbitrary single item from a set? I don't care which one, but I need to have a single element from a set such that I can uniquely and consistently identify it. There is no order to the set, but /if/ there were an ordering to this set, I might reference this element as nought. Put differently, say I have a set X: set X, dimen 2 := {(5, 7), (1, 10), (23, -3), (y, x), (a, abc)}; Is there functionality -- say a function called pick() -- to pick an arbitrary element from that set? Put another way, /if/ I could put that set into a list: list(X) == [(5, 7), (1, 10), (23, -3), (y, x), (a, abc)] then I could get an arbitrary element, perhaps like 'get(list(X), 0)'. Is there a method to grab a single element from the set? I'll point out that I have an ad-hoc method of this for a single-dimensional set (using a nested setof structure and a comparison operator), but can't do it for any higher-dimensionality sets. Thanks, Kevin ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] post-processing without defined variables?
Hello Kevin, either you can use the GLPK library from another programming language (C, Java, ...) or you can use scripting around glpsol, cf. http://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg Best regards Xypron Original-Nachricht Datum: Sat, 30 Jun 2012 19:52:41 -0400 Betreff: [Help-glpk] post-processing without defined variables? Hello GLPK List, I see from the GLPK Wikibook that there's no ability to create reporting variables (err, just learned that others call them defined variables). https://en.wikibooks.org/wiki/GLPK/GMPL_Workarounds#Mimicking_an_AMPL_defined_variable I want to explore the last sentence in that section (But you can use a structural variable and a constraint instead to achieve the same effect — the downside being that this formulation may render your problem harder to solve). The models that I'm working with are necessarily large (roughly 1e5 [C] x 1e5 [R], give or take an order of magnitude depending on the input), and I'd like to avoid adding any more variables to the solver's matrix. Given that I can't create constraints /after/ a solve statement (i.e. to re-solve starting from the previous solution), does that mean that my only option is a post-GMPL step with another tool (e.g. C, Perl, Python)? Thanks, Kevin ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] manipulating parameter indices
Hello Kevin, try the following: set EFF, dimen 5; set inputs := setof{(i,p,v,o,e) in EFF}i; set process := setof{(i,p,v,o,e) in EFF}p; set vintage := setof{(i,p,v,o,e) in EFF}v; set outputs := setof{(i,p,v,o,e) in EFF}o; set S := setof{(i,p,v,o,e) in EFF} (i,p,v,o); param eff{(i,p,v,o) in S} := sum{(i,p,v,o,e) in EFF}e; solve; display eff; data; set EFF := # input processvintage output efficieny coal coal_pp2015electricity 0.4 uranium nuclear_pp 2015electricity 0.4 sunlight passive_solar 2020heat0.6; end; Best regards Xypron Original-Nachricht Datum: Fri, 29 Jun 2012 15:12:19 -0400 Betreff: [Help-glpk] manipulating parameter indices Hello GLPK list, Is there a method for collecting user-specified parameter indices into an n-dimensional set? I'm trying to reduce the amount of knobs I have to twiddle on a model with which I'm working, and it dawned on my that I have a parameter whose /indices/ contain valuable information that the rest of my model could use. For the sake of argument, this model has the notion of inputs, processes, and outputs, where the processes convert inputs to outputs. However, processes only operate on 1 or 2 inputs, and only create 1 or 2 outputs. Thus, it would be highly beneficial to automatically create sparse index sets, if for no other reason than helping to check my typing ability. Consider these 5 sets: set periods := 2015 2020 2025 2030 ; set vintage := 2015 2020 2025 2030 ; set inputs := coal oil uranium sunlight gasoline diesel electricity ; set outputs := electricity gasoline diesel heat miles ; set processes := coal_pp diesel_pp solar_pp nuclear_pp refinery passive_solar electric_heat gas_car diesel_car; I might tie these together in my model through an efficiency parameter: param eff{i in inputs, p in process, v in vintage, o in outputs} := coal coal_pp2015 electricity 0.4 uranium nuclear_pp 2015 electricity 0.4 sunlight passive_solar 2020 heat 0.6 ; While it makes sense for a coal power plant to take coal as input, and produce electricity, it does not makes sense for a diesel_car to take take heat and produce sunlight. Consequently, that combination does not exist in the eff parameter indices. Rather than create an explicit 3-dimensional set that I must manually populate, only to turn around and manually specify the same set for each index in the eff parameter indices, is it possible to harvest the information contained in the parameter indices? I might use this to automatically generate the set of valid indices over which, say, the usable life of each process might be: param usable_life {(p,v) in valid_processes} default 30 := coal_pp 2015 15 coal_pp 2020 17 # GLPK would ostensibly provide an error # message because the eff parameter does # not have the coal_pp, 2017 tuple in # the (p,v) subset of it's indices. ; Does this functionality exist in GLPK? I know at least one other modeling system that provides for it, so I'm hoping that I've just missed something in the gmpl.pdf documentation. Thanks, Kevin ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] glpsol.exe differs from AMPL
Hello Michael, AMPL is not a solver but an interface to a solver. Hence it is unclear which solver you are comparing GLPK to, might be IBM Ilog Cplex. Both GLPK as well as IBM Ilog Cplex will provide **any** of the optimal MIP or LP solutions if successful. Hence the result is correct. A model which has a lot of symmetries is very inefficient to solve. You should try to add additional constraints that force the solution of your problem to be unique. Best regards Xypron Original-Nachricht Datum: Wed, 27 Jun 2012 17:10:47 -0400 Betreff: glpsol.exe differs from AMPL Hello: I am running glpk MIP and in AMPL and finding that the order of the solutions differ. For example, say I have a model where I need to maximize an objective based upon paired values X, Y, and Z (and each pairing has a score). I am not using any additional options for the solutions, eg specifying branchcut, etc. AMPL will tell me that the solution is X, Y, Z glpk will tell me the solution is Z, X, Y. I note that the sum of the scores for each solution is equivalent (as it should be as addition is commutative). The problem I am trying to reconcile is is there a physical difference between ordering objects X, then Y, then Z with the order of Z, then X, then Y? Not sure if this is clear to everyone, but the main point is I see differences. Michael Bramley -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] [Fwd: GLPK]
Hello María, your message had to be forwarded manually to the GLPK help list because you are not subscribed, cf. https://lists.gnu.org/mailman/listinfo/help-glpk The output you provided indicates a problem in the interface between yalmip and glpkmex, cf. http://www.mathworks.de/support/solutions/en/data/1-18IIZ/ http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Solvers.GLPK indicates some problems that may arise due to incorrect installation. If this does not solve your problem, you should address it to the makers of yalmip, which you already started to do: http://sedumi.ie.lehigh.edu/index.php?option=com_kunenaItemid=78func=viewcatid=19id=6835limit=6limitstart=6#6843 In that message you indicated that you tried to install GLPK from source and it was unclear to you how to proceed. Please, read http://en.wikibooks.org/wiki/GLPK/Windows I suggest you download a precompiled version of GLPK, e.g. from http://winglpk.sourceforge.net Best regards Xypron Forwarded Message From: María López Quijorna maria_lquijo...@hotmail.com To: bug-g...@gnu.org Subject: GLPK Date: Tue, 26 Jun 2012 14:33:45 +0200 Hello¡ I am María, a student: I`ve installed the LP solver GLPK, (also I have sedumi and YALMIP, the latest version respectively ,and MATLAB R2012a (I think is also the latest version)). My problem is the next, I can use correctly sedumi and YALMIP, but then when I install the LP solver GLPK , all stops work ( I mean yalmip give all the time NaN). I think there is a problem with the LP solver, but I really do not know. I have this information ( thanks to the yalmiptest) maybe it can help you: | Test| Solution| Solver message| | sdpvar/set methods| N/A| Successfully solved (YALMIP)| | LP| N/A| Unknown problem in solver (try using 'debug'-flag in sdpsettings) (Attempt to execute SCRIPT glpkmex as a function: C:\Users\María\Desktop\glpkmex\glpkmex.m)| | LP| N/A| Unknown problem in solver (try using 'debug'-flag in sdpsettings) (Attempt to execute SCRIPT glpkmex as a function: C:\Users\María\Desktop\glpkmex\glpkmex.m)| | QP| Correct| Successfully solved (SeDuMi-1.3)| | QP| Correct| Successfully solved (SeDuMi-1.3)| | SOCP| Correct| Successfully solved (SeDuMi-1.3)| | SOCP| Correct| Successfully solved (SeDuMi-1.3)| | SOCP| Correct| Successfully solved (SeDuMi-1.3)| | SDP| Correct| Successfully solved (SeDuMi-1.3)| | SDP| Correct| Successfully solved (SeDuMi-1.3)| | SDP| Correct| Successfully solved (SeDuMi-1.3)| | SDP| Correct| Successfully solved (SeDuMi-1.3)| | MAXDET| Correct| Successfully solved (SeDuMi-1.3)| | MAXDET| Correct| Successfully solved (SeDuMi-1.3)| | Infeasible LP| N/A| Unknown problem in solver (try using 'debug'-flag in sdpsettings) (Attempt to execute SCRIPT glpkmex as a function: C:\Users\María\Desktop\glpkmex\glpkmex.m)| | Infeasible QP| N/A| Infeasible problem (SeDuMi-1.3)| | Infeasible SDP| N/A| Infeasible problem (SeDuMi-1.3)| | Moment relaxation| Correct| Successfully solved (SeDuMi-1.3)| | Sum-of-squares| Correct| Successfully solved (SeDuMi-1.3)| | Bilinear SDP| N/A| No suitable solver| Do you know what it is happenig? Thanks a lot of in advance ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] help
Hello Daniele, the following model contains a constraint of the type you refer to. Please, read glpk-4.47/doc/gmpl.pdf carefully. It is included in the source distribution of GLPK available at ftp://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz param R; param T; param t; set Q := { 1..T }; set W; param r{W}; param d{W}; var x{W,Q}, = 0, =10; maximize objective: sum{i in W, q in Q} x[i,q]; s.t. constraint: sum{i in W} sum{q in Q : q = t-d[i] q = t-1} r[i] * x[i,q] = R; data; set W := a b; param R := 10; param T := 5; param t := 6; param d := [a] 2 [b] 3; param r := [a] .5 [b] .7; end; Best regards Xypron Original-Nachricht Datum: Wed, 27 Jun 2012 11:02:27 +0200 Betreff: Re: [Help-glpk] help Re: [Help-glpk] help I have attached the image so it is clearer W is a set of tasks T is the set of the time allowed r (i) is the parameter of the requested resource the activity i-th d (i) is the duration of the i-th activity R is the parameter that represents the total resource available in the system X (i, q) is the variable Thanks 2012/6/27 glpk xypron xypron.g...@gmx.de Hello Daniele, from your description it is unclear what you mean by t. Is t the run parameter of the summation or is it a parameter controlling the boundaries of the summation? It cannot be both. Please, write down your equation completely including the definition of the sets and parameters. Either send it in tex or append an image file. Best regards Xypron Original-Nachricht Datum: Tue, 26 Jun 2012 23:46:10 +0200 Betreff: Re: [Help-glpk] help Re: [Help-glpk] help r (i) is a parameter and represents the resource request from the i-th activities by the system. The variable is x (i, t) where i is the index of the activities of the whole W and t is the index of the time interval. R is the total available resource is not exceeded while d (i) is the duration of the i.th activity On Tue, 26 Jun 2012, Daniele Micarelli wrote: I have to solve a linear programming problem with the language and I'm planning mathprog I have difficulty writing the following constraint: ΣΣ r (i) * x (i, t) = R where the first summation is true for all belonging to the W and the second summation has as its lower end t-d(i) and upper bound as t-1 You've not made it clear what is a variable and what is not. If r and x are both variables, you are done. *Linear* programming does not involve products of variables. -- -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] help
Hello Daniele, sorry got it wrong. param R; param T; set W; param r{W}; param d{W}; set Q{i in W} := {1-d[i]..T-1}; var x{i in W, Q[i]}, = 0; maximize objective: sum{i in W, q in Q[i]} x[i,q]; s.t. constraint{t in {1..T}}: sum{i in W} sum{q in Q[i]} r[i] * x[i,q] = R; data; set W := a b; param R := 10; param T := 5; param d := [a] 2 [b] 3; param r := [a] .5 [b] .7; end; Best regards Xypron Original-Nachricht Datum: Thu, 28 Jun 2012 06:22:13 +0200 Betreff: Re: [Help-glpk] help Hello Daniele, the following model contains a constraint of the type you refer to. Please, read glpk-4.47/doc/gmpl.pdf carefully. It is included in the source distribution of GLPK available at ftp://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz param R; param T; param t; set Q := { 1..T }; set W; param r{W}; param d{W}; var x{W,Q}, = 0, =10; maximize objective: sum{i in W, q in Q} x[i,q]; s.t. constraint: sum{i in W} sum{q in Q : q = t-d[i] q = t-1} r[i] * x[i,q] = R; data; set W := a b; param R := 10; param T := 5; param t := 6; param d := [a] 2 [b] 3; param r := [a] .5 [b] .7; end; Best regards Xypron Original-Nachricht Datum: Wed, 27 Jun 2012 11:02:27 +0200 Betreff: Re: [Help-glpk] help Re: [Help-glpk] help I have attached the image so it is clearer W is a set of tasks T is the set of the time allowed r (i) is the parameter of the requested resource the activity i-th d (i) is the duration of the i-th activity R is the parameter that represents the total resource available in the system X (i, q) is the variable Thanks 2012/6/27 glpk xypron xypron.g...@gmx.de Hello Daniele, from your description it is unclear what you mean by t. Is t the run parameter of the summation or is it a parameter controlling the boundaries of the summation? It cannot be both. Please, write down your equation completely including the definition of the sets and parameters. Either send it in tex or append an image file. Best regards Xypron Original-Nachricht Datum: Tue, 26 Jun 2012 23:46:10 +0200 Betreff: Re: [Help-glpk] help Re: [Help-glpk] help r (i) is a parameter and represents the resource request from the i-th activities by the system. The variable is x (i, t) where i is the index of the activities of the whole W and t is the index of the time interval. R is the total available resource is not exceeded while d (i) is the duration of the i.th activity On Tue, 26 Jun 2012, Daniele Micarelli wrote: I have to solve a linear programming problem with the language and I'm planning mathprog I have difficulty writing the following constraint: ΣΣ r (i) * x (i, t) = R where the first summation is true for all belonging to the W and the second summation has as its lower end t-d(i) and upper bound as t-1 You've not made it clear what is a variable and what is not. If r and x are both variables, you are done. *Linear* programming does not involve products of variables. -- -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] help
Hello Daniele, from your description it is unclear what you mean by t. Is t the run parameter of the summation or is it a parameter controlling the boundaries of the summation? It cannot be both. Please, write down your equation completely including the definition of the sets and parameters. Either send it in tex or append an image file. Best regards Xypron Original-Nachricht Datum: Tue, 26 Jun 2012 23:46:10 +0200 Betreff: Re: [Help-glpk] help Re: [Help-glpk] help r (i) is a parameter and represents the resource request from the i-th activities by the system. The variable is x (i, t) where i is the index of the activities of the whole W and t is the index of the time interval. R is the total available resource is not exceeded while d (i) is the duration of the i.th activity On Tue, 26 Jun 2012, Daniele Micarelli wrote: I have to solve a linear programming problem with the language and I'm planning mathprog I have difficulty writing the following constraint: ΣΣ r (i) * x (i, t) = R where the first summation is true for all belonging to the W and the second summation has as its lower end t-d(i) and upper bound as t-1 You've not made it clear what is a variable and what is not. If r and x are both variables, you are done. *Linear* programming does not involve products of variables. -- -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Some question about installing GLPK for Java in Linux
Dear Chung, You got this error: Exception in thread main java.lang.UnsatisfiedLinkError: /home/mrcupids/libglpk-java-1.0.21/swig/.libs/libglpk_java.so.0.32.0: libglpk.so.0: cannot open shared object file: Where did you install libglpl.so.0? (It should be in /usr/lib or /usr/local/lib.) Did you run /sbin/ldconfig after installing GLPK? Best regards Xypron Original-Nachricht Datum: Thu, 21 Jun 2012 17:00:48 +0800 Betreff: [Help-glpk] Some question about installing GLPK for Java in Linux Dear Author , I met some question about using this in server. I followed the web page http://glpk-java.sourceforge.net/gettingStarted.html to get started. However when I wanted to install this in Linux (Fedora 14 64bit), it failed again. GLPK for Java Download GLPK for Java from https://sourceforge.net/projects/glpk-java/files/. Unzip the archive with: tar -xzf glpk-java-1.0.21.tar.gz Make and install with: cd glpk-java-1.0.21 ./configure make make check sudo make install When I typed make , the information is below (It looks fine!) [mrcupids@SCOPE libglpk-java-1.0.21]$ make make all-recursive make[1]: Entering directory `/home/mrcupids/libglpk-java-1.0.21' Making all in doc make[2]: Entering directory `/home/mrcupids/libglpk-java-1.0.21/doc' gzip -c libglpk-java.3 libglpk-java.3.gz make[2]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21/doc' Making all in swig make[2]: Entering directory `/home/mrcupids/libglpk-java-1.0.21/swig' mkdir -p target/classes mkdir -p target/apidocs mkdir -p src/c mkdir -p src/main/java/org/gnu/glpk cp *.java src/main/java/org/gnu/glpk /usr/bin/swig -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib/jvm/java-1.6.0-openjdk. x86_64/include/linux -I/usr/include -I/usr/local/include -java -package org.gnu.glpk \ -o src/c/glpk_wrap.c -outdir src/main/java/org/gnu/glpk glpk.i /bin/sh ../libtool --mode=compile gcc -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib /jvm/java-1.6.0-openjdk.x86_64/include/linux -I/usr/include -I/usr/local/include -I. -c -fPIC \ src/c/glpk_wrap.c libtool: compile: gcc -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib/jvm/java-1.6.0 -openjdk.x86_64/include/linux -I/usr/include -I/usr/local/include -I. -c -fPIC src/c/glpk_wrap.c -fPIC -DPIC -o .libs/glpk_wrap.o libtool: compile: gcc -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib/jvm/java-1.6.0 -openjdk.x86_64/include/linux -I/usr/include -I/usr/local/include -I. -c -fPIC src/c/glpk_wrap.c -o glpk_wrap.o /dev/null 21 /bin/sh ../libtool --mode=link \ gcc -version-info 32:0:32 -revision 1.0.21 \ -g -O -o libglpk_java.la -rpath /usr/local/lib/jni glpk_wrap.lo -lglpk libtool: link: rm -fr .libs/libglpk_java.a .libs/libglpk_java.la.libs/libglpk_java.lai .libs/li bglpk_java.so .libs/libglpk_java.so.0 .libs/libglpk_java.so.0.32.0 libtool: link: gcc -shared .libs/glpk_wrap.o -lglpk-Wl,-soname -Wl,libglpk_java.so.0 -o .l ibs/libglpk_java.so.0.32.0 libtool: link: (cd .libs rm -f libglpk_java.so.0 ln -s libglpk_java.so.0.32.0 libglp k_java.so.0) libtool: link: (cd .libs rm -f libglpk_java.so ln -s libglpk_java.so.0.32.0 libglpk_ java.so) libtool: link: ar cru .libs/libglpk_java.a glpk_wrap.o libtool: link: ranlib .libs/libglpk_java.a libtool: link: ( cd .libs rm -f libglpk_java.la ln -s ../ libglpk_java.la libglpk_jav a.la ) /usr/bin/javadoc -sourcepath ./src/main/java org.gnu.glpk -d ./target/apidocs Loading source files for package org.gnu.glpk... Constructing Javadoc information... Standard Doclet version 1.6.0_20 Building tree for all the packages and classes... Generating ./target/apidocs/org/gnu/glpk//_glp_arc.html... Generating ./target/apidocs/org/gnu/glpk//_glp_graph.html... Generating ./target/apidocs/org/gnu/glpk//_glp_java_arc_data.html... Generating ./target/apidocs/org/gnu/glpk//_glp_java_vertex_data.html... Generating ./target/apidocs/org/gnu/glpk//_glp_vertex.html... Generating ./target/apidocs/org/gnu/glpk//glp_attr.html... Generating ./target/apidocs/org/gnu/glpk//glp_bfcp.html... Generating ./target/apidocs/org/gnu/glpk//glp_cpxcp.html... Generating ./target/apidocs/org/gnu/glpk//glp_data.html... Generating ./target/apidocs/org/gnu/glpk//glp_iocp.html... Generating ./target/apidocs/org/gnu/glpk//glp_iptcp.html... Generating ./target/apidocs/org/gnu/glpk//glp_long.html... Generating ./target/apidocs/org/gnu/glpk//glp_mpscp.html... Generating ./target/apidocs/org/gnu/glpk//glp_prob.html... Generating ./target/apidocs/org/gnu/glpk//glp_smcp.html... Generating ./target/apidocs/org/gnu/glpk//glp_tran.html... Generating ./target/apidocs/org/gnu/glpk
Re: [Help-glpk] Some question about installing GLPK for Java in Linux
Hello Chung I check in my java folder /usr/java/jdk1.6.0_33/include . It has this file and my JAVA_HOME also setuped this path. export JAVA_HOME=/usr/java/jdk1.6.0_33 Best regards Xypron Original-Nachricht Datum: Thu, 21 Jun 2012 19:43:11 +0800 Betreff: Re: [Help-glpk] Some question about installing GLPK for Java in Linux Dear all , now I change the java version to sun-version java version 1.6.0_33 Java(TM) SE Runtime Environment (build 1.6.0_33-b03) Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode) and tried to re-installed libglpk-java. But when I setuped configure , it occured that checking jni.h usability... no checking jni.h presence... no checking for jni.h... no Where does this file should be ? I check in my java folder /usr/java/jdk1.6.0_33/include . It has this file and my JAVA_HOME also setuped this path. Do I miss something here? Or I made other stupid mistake? Thank you! Best regards Chung Yi -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Doxygen
Dear Andrew, please, find appended an archive with the Doxygen configuration file. It should be placed in the root directory of the distribution, e.g. as glpk-4.48/Doxyfile To create the documentation the packages doxygen and graphviz are needed. Just go to the directory with Doxyfile and execute doxygen. The doxygen documentation will be created in glpk-4.48/doc/doxygen. Please, adjust the following line according to the release number: PROJECT_NUMBER = 4.47 I was confused by cross reference You can navigate from to the code and will find links inside the code, e.g. in line 489 of http://www.xypron.de/projects/winglpk/doxygen/html/glpapi12_8c_source.html#l00489 you can navigate to the documentation of xerror and from there to the declaration in glpenv.h, from there to the documentation of glp_error_, Best regards Xypron On 19.06.2012 16:59, Andrew Makhorin wrote: I was confused by cross reference - these diagrams are usually called call graphs. Okay, please post me the doxygen configuration file and please teach me how I should include it in the distribution. (It seems to me that there exists a standard posix utility that does the same job.) Andrew Makhorin Doxyfile.gz Description: application/tgz ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk
Re: [Help-glpk] Doxygen
Hello Robbie, I take it that applying 'doxygen' retrospectively to a project like GLPK would require a major effort. Is that what is being proposed by xypron? I did not request to change any existing GLPK code. I did not suggest to replace the existing documentation. I just suggested to add a doxygen configuration file which allows the person interested to easily apply doxygen to generate a cross referenced code listing and documentation. An example of the output produced is http://www.xypron.de/projects/winglpk/doxygen/html/glpk_8h.html#afb1c0fb8674d9d9680ec9c42f922176b With the links provided you can easily find out - in which C file a function is coded - the call hierarchy You can easily navigate between the functions. I set up the configuration file in a way that it makes use of the existing comments of Andrew's coding. Best regards Xypron -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a ___ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk