20
$\begingroup$

This semester I will start teaching Programming in Python to Master students in Supply Chain Management. I would like to start the first lesson with "Why learning programming languages will be useful to them". But when I search about this term in the internet using search engines like Google, Bing, Yahoo, DuckDuckGo, I do not get good answers.

I tried the following terms

  • "industrial engineering" "programming languages"
  • "operations research" "programming languages"

Interestingly, I do not see useful scientific articles or news. Only one related result is Chapter 2 Programming languages in Handbooks in Operations Research and Management Science. Apart from this old chapter from 1992, other results, for me at least, are not useful. Then come my questions.

  1. Are programming languages is necessary for operations research practitioner?
  2. If programming languages are not necessary, then are they at least useful for operations research practitioner?
$\endgroup$

7 Answers 7

29
$\begingroup$

To go beyond prototyping a model, you will need a programming language. Here is a non-exhaustive list :

  1. Sometimes simply modeling and calling the solver won't suffice to handle complex problems. To develop custom algorithms, heuristics, etc you will need to learn a programming language. Python is a good choice for fast prototyping and C/C++ for developing fast algorithms.

  2. To deal with end-users and to build useful end-to-end products, you will need to build a GUI, have some database knowledge, etc. Here I would say that even some web programming/scripting languages (e.g. Javascript) are useful since a lot of the applications are web-based and host on the cloud.

  3. Python programming is a good way to mix OR methods with data analytics and machine learning.

  4. Programming knowledge and learning how write elegant code is crucial to work with a team of software engineers/data scientists etc who are developing end-to-end apps or integrating OR methods with data analytics etc. Those people don't know about specific modeling languages.

Finally, I think one needs also to learn the best practices such as version control, documentation, unit testing, etc.

$\endgroup$
1
  • 1
    $\begingroup$ One of the OR teams I have seen in practice had the OR personnel be statistical modeling focused, but also had an embedded application programmer from the IT department. The OR side did the Python and R code predominately while the IT side provided C, SQL, and web interface support. -Seemed like an excellent balance of skill sets. $\endgroup$ Commented Sep 10, 2019 at 18:07
20
$\begingroup$

In my opinion, programming languages are necessary as an OR practitioner. There are a number of reasons for this:

  • Data Input/Output often requires some programming language. Whether it’s reading in data from an excel spreadsheet, or an SQL database or what have you, you will want to do this programmatically using Python etc.
  • Many companies do not have GAMS, CPLEX Optimization Studio or similar, so a practitioner is basically forced to use a general programming language.
  • When working interdisciplinary (eg with machine learning), a general language is much easier to interface than a special modeling language
  • In my opinion, general programming languages offer a lot of advantages (test ability, continuous integration etc) that make deployment much, much easier.

By the way, I’d be curious to hear about how your course goes. Any way you could make the material public?

$\endgroup$
2
  • 1
    $\begingroup$ Right now, I have only general guidelines for this course. I will put materials on github. I will add the link when I put something useful there. $\endgroup$ Commented Sep 8, 2019 at 12:31
  • $\begingroup$ Awesome, thanks! $\endgroup$
    – Richard
    Commented Sep 8, 2019 at 16:36
13
$\begingroup$

There are quite a few good answers here. I'll mention one more thing (related to two previously mentioned issues, building a GUI and accessing data): data cleaning. This may mean a number of things: detecting and removing errors or anomalies in input data; merging observations into single parameters (averages, etc.); converting units; and my personal favorite (related to the user interface, graphical or otherwise), defending against user screw-ups. Left to their own devices, users may, for example, ask you to create six teams of exactly four people each from a pool of 22 people, with each person assigned to exactly one team. This morning, I tripped over a query asking for prediction of pavement quality on a stretch of highway of length zero. (On the positive side, at least the length wasn't negative.)

Some modeling packages include provisions for user interfaces, and some may have the capability to let you do sanity checks on parameters and input data ... but it would be rash to assume that you will always be using such a product. So, yes, I would say some programming chops are necessary, even if only to design a prototype that professional programmers will then spruce up.

$\endgroup$
10
$\begingroup$

Agree with all the mentioned great answers, I also think general programming languages are necessary for the OR practitioners and would like to add the following points:

  • Applications: Beside the theoretical advancement of OR techniques and concepts in academia, there is another parallel and strong branch of OR, namely application of the OR in real-world problems. Those problems are usually complicated and managing all the necessary data and details needs lots of variables and constraints which are interconnected by different logics among them. Although some of the algebraic languages are able to deal with these type of constraints, most of the time it is easier to use general programming languages to tackle big problems. Moreover, sometimes you need to compare and validate your results with the outputs of specific software in the field of application. Those software usually need predefined format for the inputs and even you need the output of software as your model's input. These connections can be easily made by using a general programming language. As an example:

    • AMPL $\longleftrightarrow$ Matlab $\longleftrightarrow$ Abaqus(as software for structural analysis).
  • Theory: Looking at the huge literature of the proposed metaheuristic approaches, one can easily see the necessity of those approaches. AFAIK, using algebraic languages to code those algorithms are nearly impossible or tediously sophisticated.

$\endgroup$
3
  • $\begingroup$ Could you state some examples of those constraints ? $\endgroup$
    – Antarctica
    Commented Sep 14, 2019 at 13:44
  • $\begingroup$ @AmiraZarglayoun For example Equilibrium equations in a structure which needs to be optimized in terms of weight by keeping the same (or approximately the same) mechanical properties. While using the finite element analysis for such a structure, it is usually too hard to manually input all the details of the model. Usually general programming languages are used to generate the constraints and model and then the model can be sent to any of AMLs such as AMPL or Pyomo... $\endgroup$ Commented Sep 15, 2019 at 2:26
  • $\begingroup$ I see. I am looking for optimization problems used in engineering. Any suggestions of papers/books etc. ? $\endgroup$
    – Antarctica
    Commented Sep 15, 2019 at 14:26
8
$\begingroup$

While the other answers are solid, to directly answer your stated questions:

(2) Very broadly, I believe understanding how to program will help your students better understand and compare processes which involve software (which I hear is quite popular these days).

(2) OR students specifically will be more prepared to do modeling and simulation with a little programming experience.


(1) To go further, I believe anyone in science will be at at major disadvantage in the industry if they are not just familiar with, but comfortable with a programming language to get at the vast quantity of readily-available and powerful solving libraries, which their peers will be taking advantage of.

For some validation, I did my undergrad in industrial engineering, but moved into software and now work at a logistics firm.

$\endgroup$
7
$\begingroup$

Some optimization software/frameworks (commercial or open-source) such as AMPL, GAMS, Cplex, ... have a specific Algebraic modelling language. Some of them have another type of programming that uses APIs to connect with general programming languages ​​like C ++ / Java or others.

AFAIK, Algebraic modelling language is a bit easier than general programming to write optimization models. Indeed, you would also see this or this posts.

$\endgroup$
6
$\begingroup$

I would like to start the first lesson with "Why learning programming languages will be useful to them". ... Comment: Right now, I have only general guidelines for this course. ...
 

  1. Are programming languages is necessary for operations research practitioner?

I would say yes, learning computer programming (beyond the basics) is necessary for Operations Research, Artificial Intelligence, and personal development. I used to be fluent in several languages.

Which languages to learn leads to a whole series of other questions, here are a few:

Mostly such broad questions are closed as opinion-based, though I do believe that there's some expertise available on these subjects. Basically, one would pick something that's not too complicated and fairly popular; at the expense of missing out on the features of more powerful languages. This is why a separate course is necessary, and a decade of experience (if you want the computer to be a tool that you can master).

  1. If programming languages are not necessary, then are they at least useful for operations research practitioner?

I would say learning programming is necessary, it's useful for other courses to briefly introduce it but the couple of years necessary can't be devoted to learning the basics, and that's why a minor in Computer Science consists of 6 subjects and 72 units.

Much as Operations Research is divided into multiple categories of study one couldn't combine proper learning of computer programming within another course. MIT has a free online course called: "Introduction to Computer Science and Programming Using Python" (taught by Charter Oak State College) which takes 9 weeks at 14–16 hours per week (a month, straight), and you can pay extra to get a verified certificate.

Your "introduction" to computer programming would be best spent outlining the expected level of understanding one needs to complete your course and what people's options are at your school and elsewhere. Teaching Python in a month takes a month and likely isn't going to be helpful to everyone. Some people might learn that quickly, particularly with a lot of homework, but some certainly won't.

Here are the prerequisites:

"High school algebra and a reasonable aptitude for mathematics. Students without prior programming background will find there is a steep learning curve and may have to put in more than the estimated time effort.".

There is a webpage called "PythonForOperationsResearch" that lists some of the Python packages that someone interested in using that language in an Operations Research capacity might want to familiarize themselves with.

A search on GitHub returns 112 results for Python and the Operations Research tag.

See also our question: List of Implementations for common OR problems.

The webpage: "Optimization Modeling in Python: PuLP, Gurobi, and CPLEX" has this to say:

"I have been involved in the design, development, and implementation of operations research (OR) and optimization models such as Linear Programs (LP), Mixed Integer Linear Programs (MILP), and Quadratic Programs (QP) for more than a decade.
...
These days, however, many in industry want to plan and make optimal decisions regularly as a part of their hourly, daily, or weekly operations. Recent computational advances have provided the infrastructure for us to incorporate optimization models in analytic software solutions. This means that today’s OR practitioners need to design, model, and implement robust software engines that are based on LP/MILP models. They need to utilize a programming language such as C++, Java, C#, Python, etc. for that purpose.

A good and popular programming language recommended by many in the OR and Data Science communities is Python. It is easy, flexible, and powerful, and has great libraries for Machine Learning, Optimization, and Statistical Modeling.".

Perhaps the above provides some useful information about what you would discuss in your first lesson "Why learning programming languages will be useful to them". At the school I went to it was universally understood, by students and faculty (but not management), that pulling students out of their course and sending them for a three day crash course elsewhere on campus was not productive; but still a necessary part of the main course, to say such skills were included.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.