I have been doing linear programming problems in my class by graphing them but I would like to know how to write a program for a particular problem to solve it for me. If there are too many variables or constraints I could never do this by graphing.
Would brute force work? Keep in mind that many companies and big organizations spend a long time on fine tuning the solvers. There are LP's that have interesting properties that many solvers will try to exploit. Also, certain computations can be solved in parallel. The algorithm is exponential, so at some large number of variables/constraints, brute force won't work.
Optimization of resources (cost and time) is required in every aspect of our lives. We need the optimization because we have limited time and cost resources, and we need to take the maximum out of them. Every aspect of the business world today requires optimization, from manufacturing to resolving supply chain issues to stay competitive.
Linear programming offers the easiest way to do optimization as it simplifies the constraints and helps to reach a viable solution to a complex problem. In this article, we will solve some of the linear programming problems through the graphing method.
A transport company has two types of trucks, Type A and Type B. Type A has a refrigerated capacity of and a non-refrigerated capacity of . In contrast, Type B has the same overall volume with equal refrigerated and non-refrigerated stock sections. A grocer must hire trucks to transport of refrigerated stock and of non-refrigerated stock. The cost per kilometre of Type A is , and for Type B. How many trucks of each type should the grocer rent to achieve the minimum total cost?
A school is preparing a trip for 400 students. The transportation company has 10 buses of 50 seats each and 8 buses of 40 seats but only has 9 drivers available. The rental cost for a large bus is and for a small bus. Calculate how many buses of each type should be used for the trip for the least possible cost.
A store wants to liquidate 200 shirts and 100 pairs of pants from last season. They have decided to put together two offers, A and B. Offer A is a package of one shirt and a couple of pants which will sell for . Offer B is a package of three shirts and a pair of pants, which will sell for . The store does not want to sell less than 20 packages of Offer A and less than 10 of Offer B. How many boxes do they have to deal with to maximize the money generated from the promotion?
A school is preparing a trip for 400 students. The company who is providing the transportation has 10 buses of 50 seats each and 8 buses of 40 seats, but only has 9 drivers available. The rental cost for a large bus is and for a small bus. Calculate how many buses of each type should be used for the trip for the least possible cost.
A store wants to liquidate 200 shirts and 100 pairs of pants from last season. They have decided to put together two offers, A and B. Offer A is a package of one shirt and a pair of pants which will sell for . Offer B is a package of three shirts and a pair of pants, which will sell for . The store does not want to sell less than 20 packages of Offer A and less than 10 of Offer B. How many packages of each do they have to deal to maximize the money generated from the promotion?
I very much appreciate the exercises and solutions however, it seems that the answer to the third exercise has an issue. A couple of jeans refers to two pairs not one so the equation x + y = 100 is supposed to be 2x+ y = 100. Perhaps there was an issue with the wording because I just realized it is a pair in the solution but a couple in the question
An agricultural Research institute suggested to a farmer to spread out at least 4800kg of a special phosphate fertilizer and not less than 7200kg of a special nitrogen fertilizer to raise productivity of crops in his fields. There are two sources for obtaining these: Mixture A and B, both of these are available in bags weighting 100 kg each and they cost sh 40 and sh24 respectively. Mixture A contains phosphate and nitrogen equivalent of 20 kg and 80 kg respectively, while mixture B contains these ingredients equivalent of 50 kg each.
Required: Write this as a linear programming problem and determine how many bags of each type the farmer should buy in order to obtain the required fertilizer at a minimum cost
Please help to do under this question
A company produces two types of TVs, one of which is black and white, the
other colour. The company has the resources to make at most 200 sets a week. Creating a black
and white set includes Birr 2700 and Birr 3600 to create a colored set. The business should
spend no more than Birr 648,000 a week producing TV sets. If it benefits from Birr 525 per set
of black and white and Birr 675 per set of colours.
Construct the linear programing model.
How many sets of black/white and colored sets it should produce in order to get
maximum profit using
Graphical Method and Simplex Method
A company manufacture two types of product A1 and A2. Each product using milling and drilling machine. The process time per unit of A1 on the milling is 10 hours and the drilling is 8 hours, the process time per unit of A2 on the milling is 15 minute and on the drilling is 10 hours, the maximum number of hours available per week on the drilling and milling machine are 80 hours and 60 hours respectively also the profit per selling of A1 and A2 are 25 naira and 35 naira respectively. Formulate a LP model to determine the production volume of each of the product such that the total profit is maximized
I've always been writing software to solve business problems. I came across about LIP while I was going through one of the SO posts. I googled it but I am unable to relate how I can use it to solve business problems. Appreciate if some one can help me understand in layman terms.
ILP can be used to solve essentially any problem involving making a bunch of decisions, each of which only has several possible outcomes, all known ahead of time, and in which the overall "quality" of any combination of choices can be described using a function that doesn't depend on "interactions" between choices. To see how it works, it's easiest to restrict further to variables that can only be 0 or 1 (the smallest useful range of integers). Now:
For example, suppose you have 3 workers, Anne, Bill and Carl, and 3 jobs, Dusting, Typing and Packing. All of the people can do all of the jobs, but they each have different efficiency/ability levels at each job, so we want to find the best task for each of them to do to maximise overall efficiency. We want each person to perform exactly 1 job.
One way to set this problem up is with 9 variables, one for each combination of worker and job. The variable x_ad will get the value 1 if Anne should Dust in the optimal solution, and 0 otherwise; x_bp will get the value 1 if Bill should Pack in the optimal solution, and 0 otherwise; and so on.
The next thing to do is to formulate an objective function that we want to maximise or minimise. Suppose that based on Anne, Bill and Carl's most recent performance evaluations, we have a table of 9 numbers telling us how many minutes it takes each of them to perform each of the 3 jobs. In this case it makes sense to take the sum of all 9 variables, each multiplied by the time needed for that particular worker to perform that particular job, and to look to minimise this sum -- that is, to minimise the total time taken to get all the work done.
Altogether there are 6 constraints. You can now supply this 9-variable, 6-constraint problem to an ILP solver and it will spit back out the values for the variables in one of the optimal solutions -- exactly 3 of them will be 1 and the rest will be 0. The 3 that are 1 tell you which people should be doing which job!
As it happens, this particular problem has a special structure that allows it to be solved more efficiently using a different algorithm. The advantage of using ILP is that variations on the problem can be easily incorporated: for example if there were actually 4 people and only 3 jobs, then we would need to relax the constraints so that each person does at most 1 job, instead of exactly 1 job. This can be expressed simply by changing the equals sign in each of the 1st 3 constraints into a less-than-or-equals sign.
Now imagine the farmer producing pigs and chickens, or a factory producing toasters and vacuums - now the outputs (and possibly constraints) are integers, so those pretty graphs are going to go all crookedly step-wise. That's a business application that is easily represented as a linear programming problem.
I've used integer linear programming before to determine how to tile n identically proportioned images to maximize screen space used to display these images, and the formalism can represent covering problems like scheduling, but business applications of integer linear programming seem like the more natural applications of it.
SO user flolo says:Use cases where I often met it: In digital circuit design you have objects to be placed/mapped onto certain parts of a chip (FPGA-Placing) - this can be done with ILP. Also in HW-SW codesign there often arise the partition problem: Which part of a program should still run on a CPU and which part should be accelerated on hardware. This can be also solved via ILP.
When it comes to ILP, ILP has the added benefit/difficulty of being NP-complete. This means that it can be used to model a very wide range of problems (boolean satisfiability is also very popular in this regard). Since there are many good and optimized ILP solvers out there it is often viable to translate an NP-complete problem into ILP instead of devising a custom algorithm of your own.
e59dfda104