Hot answers tagged

11

The difference between a C++ and Python API can be massive, but it also depends on the quality of the Python implementation. A key factor to consider when setting expectations, is the way the API is used to communicate information. There are two main ways to interact with APIs: (i) reading files, and (ii) creating models in the API. Reading files For example,...


8

In addition to @Richard's answer: The time for setting up the model, i.e. declaring variables and constraints, surely depends on the programming language you use. After the model is ready, solving does no longer depend on the language unless you use callbacks while doing the optimization. This is a more advanced technique where for example you provide the ...


8

Once it’s passed to the underlying C library, it does not matter which API it came from. However, there may be some overhead when you are retrieving the solution through the API (for the same reasons that you ready mentioned).


6

I have made OR models accessible through APIs on Kubernetes before. It isn't too hard, no pickling involved. In general, the steps aren't unique for an OR model API, but there might be a few things to consider (for example, an OR API might take more time than an average API to return a result). First of all, you need to decide on a data exchange format. The ...


5

Python is a "slow" programming language because it is interpreted (at least CPython is), so in OR-Tools, for example, that impacts the model building speed if the model is big enough or your logic involves many loops. Examples: https://github.com/google/or-tools/issues/1663 https://github.com/google/or-tools/issues/1020 Edit: as others have said, this can ...


4

I think in your case you have to separate between the data and the model. The model itself is part of the service in some way. Either you hard code it into the service or you have some sort of abstract description of the model (for example in some modeling language that the solver can read) so that you can upload new versions of the model to the service. ...


3

As you have noticed there are ready-made services available for ML but not for OR. You will have to roll your own. You can get a feel for the architecture requirements by looking at the code and REST APIs of open-source projects, e.g. graphhopper, vroom. It takes time to understand source code of others, and software architectures even more so. But the blue-...


3

I am unsure what exactly you want to pickle. Is the user posting data to your endpoint (the flask service)? In that case you probably need to re-run the algorithm. In machine learning the model is usually pickled as you have already trained it. Thus the user in that case just need to provide the input for the model and it will immediately make a prediction ...


Only top voted, non community-wiki answers of a minimum length are eligible