Evaluating Expressions in CPLEX

There’s a feature in the Java API for CPLEX (and in the C++ and C APIs; I’m not sure about the others) that I don’t see mentioned very often, possibly because use cases may not arise all that frequently. It became relevant in a recent email exchange, though, so I thought I’d highlight it. As …

More

A Java Container for Parameters

A few days ago, I posted about a Swing class (and supporting stuff) that I developed to facilitate my own computations research, and which I have now made open-source in a Bitbucket repository. I finally got around to cleaning up another Java utility class I wrote, and which I use regularly in experiments. I call …

More

Indicator Constraints v. Big M

Way, way back I did a couple of posts related to how to model “logical indicators” (true/false values that control enforcement of constraints): Logical Indicators in Mathematical Program Indicator Implies Relation The topic ties in to the general issue of “big M” model formulations. Somewhere around version 10, CPLEX introduced what they call indicator constraints, …

More

Naming CPLEX Objects

A CPLEX user recently asked the following question on a user forum: “Is there a way to print the constraints as interpreted by CPLEX immediately after adding these constraints using addEq, addLe etc.” The context for a question like this is often an attempt to debug either a model or the code creating the model. …

More

How to Crash CPLEX

A question elsewhere on the blog reminded me that some users of the CPLEX programming APIs are not conscious of a “technicality” that, when violated, might cause CPLEX to crash (or at least throw an exception). The bottom line can be stated easily enough: modifying a CPLEX model while solving it is a Bozo no-no. …

More

Randomness: Friend or Foe?

I spent a chunk of the weekend debugging some code (which involved solving an optimization problem). There was an R script to setup input files and a Java program to process them. The Java program included both a random heuristic to get things going and an integer program solved by CPLEX. Randomness in algorithms is …

More

Pseudocode in LyX Revisited

This post is strictly for users of LyX. In a previous post I offered up a LyX module for typesetting pseudocode. Unfortunately, development of that module bumped up against some fundamental incompatibilities between the algorithmicx package and the way LyX layouts work. The repository for it remains open, but I decided to shift my efforts …

More

Guessing Pareto Solutions: A Test

In yesterday’s post, I described a simple multiple-criterion decision problem (binary decisions, no constraints), and suggested a possible way to identify a portion of the Pareto frontier using what amounts to guesswork: randomly generate weights; use them to combine the multiple criteria into a single objective function; optimize that (trivial); repeat ad nauseam. I ran …

More

Guessing Pareto Solutions

One of the challenges of multiple-criteria decision-making (MCDM) is that, in the absence of a definitive weighting or prioritization of criteria, you cannot talk meaningfully about a “best” solution. (Optimization geeks such as myself tend to find that a major turn-off.) Instead, it is common to focus on Pareto efficient solutions. We can say that …

More

Binary / Integer Conversion in R

I’ve been poking around in R with an unconstrained optimization problem involving binary decision variables. (Trust me, it’s not as trivial as it sounds.) I wanted to explore the entire solution space. Assuming \(n\) binary decisions, this means looking at the set \(\{0,1\}^n\), which contains \(2^n\) 0-1 vectors of dimension \(n\). For reasons I won’t …

More

Precision Genomic Medicine and the UK

I just returned from the UK, where I attended a Ditchley Foundation Conference on machine learning and genetic engineering. The attendees included scientists, government officials, venture capitalists, ethicists, and medical professionals. The UK could become the world leader in genomic research by combining population-level genotyping with NHS health records. The application of AI to datasets …

More

The Future of Genomic Precision Medicine

As I mentioned in this earlier post, I’ll be in the UK next week for a Ditchley Foundation conference on the intersection of machine learning and genetic engineering. I’ll present these slides at the meeting. The slides review the rapidly evolving situation in genomic prediction, focusing on disease risk predicted using inexpensive genotyping. There are now …

More

Threads and Memory

Yesterday I had a rather rude reminder (actually, two) of something I’ve known for a while. I was running a Java program that uses CPLEX to solve an integer programming model. The symptoms were as follows: shortly after the IP solver run started, I ran out of RAM, the operating system started paging memory to …

More

Of Typewriters and Permutations (II)

This continues my previous post about the problem of optimally laying out a one-dimensional typewriter keyboard, where “optimally” is taken to mean minimizing the expected amount of lateral movement to type a few selected books. As I noted there, Nate Brixius correctly characterized the problem as a quadratic assignment problem (QAP). I’ll in fact try …

More

Backpropagation in the Brain?

Ask and ye shall receive :-) In an earlier post I recommended a talk by Ilya Sutskever of OpenAI (part of an MIT AGI lecture series). In the Q&A someone asks about the status of backpropagation (used for training of artificial deep neural nets) in real neural nets, and Ilya answers that it’s currently not …

More

Pseudocode in LyX

Fair warning: This post is for LyX users only. When I’m writing a paper or presentation in LaTeX (using LyX, of course) and want to include a program chunk or algorithm in pseudocode, I favor the algorithmicx package (and specifically the algpseudocode style). There being no intrinsic support for the package in LyX, I have …

More

B.S.-ing Precisely

In a recent blog post titled “Excessive Precision“, John D. Cook points out the foolishness of articulating results to an arbitrarily high degree of precision when the inputs are themselves not that precise. To quote him: Excessive precision is not the mark of the expert. Nor is it the mark of the layman. It’s the …

More

Coordinating Variable Signs

Someone asked me today (or yesterday, depending on whose time zone you go by) how to force a group of variables in an optimization model to take the same sign (all nonpositive or all nonnegative). Assuming that all the variables are bounded, you just need one new binary variable and a few constraints. Assume that …

More

NP Confusion

I just finished reading a somewhat provocative article on the CIO website, titled “10 reasons to ignore computer science degrees” (when hiring programmers). While I’m not in the business of hiring coders (although I recent was hired as a “student programmer” on a grant — the Universe has a sense of humor), I find myself …

More

ICML notes

It’s never been a better time to work on AI/ML. Vast resources are being deployed in this direction, by corporations and governments alike. In addition to the marvelous practical applications in development, a theoretical understanding of Deep Learning may emerge in the next few years. The notes below are to keep track of some interesting …

More

Selecting Box Sizes

Someone posted an interesting question about box sizes on Mathematics Stack Exchange. He (well, his girlfriend to be precise) has a set of historical documents that need to be preserved in boxes (apparently using a separate box for each document). He wants to find a solution that minimizes the total surface area of the boxes …

More

Usefulness of Computer Science: An Example

I thought I would follow up on my June 29 post, “Does Computer Science Help with OR?“, by giving a quick example of how exposure to fundamentals of computer science recently helped me. A current research project involves optimization models containing large numbers of what are basically set covering constraints, constraints of the form \(\displaystyle …

More

Does Computer Science Help with OR?

Fair warning: tl/dr. After reading a blog post yesterday by John D. Cook, “Does computer science help you program?“, I decided to throw in my two cents (convert to euros at your own risk) on a related topic: does computer science (which I will extend to including programming) help you as an OR/IE/management science/analytics professional? …

More

Callback Cuts That Repeat

The following post is specific to the CPLEX integer programming solver. I have no idea whether it applies to other solvers, or even which other solver have cut callbacks. Every so often, a user will discover that a callback routine they wrote has “rediscovered” a cut it previously generated. This can be a bit concerning …

More

Grouping Rows of a Matrix

I spent a large chunk of yesterday afternoon doing something I thought would be simple (relatively speaking) in LaTeX. I wanted to group rows of a matrix (actually, in my case, a vector) with right braces, and label the groups. An example of what I wanted is in the image below. This seems to me …

More

Big M and Integrality Tolerance

A change I made to an answer I posted on OR-Exchange, based on a comment from a well-informed user of OR-X, might be worth repeating here on the blog. It has to do with issues that can occur when using “big M” type integer programming models, a topic I’ve covered here before. As I mentioned …

More

How NSA Tracks You (Bill Binney)

Anyone who is paying attention knows that the Obama FBI/DOJ used massive government surveillance powers against the Trump team during and after the election. A FISA warrant on Carter Page (and Manafort and others?) was likely used to mine stored communications of other Trump team members. Hundreds of “mysterious” unmasking requests by Susan Rice, Samantha …

More

More on “Core Points”

A few additions to yesterday’s post occurred to me belatedly. First, it may be a good idea to check whether your alleged core point \(y^0\) is actually in the relative interior of the integer hull \(\mathrm{conv}(Y)\). A sufficient condition is that, when you substitute \(y^0\) into the constraints, all inequality constraints including variable bounds have …

More

Finding a “Core Point”

In a famous (or at least relatively famous) paper [1], Magnanti and Wong suggest a method to accelerate the progress of Benders decomposition for certain mixed-integer programs by sharpening “optimality” cuts. Their approach requires the determination of what they call a core point. I’ll try to follow their notation as much as possible. Let \(Y\) …

More

Gork revisited, 2018

It’s been almost 10 years since I made the post Are you Gork? Over the last decade, both scientists and non-scientists have become more confident that we will someday create: A. AGI (= sentient AI, named “Gork” :-)  See Rise of the Machines: Survey of AI Researchers. B. Quantum Computers. See Quantum Computing at a Tipping …

More

Quantum Computing near a Tipping Point?

I received an email from a physicist colleague suggesting that we might be near a “tipping point” in quantum computation. I’ve sort of followed quantum computation and quantum information as an outsider for about 20 years now, but haven’t been paying close attention recently because it seems that practical general purpose quantum computers are still …

More

Creating A New MIME Type

I struggled a bit this afternoon creating a new MIME type and associating it with a particular application, so I’m going to archive the solution here for future reference. This was on a Linux Mint system, but I found the key information in a GNOME documentation page, so I suspect it works for Ubuntu and …

More