- Write the dual of this linear program. Show your steps.
- Use the simplex algorithm to solve the original linear program. Show each step of the simplex algorithm as well as the final result.
When constructing the dual, we want to try to find some upper bound on the maximization goal, we do this by multiplying all of our equations by positive constants , we obtain by summing all the equations we obtain the following equation: We see that the LHS is upperbounded by the RHS, we know that by minimizing the upper-bound to be as small as possible this will force the solution to the dual to be equal to the solution of the primal, so we must minimize : under the constraints: this is the dual.
Now we want to use the simplex algorithm to solve the given question. Next we re-write our question in the slack form, which is the following:
The first stage of the simplex algorithm is to note that is a feasible solution, because and is a vertex of our polytope. Since we already have a vertex let's move to another vertex to increase our objective value . Right now we know that , so increase we may increase any such that has a positive coefficient, for example we pick and call it our "entering variable".
Given this choice, let's see how much we can increase the value of , recall that we already know that , by we obtain the equation , by we know and through we have that , which doesn't add any new information. So the tightest obstacle is the one produced by which states that . Therefore we can safely increment , instead of actually setting this value, we instead do something different, we instead take equation and then solve the tighest obstacle for the nonbasic varaible Here we say that is the "entering varaible" because it has entered the LHS, and we say that is an "leaving variable" because has left the LHS. Now what we do is that we subsitute this value of in all the other parts of the slack form: At this point we see that after one interation we've increased to , now we repeat this process. So we pick since it has a positive coefficient, then we can look at the rest of the constraints: We see that yields , : , : , the tighest obstcale is given by with by re-arranging we obtain that we now substitute this in to obtain At this point there is one last varaible with a positive coefficient in 's equation which is , so we look at the equations again to find the tighest obstacle:
- :
- :
- :
We know that so then produces the tightest constraint, solving for in that equation yields now we can substitute that value everwhere: which we can concicely write as At this point we can see that there are no non-basic varaibles with positive coefficient and so our answer is given by and which gives optimal value .
A convex polygon in can be specified as the intersection of halfspaces of the form . Give a linear program that finds a circle of maximum radius that lies within .
Let the -th side of lie on a line with equation , and let us choose the numbering of the sides in such a way that the first, second, up to the -th side bound from below, while the -st through th side bound it from above. Define your own variables if needed.
You can assume that it is always feasible to have the circle in the region enclosed by the lines, i.e. the polygon enclosed by the lines are given to you for free, so you don't have to use linear constraints to describe the polygon or figure out which half-space each line specifies. It is "that" polygon given to you
Suppose that the center point of some disk is given by , and that it has radius , if this disk is to lie within the polygon generated by the lines, then for any specific line inequality, every point in the disk must lie with
An equivalent criterion for this to be true is the simple requirement that the closest point on the line to be distance at least from . If this holds true for every such line, then we know that the disk centered at with radius must be within the polygon.
We'll now focus on how we can determine if the closest point on any given line is at least distance away from .
We are interested in which represents the distance from to the closest point on the line, for now just observe that there is a similar triangle hidden in here:
Since the two triangles are similar then we have that We also know some more information about this smaller triangle. Since it sits on the line then we know that the left side of this triangle is equal to , and therefore so that , and therefore With respect to our original goal, we would require that .
Let's take a moment to note that we've just dealt with a line which would bound the disk below, if the line were to bound the disk by above then the value would be a negative value, so that we would require .
With all that said we maximize subject to for and for , where and
Which yields a linear program, to which the solution produces a disk of maximum radius completely inside the polygon, as needed.
You are given jobs with a list of durations . For every pair of jobs you are given a boolean such that if it is true then job must finish before job can begin, meaning that job is a pre-requisite for job
Your goal is to find non-negative start times for the jobs such that the total time of all jobs is minimized while ensuring that the prerequisite constrains are met. Write a linear program to solve this problem.
For any job we note that it's finishing time is , the total duration for all jobs to be completed is simply , but this is not a linear combination of our variables so instead of defining it, we simply declare it as a variable and assert that and add constraints of the form
We also need to enforce certain constraints, which is to say that for any which is true we add the following inequality: which says that the finishing time of job comes before the start time of job .
We also have for all , and now along with these contraints we minimize which defines our linear programming problem.
For logical and we require both to be true, which means that and and in that case we require that in any other case we need that . It can be seen that these constraints are equivalent to under this view it's simpler to derive constraints. Firstly the minimum must be smaller than the two input values: note that this is not enough still because if then we can still pick and things are satisfied, so we need to enforce a lower bound on , to construct this lower bound, we'll consider a few cases.
- , we require that
- if , or , our initial constraints automatically force so no extra constraints are required.
From the above, we can throw in the constraint that which enforces when and in the other cases it either enforces or which add no information since we know that
For logical or, we require that at least one of is equal to 1. Which means their sum is at least one, so we encode that with we see that this is equivalent to but that is not a linear constraint, therefore we have to take a similar approach as above, similarly we require that symetrically when then is a possibility so we need to put an upper bound on and we'll just note that works
Finally for we need to take and which can be done with note that equality can be represented by two opposite inequalities.
- Material 1 has density 2 tons/cubic meter, maximum available amount 40 cubic meters, and revenue $1,000 per cubic meter.
- Material 2 has density 1 ton/cubic meter, maximum available amount 30 cubic meters, and revenue $1,200 per cubic meter.
- Material 3 has density 3 tons/cubic meter, maximum available amount 20 cubic meters, and revenue $12,000 per cubic meter.
- Write a linear program in standard form that optimizes revenue within the constraints.
- Explain what the dual of a linear program is and why one may wish to solve the dual formulation rather than the primal formulation.
- Write the dual formulation of the program in part (a). The result does not need to be in standard form for the dual in that you are not responsible for remembering the direction of inequalities in the standard form for dual formulations.
Let denote how many cubic meters of each material there are where , we'd like to maximize our profit which is given by the equation
Our cargo plane can carry a maximum weight of 100 tons, since each material has a different density this means that
It can store a maximum volume of 60 cubic meters, meaning that
We also know that there are only limited amounts of each material, we have that:
If someone claims they have an algorithm to solve a linear program and give you a maximum value, you can only check if it meets the constraints, but you can't be sure it's the best value. The dual of a linear program aims to minimize with respect to an upper bound of the original question. If a solution to both the primal and dual linear programs yields the same objective values, it's maximal. This dual verification serves as a certificate to confirm if a given value is the maximum.
It may turn out that the dual problem may be easier or quicker to solve as compared to the primal problem, this is one reason why one may prefer the dual over the primal.
To obtain the dual we take our original primal and introduce variables , for each inequality in the primal, then we multiply the -th inequality by , then we sum all the inequalities to obtain a master sum: We can see that this inequality is implied by the primal, and what we'd like to do is to choose values for which make the upper bound as small as possible, also we'd like to make sure that by doing this it makes sure that the upper bound will be an upper bound of what we were maximizing so that the primal doesn't find some smaller solution. With all that said the primal is thus given by minimizing such that