Operations research (OR) is an analytical method of problem-solving and decision-making that is useful in the management of organizations. In operations research, problems are broken down into basic components and then solved in defined steps by mathematical analysis.
Operations Research is a great domain to implement machine learning algorithms or computational programming. So, I decided to solve a simple transportation problem (faced by most industries) using Python language.
There are number of techniques in operations research such as Linear Programming, Assignment Problem, Transportation Problem, Inventory control models, Game Theory, Queuing theory, etc. We are not discussing details of these methods, for further details you may visit Techniques of Operations Research. In this era of Industry 4.0 one needs to adapt the new techniques for better performance. Solving these problems take a lot of mathematical skills while in industry we cannot afford any human error which cost huge amount of money.
Let’s start solving some problems now !
The problem given was as follow : A company wants to start Bus service for their employees in the pandemic situation, they want to come out with the best solution such that the cost of transportation is least. The terminals at Chennai and Thiruvallur can accommodate 60 and 37 buses respectively. On a Regular basis, Plant A, B, C demands 35, 40 and 22 buses. The Total no of Employees in each Plant are given below.( Due the Covid-19 Pandemic, plant A, B, C operates at 80%, 80% and 30 % of man power respectively). Each bus can occupy only 22 Employees and 1 Driver.
Now, according to the given conditions let’s calculate the number of buses required by each plant. For calculating the number buses we require the number of employee for each plant. The data provided in the problem includes the number of employee in normal condition ( Column X ).
Objective: To minimize the cost of transportation between the cities and the plant by allocating the resources in an optimal way. Here, the resources means the number of buses from a particular city to a particular plant . To find a feasible solution which is executable in the current situation ( Pandemic) and testing with given constraints.
I analyzed the problem the found many ways of solving this, one could be North West Corner Method or LCC etc. The interesting way to solve this problem is using the computational programming to find the optimal values. I made a simple Linear Programming model in python using the Pulp library.
PuLP is and LP modeler written in python. It uses various algorithms to solve the LPP’s. It requires a set of constraints , decision variables and objective functions.
Constraints : It is the set of conditions .They limit restrict the decision variables. They limit the value of the the decision variables.
Decision variables : The decision variables will decide the output of the model.
Objective function : It is the objective of the function. In our case, it is to minimize the cost.
SOLUTION : As in our case the supply was not specified in the pandemic situation, the maximum number of buses that the stations can accommodate is given. 60 for Chennai station and 37 for Thiruvallur station. And the demand for the buses in total for Plant A , plant B and plant C is 70 (Calculated from given information). Hence , the problem is of UNBALANCED type ( Demand < Supply).
Now, we have designed the linear model for our problem, it’s time to convert our model into code !
As the supply (i.e the number of buses the stations Chennai and Thiruvallur can accomodate ) was given to be 60 and 37 respectively
in normal days, but in the pandemic situation as the demand of buses was dropped the supply also needs to be decreased.
So for making the problem BALANCED , we take the supply as variable.
The whole steps above can be skipped if the data was large and in excel formal. Using pandas and numpy libraries for formating and reading excel can be done in single step
df = pd.read_excel(‘ file_name.extension ’)
Now initializing the solving….
So this is how python solves operations research problems, however python is more useful in solving more complicated problems with large dataset and large number of variables.
OR is used in industries for a wide range of problems such as : Scheduling and time management ,
- Urban and agricultural planning.
- Enterprise resource planning (ERP) and supply chain management (SCM).
- Inventory management.
- Network optimization and engineering.
- Packet routing optimization.
- Risk management.
Operations Research is all about decisions making and mathematics, OR can be taken forward with machine learning. Machine learning powers OR with better optimization using predictive approach. Even for the simplest algorithm of linear regression, it’s about minimizing the cost function for optimum value. You may refer to Machine Learning + Operations Research as future of AI — Nikolaj Van Omme.
Let’s continue with OR + ML in another article ✌, please feel free to share your valuable thoughts, knowledge or doubts.