Re: [Help-glpk] Optimization and Multicore GLPK

2012-12-24 Thread glpk xypron
Hello Reg, == Profiling == Profiling GLPK could give very valuable ideas how to speed up the code. Oprofile is a useful tool for doing the work. See http://oprofile.sourceforge.net == Parallelization == Before thinking about parellization it would be necessary to attack the very same design

Re: [Help-glpk] Multithreading/parallelization

2012-12-15 Thread glpk xypron
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

Re: [Help-glpk] Multithreading/parallelization

2012-12-15 Thread glpk xypron
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

Re: [Help-glpk] Multithreading/parallelization

2012-12-15 Thread glpk xypron
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

Re: [Help-glpk] Multithreading/parallelization

2012-12-15 Thread glpk xypron
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

Re: [Help-glpk] glpk.js

2012-12-10 Thread glpk xypron
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

Re: [Help-glpk] Indexing a subset from 1..n

2012-11-27 Thread glpk xypron
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}; #

Re: [Help-glpk] MIP Solvers (i.e CBC, CPLEX, GLPK, GUROBI, LPSOLVE, SCIPC, SCIPL, SCIPS and XPRESS) Benchmark

2012-11-17 Thread glpk xypron
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

Re: [Help-glpk] A MathProg question

2012-11-13 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: .run file equivalent in GLPK?]

2012-11-05 Thread glpk xypron
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

Re: [Help-glpk] order restrictions

2012-11-01 Thread glpk xypron
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.

[Help-glpk] Tomlin-Driebeek heuristic

2012-11-01 Thread glpk xypron
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},

Re: [Help-glpk] Tomlin-Driebeek heuristic

2012-11-01 Thread glpk xypron
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

Re: [Help-glpk] libglpk-java

2012-10-28 Thread glpk xypron
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

Re: [Help-glpk] Printing non-zero parts of a solution matrix

2012-10-19 Thread glpk xypron
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

Re: [Help-glpk] CSV buffer limits

2012-10-17 Thread glpk xypron
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 :=

Re: [Help-glpk] Specifying a constraint in CPLEX notation

2012-10-04 Thread glpk xypron
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

Re: [Help-glpk] Get number of columns from callback routine

2012-09-20 Thread glpk xypron
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);

Re: [Help-glpk] Newbie questions encouraged?

2012-09-16 Thread glpk xypron
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

Re: [Help-glpk] Aborting a long-running algorithm in GLPK

2012-09-11 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: Specify initialization for MIP]

2012-09-09 Thread glpk xypron
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

Re: [Help-glpk] Profiler for glpsol

2012-09-07 Thread glpk xypron
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

Re: [Help-glpk] financial compensation

2012-09-05 Thread glpk xypron
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;

Re: [Help-glpk] C API: Setting up a least-absolute-deviation

2012-09-05 Thread glpk xypron
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

Re: [Help-glpk] Parallelisation of MILP

2012-09-04 Thread glpk xypron
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 -

Re: [Help-glpk] C API: Setting up a least-absolute-deviation problem

2012-09-01 Thread glpk xypron
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

Re: [Help-glpk] Concatenate Parameter Fields Question

2012-08-31 Thread glpk xypron
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,

Re: [Help-glpk] [Fwd: Implementation problems]

2012-08-30 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: Implementation problems]

2012-08-30 Thread glpk xypron
? 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

Re: [Help-glpk] Compiling GLPK project in Ubuntu / Linux (was ---no subject)

2012-08-26 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: Re: [No Memory Available Error]]

2012-08-18 Thread glpk xypron
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

Re: [Help-glpk] verify equation

2012-08-15 Thread glpk xypron
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)

Re: [Help-glpk] [Fwd: No Memory Available Error]

2012-08-15 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: GLPK Implementation help]

2012-08-02 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: GLPK Implementation help]

2012-07-31 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: glpsol not converging]

2012-07-31 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: glpsol not converging]

2012-07-31 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: Problem with GLPK when trying to find value functions]

2012-07-26 Thread glpk xypron
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,

Re: [Help-glpk] presolving

2012-07-24 Thread glpk xypron
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:

Re: [Help-glpk] Single index for multidimensional sets

2012-07-17 Thread glpk xypron
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.

Re: [Help-glpk] problem with parameter

2012-07-16 Thread glpk xypron
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 ...

Re: [Help-glpk] glp_malloc: no memory available

2012-07-16 Thread glpk xypron
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.

Re: [Help-glpk] set of commands

2012-07-12 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: GLPK NOT FUNCTIONING ON MY SYSTEM]

2012-07-11 Thread glpk xypron
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

Re: [Help-glpk] How did you rewrite the cplex API?

2012-07-08 Thread glpk xypron
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

Re: [Help-glpk] Retrieving Solution Values

2012-07-08 Thread glpk xypron
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

Re: [Help-glpk] Huge Parameter Sets

2012-07-06 Thread glpk xypron
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

Re: [Help-glpk] Problem Has no Primal Feasible Solution

2012-07-06 Thread glpk xypron
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

Re: [Help-glpk] manipulating parameter indices

2012-07-04 Thread glpk xypron
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

Re: [Help-glpk] out of domain

2012-07-03 Thread glpk xypron
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} :=

Re: [Help-glpk] cannot convert 1..720 to floatin-point number

2012-07-02 Thread glpk xypron
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:

Re: [Help-glpk] pick element from set?

2012-07-01 Thread glpk xypron
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

Re: [Help-glpk] post-processing without defined variables?

2012-07-01 Thread glpk xypron
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

Re: [Help-glpk] manipulating parameter indices

2012-06-29 Thread glpk xypron
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} :=

Re: [Help-glpk] glpsol.exe differs from AMPL

2012-06-27 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: GLPK]

2012-06-27 Thread glpk xypron
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.

Re: [Help-glpk] help

2012-06-27 Thread glpk xypron
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

Re: [Help-glpk] help

2012-06-27 Thread glpk xypron
) 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

Re: [Help-glpk] help

2012-06-26 Thread glpk xypron
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.

Re: [Help-glpk] Some question about installing GLPK for Java in Linux

2012-06-21 Thread glpk xypron
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

Re: [Help-glpk] Some question about installing GLPK for Java in Linux

2012-06-21 Thread glpk xypron
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]

Re: [Help-glpk] Doxygen

2012-06-18 Thread glpk xypron
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

Re: [Help-glpk] [Fwd: Re: Some question about GLPK for Java]

2012-06-14 Thread glpk xypron
Dear Chung, 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 java -Djava.library.path=C:Program Files\GLPK\glpk-4.47\w64 Test Unfortunately the error message contains chinese letters, hence I do not

Re: [Help-glpk] glpk help

2012-06-13 Thread glpk xypron
Dear Sajal, GLPK comes both with the standalone solver GLPK as well as with a library which you can call from your own program written in C, C++, Java, or some other languages (cf. http://en.wikibooks.org/wiki/GLPK). As described in glpk-4.47/doc/glpk.pdf, chapter 5 you can use a callback

Re: [Help-glpk] Absolute Value

2012-05-29 Thread glpk xypron
Hello Asma, How to express |A-B|=C for glpsol ? A,B and C are a boolean variables A + B + C =2 A + B - C =0 Best regards Xypron Original-Nachricht Datum: Tue, 29 May 2012 10:39:10 +0100 (BST) Betreff: [Help-glpk] Absolute Value Hello everybody,   How to express

Re: [Help-glpk] The conflict graph is either empty or too big

2012-05-14 Thread glpk xypron
Hello, looking at your model, I would suggest considering the following solution approaches: - a time windowing heuristic, which will try to find a solution for a first time windows, fixes the solution for a first part of the time windows and then moves the window for which a solution is

Re: [Help-glpk] Having trouble specifying a constraint: syntax error in literal set

2012-05-11 Thread glpk xypron
Hello Joel, the error must be in another line. Have a look at your definitions of the sets. The following model does not create a syntax error: set Campaigns:= {1..5}; set D:= {1..31}; set P:= { A, B, C}; set CampProd, dimen 2 := { (1,A), (2,B), (3,C), (4,A), (5,B) }; set ProdDay, dimen 2 := {

Re: [Help-glpk] [Fwd: GLPK 4.38 Re-entrancy 64-bit windows]

2012-05-11 Thread glpk xypron
Hello Nicholas, your message had to be forwarded manually because you are not subscribed to the GLPK help list. No version of GLPK is thread safe. The current version of GLPK is 4.47. Best regards Xypron Forwarded Message Subject: GLPK 4.38 Re-entrancy 64-bit windows

Re: [Help-glpk] [Fwd: Calling GLPK with VBA Excel ?]

2012-05-11 Thread glpk xypron
Hello Samir, your message had to be forwarded manually, because you are not subscribed to the GLPK help list, cf. https://lists.gnu.org/mailman/listinfo/help-glpk VBA offers command SHELL to call another program. You can use this to call glpsol, cf.

Re: [Help-glpk] Generate data section files for model (in GNU MathProg or other languages)

2012-05-10 Thread glpk xypron
Hello Tony, For the use of the printf command, the fact is that I find it not very flexible. Indeed, I have to write in plain text what I want to write as param. The syntax is different when the param is a simple list of records or when it is tabbing data. See example: # Outputing results as

Re: [Help-glpk] Generate data section files for model (in GNU MathProg or other languages)

2012-05-09 Thread glpk xypron
Hello Tony, GMPL data files can be easily created with any tool that can output text files, cf. http://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg You could use the printf command of GMPL to create data files. When many data shall be used with the same model, I personally would use a

Re: [Help-glpk] [Fwd: binary variable]

2012-04-30 Thread glpk xypron
Hello Sagor, your mail had to be forwarded manually to the help list, because you are not subscribed, see https://lists.gnu.org/mailman/listinfo/help-glpk How can I say that some variable is binary in glpk? Please, read the documentation accompanying the GLPK source distribution, which is

Re: [Help-glpk] fraction with vars

2012-04-27 Thread glpk xypron
Hello Kasper, see example below. Best regards Xypron # Solve # x = p * y / w # where x, y, w are natural numbers and # p = 11 / 17 # x in [23, 100] # y in [10, 200] # w in [3, 7] param eps := 1E-5; param M := 1000; param w_min := 3; param w_max := 7; param p := 11 / 17; set I :=

Re: [Help-glpk] Building a graph on the fly

2012-04-17 Thread glpk xypron
Hello Sylvain, glp_arc and glp_vertex both have a field data in which information like double a_cap; // arc capacity double a_cost; // arc cost double a_low; // lower bound double a_x; // arc flow int v_cut; // 0: node is unlabelled, 1: node is labelled double v_pi; // node potential double

Re: [Help-glpk] What is the correct citation for MathProg, glpsol and GLPK?

2012-04-17 Thread glpk xypron
Hello Rafael, see http://lists.gnu.org/archive/html/help-glpk/2009-04/msg00063.html Best regards Xypron -- Follow me at http://twitter.com/#!/xypron NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren:

[Help-glpk] Stop criterion

2012-04-13 Thread glpk xypron
Hello Andrew, for assigment problems where the objective can only be integer the lower bound of each node in the search tree can always be rounded to the next lower/higher integer (depending on optimization direction). Probably automatic identification is difficult. It would be great if you

Re: [Help-glpk] [Fwd: Help Needed]

2012-04-11 Thread glpk xypron
Hello Robbie, said Classpath Exception reads: As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and

Re: [Help-glpk] Linker error while compiling with glpk.h

2012-04-10 Thread glpk xypron
Hello Psalm, after installing a new library like libglpk.so in /usr/lib or /usr/local/lib you may have to call sudo ldconfig to ensure that the library will be found. Cf. http://en.wikibooks.org/wiki/GLPK/Linux_OS Best regards Xypron Original-Nachricht Datum: Tue, 10 Apr

Re: [Help-glpk] [Fwd: Help Needed]

2012-04-10 Thread glpk xypron
Hello Noli, GLPK Java is currently licensed under GPL v3. I could (and would be willing to) offer GLPK Java under a less restrictive license if the GLPK license were less restrictive. Actually the license of GLPK does not even allow it to be dynamically linked to any software that is not

Re: [Help-glpk] Excecution Error

2012-04-06 Thread glpk xypron
Hello Esma, an error occured in function void chuzc(struct csa *csa, double rtol) when choosing a non-basic column. If you are calling the simplex solver directly you could try settting glp_smcp-r_test = GLP_RT_ST to avoid the error. @Andrew The coding is unclear to me: If no non-basic

Re: [Help-glpk] [Fwd: First time user]

2012-04-03 Thread glpk xypron
Dear Amirhosein, the error can be reproduced on Linux. The log file created by coopr contains the following: Solver command line: /usr/local/bin/glpsol --write /tmp/tmpDquziE.glpk.raw --wglp /tmp/tmp6e9b81.glpk.glp --cpxlp /tmp/tmpS7ts06.pyomo.lp GLPSOL: GLPK LP/MIP Solver, v4.47 No input

Re: [Help-glpk] [Fwd: A problem about GLPK installation on 64 bit PC]

2012-03-13 Thread glpk xypron
Hello John, your message had to be forwarded manually because you are not subscribed to the GLPK help list. See https://lists.gnu.org/mailman/listinfo/help-glpk You can download precompiled 64bit binaries from http://winglpk.sourceforge.net Best regards Xypron Forwarded Message

Re: [Help-glpk] Printing constraint for report using printf and for

2012-03-05 Thread glpk xypron
Helo Noli, you have on %2f too many in printf %d,%s,%s,%s,%s,%.2f,%.2f,%.2f, Regards Xypron Original-Nachricht Datum: Mon, 5 Mar 2012 18:38:12 +1100 Betreff: [Help-glpk] Printing constraint for report using printf and for Hi, I want to print this constraint (below)

Re: [Help-glpk] [Fwd: Conditional objective function structure]

2012-02-09 Thread glpk xypron
Hello Dong-John, your message had to be forwarded manually because you are not subscribed to the list, see https://lists.gnu.org/mailman/listinfo/help-glpk I guess this is what you are looking for: param flag := 2; var x1, = 0, = 3; var x2, = 0, = 4; maximize obj : ( if flag == 1 then .3 *

Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8

2012-02-01 Thread glpk xypron
Hello Ricardo, on a 64bit system you could install two different Java runtimes: A 32bit runtime and a 64bit runtime. A 64bit runtime can only load 64bit libraries. A 32bit runtime can only load 32bit libraries. Did you check the bitness of the GLPK library (glpk.dylib)? The glpk_java.dylib will

Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8

2012-01-31 Thread glpk xypron
Original-Nachricht Datum: Tue, 31 Jan 2012 09:24:16 +0100 Von: Ricardo J. Rodríguez rjrodrig...@unizar.es An: glpk xypron xypron.g...@gmx.de CC: Ricardo J. Rodríguez rjrodrig...@unizar.es, help-glpk@gnu.org Betreff: Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8 Hi Xypron

Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8

2012-01-30 Thread glpk xypron
Hello Ricardo, java.lang.UnsatisfiedLinkError means that the native library *.dylib either could not be loaded or did not contain the C function needed. It is necessary that the *.dylib files are in the library search path. For glpk_java.dylib this can be achieved by setting java.library.path

Re: [Help-glpk] How can I define bounds for a two dimensional variable easily?

2012-01-26 Thread glpk xypron
Hello Toni, set P; set T; param ub{P}; var v{p in P, t in T}, = ub[p]; maximize obj : sum{p in P, t in T} v[p,t]; solve; display v; data; set P := power1, power2, power3; set T := January, February, March; param ub := [power1] 197 [power2] 217 [power3] 304; end; Please, read

Re: [Help-glpk] [Fwd: Multi-period problem]

2012-01-26 Thread glpk xypron
Hello Clara, your problem contains integer variables. glpkcc.cpp has these lines switch (method) { case 'I': errnum = glp_intopt( lp, iParam ); errnum += 200; //this is to avoid ambiguity in the return codes. break; Hence, please,

Re: [Help-glpk] [Fwd: Multi-period problem]

2012-01-25 Thread glpk xypron
Dear Clara, your message had to be forwarded manually because you are not subscribed to the GLPK help list, see https://lists.gnu.org/mailman/listinfo/help-glpk Please, specify which version of GLPK and which interface to Matlab you are using. Your Matlab code was not in the forwarded

Re: [Help-glpk] [Fwd: where to obtain compiled binary glpk.jar and glpk_jni.dll for w64 (Windows 64 bit AMD platform) ?]

2012-01-17 Thread glpk xypron
Hello Paul, glpk_jni.dll is a file that belongs a project that has not been updated since GLPK 4.8. GLPK 4.8 did not work correctly with 64bit Windows. See http://en.wikibooks.org/wiki/GLPK/Java So if you need 64bit executables have a look at project GLPK for Windows hosted at

Re: [Help-glpk] [Fwd: Error - negative iteration limit]

2012-01-14 Thread glpk xypron
Hello Sheetal, please, subscribe to the help list. Otherwise your mails have to be forwarded manually. https://lists.gnu.org/mailman/listinfo/help-glpk How can your problem be reproduced? Best regards Xypron Forwarded Message From: sheetal murkute shv...@gmail.com To:

Re: [Help-glpk] setting up a basic LP using glp_set_mat_row

2012-01-13 Thread glpk xypron
Hello John, sorry for the empty mail. The documentation teaches: Being added to the problem object each column is initially fixed at zero, i.e. its type is GLP_FX and both bounds are 0. Please, use glp_set_col_bnds to set the column bounds. Best regards Xypron Original-Nachricht

Re: [Help-glpk] [Fwd: translate addTerm Cplex Ilog]

2012-01-13 Thread glpk xypron
Hello Simon, your mail had to be forwarded manually because you are no subscribed to the list. Cf. https://lists.gnu.org/mailman/listinfo/help-glpk I have created package Linear Optimization Wrapper for Java available at http://www.xypron.de/projects/linopt/ to provide a more intuitive interface

Re: [Help-glpk] How to return the best MIP solution when the branch cut tree is exceeds memory limit (API implementation)

2012-01-10 Thread glpk xypron
Hello Ruben, error: no match for operator = in total = 32212254721 You are trying to compare an integer with a structure. In glpk.h you will find: typedef struct { int lo, hi; } glp_long; To convert the structure to a double value you could use: z = 4294967296.0 * (double)x.hi +

Re: [Help-glpk] How to return the best MIP solution when the branch cut tree is exceeds memory limit (API implementation)

2011-12-28 Thread glpk xypron
Hello Ruben, before calling glp_intopt create a long jump, e.g. if (setjmp(foo1)) { printf(error occured); } else { glp_error_hook(error_hook, foo2); glp_intopt(mip, parm); } glp_error_hook(NULL, NULL); using function glp_error_hook to register a function which

Re: [Help-glpk] First element of the set

2011-12-14 Thread glpk xypron
Hello Haraldo, for numeric sets you can write: min{s in S} s max{s in S} s What is missing to do the same for nonnumeric sets. This would require to define the return value of min and max to be symbolic if the domain values are symbolic. Best regards Xypron Original-Nachricht

Re: [Help-glpk] [Fwd: 64 bit]

2011-12-01 Thread glpk xypron
Datum: Thu, 1 Dec 2011 13:24:35 +0100 Betreff: Re: [Help-glpk] [Fwd: 64 bit] Sorry I thought I subscribed a few weeks ago. Is the 64bit compilation automatic after the ./configure or should I force it somehow? Thanks Francesco On 1 Dec 2011, at 05:19, glpk xypron wrote: Hello

Re: [Help-glpk] [Fwd: 64 bit]

2011-11-30 Thread glpk xypron
Hello Francesco, your mail had to be forwarded manually because you are not subscribed to the list. See https://lists.gnu.org/mailman/listinfo/help-glpk In the source distribution you will find the files necessary to build 64bit binaries in directory glpk-4.47/w64. 64bit binaries are included

Re: [Help-glpk] GLPK shutdown

2011-11-29 Thread glpk xypron
Hello Kasper, I ran your files through glpsol.exe on a 32bit Windows machine with 4 GB RAM. I got the following error output: glp_malloc: no memory available Error detected in file ..\src\glpenv05.c at line 70 When using Java with default heap size of 16 MB I got the following output: Problem

  1   2   3   4   >