tag:blogger.com,1999:blog-593563533834706486.comments2024-03-09T06:47:13.003-05:00Yet Another Math Programming ConsultantErwin Kalvelagenhttp://www.blogger.com/profile/09496091402502236997noreply@blogger.comBlogger1246125tag:blogger.com,1999:blog-593563533834706486.post-31584839492310150262024-02-27T13:38:40.871-05:002024-02-27T13:38:40.871-05:00A programmer who doesn't want to learn the mat...A programmer who doesn't want to learn the mathematical language decides to rant on a blog with "mathematical programming" in its name. I go to sea food restaurant to complain that I don't like sea food. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-41351878227227592982024-02-20T09:46:38.401-05:002024-02-20T09:46:38.401-05:00A comment on Wolfram's software: Generally bet...A comment on Wolfram's software: Generally better is to use the "Reduce"-function for such inverses, which should consider all cases. The current version of Wolfram Alpha yields with input "Reduce[ y == Sign[x] Log[1 + Abs[x]], x, Reals ]" indeed only the result you mention above. But Wolfram Mathematica (the non-free software; ver 12.1) yields correctly: (y < 0 &&Martin Densingnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-89869141806558872092024-01-30T10:17:33.809-05:002024-01-30T10:17:33.809-05:00Your second model can be strengthened by replacing...Your second model can be strengthened by replacing the four big-M constraints with L[i] * delta[i,1] - epsilon * delta[i,2] + epsilon * delta[i,3] <= x[i] <= -epsilon * delta[i,1] + epsilon * delta[i,2] + U[i] * delta[i,3]Rob Pratthttps://www.blogger.com/profile/16525877394541155854noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-58532323867518804072023-12-22T02:40:17.840-05:002023-12-22T02:40:17.840-05:00No. (A) If we were only measuring slow vs fast ran...No. (A) If we were only measuring slow vs fast random number generation, we only would see 2 different timings. (B) Python-Julia = 4.63, Python-Numba=4.48. Numba-Julia=0.42. So only 10% of the difference between Python and Julia can be explained by the difference in number generation.Erwin Kalvelagenhttps://www.blogger.com/profile/09496091402502236997noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-16633235214400377882023-12-19T04:22:10.109-05:002023-12-19T04:22:10.109-05:00can you provide the code to display the output in ...can you provide the code to display the output in container form for the 3rd case(using cp-sat solver)?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-12341211007852196732023-12-14T11:25:37.166-05:002023-12-14T11:25:37.166-05:00Thank you for the mathematical modeling of this pr...Thank you for the mathematical modeling of this problem. Really appreciate it, I was wondering what are the cons of using Manhattan distance, as opposed to Euclidean distance.<br />With respect to real world, considering that ideally it must be geodesic distance (sin and cos components), between two points marked by latitudes and longitudes, would it still be within the limits of convex Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-31695177846456385132023-12-09T21:32:47.788-05:002023-12-09T21:32:47.788-05:00Yes. Cpython implements mt19937 while Julia uses t...Yes. Cpython implements mt19937 while Julia uses the Xoshiro256++ algorithm for generating random numbers. Benchmark results show that the latter is orders of magnitude faster (https://quick-bench.com/q/TFMFFEZXSUjzg0SBl8yy2FTf5Xc). Julia and Numba both use LLVM, you don't get a 6x performance difference between the two for similar work unless there's a clear explanation (which in this Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-71231610186083246392023-11-06T16:23:42.449-05:002023-11-06T16:23:42.449-05:00Yeah a bit late I know, but it would be cool if yo...Yeah a bit late I know, but it would be cool if you could write it more detailed so that the uninitiated like me could understand it. Otherwise good visualisations :DAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-74707651671690081792023-11-03T08:45:22.153-04:002023-11-03T08:45:22.153-04:00Thank you for your work, that is really helpful. B...Thank you for your work, that is really helpful. But there is an update about the library import. According to GAMS latest Python API, the command 'import gamstransfer as gt' has been updated. One of the way is 'from gams import transfer as gt'. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-27351502691805786292023-10-30T09:13:45.599-04:002023-10-30T09:13:45.599-04:00This is a two-dimensional cutting stock problem. T...This is a two-dimensional cutting stock problem. There is a body of literature about this problem.Erwin Kalvelagenhttps://www.blogger.com/profile/09496091402502236997noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-76198317099559612272023-10-30T09:07:02.735-04:002023-10-30T09:07:02.735-04:00Problem: a timber warehouse has a bundle of assort...Problem: a timber warehouse has a bundle of assorted widths and lengths, thickness is uniform. A customer places an order for a number of boards of varying widths and lengths, thickness is uniform. Is there a mathematical solution or software which identifies the most efficient way of meeting the order from the available timber?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-62195026169036422312023-10-30T08:43:01.085-04:002023-10-30T08:43:01.085-04:00Your code has an upper bound of 2 on the number of...Your code has an upper bound of 2 on the number of duplicates. (I.e. this problem with just 1 time period will be infeasible). I assume this code was copy-pasted which is almost always a recipe for disaster. Better than copy-paste is to copy the concepts but enter the code by typing. It forces you to pay attention to the details. Erwin Kalvelagenhttps://www.blogger.com/profile/09496091402502236997noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-90450260239745550692023-10-29T15:55:51.827-04:002023-10-29T15:55:51.827-04:00Thanks
I solved it in Googlw OR-Tools
https://or....Thanks<br />I solved it in Googlw OR-Tools <br />https://or.stackexchange.com/a/11165/4775Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-54818875228172983512023-10-27T09:03:17.233-04:002023-10-27T09:03:17.233-04:00No. (1) cpython's random() is written in C. It...No. (1) cpython's random() is written in C. It is not dumb code. (2) The difference in timings can be reproduced by doing other things than generating random numbers. (3) This behavior has been shown by other benchmarks.Erwin Kalvelagenhttps://www.blogger.com/profile/09496091402502236997noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-277430310974030202023-10-24T11:43:29.075-04:002023-10-24T11:43:29.075-04:00You're testing the speed of random number gene...You're testing the speed of random number generation.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-76468283801165456952023-09-29T08:59:07.958-04:002023-09-29T08:59:07.958-04:00The details... It knows the overall picture, but w...The details... It knows the overall picture, but when it gets to the actual steps it completely messes up. Confidently. Like the student who turns in a very clean-looking work which is utter nonsense. If you just glance at it you may think that the student is good and surely just messed up a sign somewhere. But if you read the work carefully you realize he has no clue.<br />I think ChatGPT is Imre Poliknoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-42649224485855384072023-09-27T09:52:01.643-04:002023-09-27T09:52:01.643-04:00This model can solve fast if the data set is not v...This model can solve fast if the data set is not very large. Maybe check with your local university to see if this would be a suitable student project. This post is more about the mathematical modeling than about a canned application.Erwin Kalvelagenhttps://www.blogger.com/profile/09496091402502236997noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-20398066143211636212023-09-27T00:53:37.872-04:002023-09-27T00:53:37.872-04:00@gif macro in plots.jl@gif macro in plots.jlErwin Kalvelagenhttps://www.blogger.com/profile/09496091402502236997noreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-17717536912743464752023-09-26T21:27:23.262-04:002023-09-26T21:27:23.262-04:00Hello, how did you create the animated graphs?Hello, how did you create the animated graphs?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-90284809566931122212023-09-21T22:39:03.607-04:002023-09-21T22:39:03.607-04:00We play badminton socially and are currently looki...We play badminton socially and are currently looking for a system like this to set games.<br />Currently we use a few manual methods which mean someone has to spend time working out games and the biggest 'compliant' is that games are not varied enough, with the same partners or opponents appearing in game regularly.<br />There are a few differences to what you outline here, because it'Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-4568340980507321212023-09-15T12:32:07.986-04:002023-09-15T12:32:07.986-04:00Is there any benefit to limiting the comparison of...Is there any benefit to limiting the comparison of z? If you add the symmetry constraints AND also reduce the number of constraints for which z is constrained, will that help? For example, we know that the constraint given for z between points 1 and 50 (lower left and upper right) is not going to constrain the value of z. In the above problem there are a limited number of points that are closest.Josh Woodruffnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-75607791438559114942023-09-11T05:00:25.474-04:002023-09-11T05:00:25.474-04:00Found the reason... in my instance, optimal LP is ...Found the reason... in my instance, optimal LP is very different from optimal IP.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-80866571647136098872023-09-08T17:52:20.475-04:002023-09-08T17:52:20.475-04:00Could you send me the code too, please? Very inter...Could you send me the code too, please? Very interesting approach reducing the number of subproblems. My email is: carlos.lealg@udem.eduAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-39091787437491050302023-09-08T05:32:17.187-04:002023-09-08T05:32:17.187-04:00Hi, I am trying to replicate this model in Google ...Hi, I am trying to replicate this model in Google OR-Tools, but the demand constraint being an equality makes the model give odd results. Do you know what could be the reason behind this? Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-593563533834706486.post-79109545803448530012023-08-25T09:06:41.586-04:002023-08-25T09:06:41.586-04:00Thanks a lot :)Thanks a lot :)Anonymousnoreply@blogger.com