# Solving A Linear Programming Problem

Alas, it is not as hyped as machine learning is (which is certainly a form of optimization itself), but is the go-to method for problems that can be formulated through decision variables that have linear relationships.This is a fast practical tutorial, I will perhaps cover the Simplex algorithm and the theory in a later post.

Graphical Method: Owing to the importance of linear programming models in various industries, many types of algorithms have been developed over the years to solve them.

Some famous mentions include the Simplex method, the Hungarian approach, and others.

Just to get an idea, we are going to solve a simple problem regarding production scheduling.

Imagine that you work for a company that builds computers.

Bananas cost 30 rupees per dozen (6 servings) and apples cost 80 rupees per kg (8 servings).

Given: 1 banana contains 8.8 mg of Vitamin C and 100-125 g of apples i.e. Every person of the family would like to have at least 20 mg of Vitamin C daily but would like to keep the intake under 60 mg.Here we are going to concentrate on one of the most basic methods to handle a linear programming problem i.e. In principle, this method works for almost all different types of problems but gets more and more difficult to solve when the number of decision variables and the constraints increases. We will first discuss the steps of the algorithm: We have already understood the mathematical formulation of an LP problem in a previous section.Therefore, we’ll illustrate it in a simple case i.e. Note that this is the most crucial step as all the subsequent steps depend on our analysis here.Now begin from the far corner of the graph and tend to slide it towards the origin. Once you locate the optimum point, you’ll need to find its coordinates.This can be done by drawing two perpendicular lines from the point onto the coordinate axes and noting down the coordinates.It could be viewed as the intersection of the valid regions of each constraint line as well.Choosing any point in this area would result in a valid solution for our objective function.Choose the constant value in the equation of the objective function randomly, just to make it clearly distinguishable.An optimum point always lies on one of the corners of the feasible region. Place a ruler on the graph sheet, parallel to the objective function.To find out the optimized objective function, one can simply put in the values of these parameters in the equation of the objective function. Worried about the execution of this seemingly long algorithm? Question: A health-conscious family wants to have a very well controlled vitamin C-rich mixed fruit-breakfast which is a good source of dietary fibre as well; in the form of 5 fruit servings per day.They choose apples and bananas as their target fruits, which can be purchased from an online vendor in bulk at a reasonable price.