--
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/a27cabbc-cd9f-4748-99ff-694f31ae1c99o%40googlegroups.com.
when you mention a size sqrt(1764) matrix, you mean it's a matrix 42x42? Because that seems like a trivial size and you may have some problems outside of your code.
If you're stuck using 32 bit python, consider using a '2D dict' (like cost[i][j] * m_commute[i][j]) as they will typically be smaller/faster. Otherwise, 64bit python will have a higher memory limitSean Grogan
sean....@gmail.com
On Sun, Jun 7, 2020 at 5:15 PM Tim Klein <tristra...@gmail.com> wrote:
--Hi,I'm trying to solve minimum / maximum commute problems for a number of regions (for background, if you're interested: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.462.5089&rep=rep1&type=pdf). For such a problem, I have a cost matrix, a matrix of observed commuter flows, and row- and column-sums as constraints. Objective is to minimize or maximize the total cost by adjusting the commuter flows (m_commute below).It all works very well with Pulp, cbc and glpk until i get to a matrix size of sqr(1764), where pulp throws a memory error (on my laptop, on my office computer (python 37-32) and on the amazon Linux AMI 2018.03.0 (python 36) as well):LpProb += lpSum(cost[i,j] * m_commute[i][j] for i in I for j in J)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pulp\pulp.py", line 2046, in lpSum
return LpAffineExpression().addInPlace(vector)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pulp\pulp.py", line 739, in addInPlace
self.addInPlace(e)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pulp\pulp.py", line 732, in addInPlace
self.addterm(v, x)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pulp\pulp.py", line 617, in addterm
self[key] = value
MemoryErrorThat's before adding constraints. No mps file created. Any ideas?Thanks, Tim
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/bc9d1574-8dd7-4cea-a613-51b0aadfb590o%40googlegroups.com.
Hi Tim that is a large matrix,I would start my only storing non-zero OD pairs i.elpSum(cost[i,j] * m_commute[i][j] for i, j in NonZeros)I found when I was doing OD modelling I actually set a higher cut off (than 0) to eliminate the complexityStuStuart MitchellPhD Engineering ScienceExtraordinary Freelance Programmer and Optimisation Guru
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/bc9d1574-8dd7-4cea-a613-51b0aadfb590o%40googlegroups.com.