 Let me also tell you a few other things related to this. I remember I mentioned, so we wrote out the LP for, we wrote out the LP duality theorem assuming this particular form, this particular form for the primal LP that we took it as standard form because every problem can be reduced to this sort of standard form and then you get it, you can and this was the dual of that particular, of the standard form LP, if you have a LP which is not in standard form, if you have LP not in standard form, not in standard form, so for example, say suppose you have a LP that looks like this, say suppose you have a LP that is, say suppose this is your LP, now what is the dual of this one? It turns out, so the way to get to the dual, so this LP would, this primal will also have a dual. Now its dual will not take the same form as the standard form dual, its dual will take a different form, but the way to get there is that you can convert this to standard form, then do a dual of standard form and usually after this some manipulations are needed, because usually this will lead to some redundant variables which you can eliminate easily and so on, do a few manipulations if possible and then that gives you, that will give you the dual of, that will give you a dual problem. Now what is the dual of this one? It turns out it is maximizing B transpose Y, A transpose Y less than equal to C and Y greater than equal to C, this is the form of the dual of this particular LP. You can, as I said consider many other different linear programs and find their standard, find their duals by just converting them to this sort of, converting them to standard form and then manipulations and so on. Yes, yes, this is the same A as this A, the B is the same as this B, C is the same as this C. Yes, some variables will get dropped, yes it is possible that some variables will get dropped, no, so it will come, you can bring it down to this form. So this is also another sort of settle point, see an optimization problem can have many different forms that are all giving the same optimal value. Remember at the end of the day the duality theorem only pertains to the value of the optimization problem. You can always introduce additional variables, manipulate, remove variables, etc., etc., while not changing the optimal value. So there is no fixed form for an optimization problem, that is the matter, but all we know is that yes, this is a form for the dual. So this is how you can, if you have a LP that is not in standard form, then you can, this is the road by which you can get it dual. So as the last topic on linear programming, let me mention to you one other thing which is another type of problem which comes up, which can be written as a linear program. That problem is problem of shortest path. So the problem that I wrote here in this, the network problem here was that you had an old phone and you had a new phone, you want to transfer data from an old phone to the new phone, but then the links that over which the data could flow had limitations of capacity. So you could not push data beyond a certain MB per second along these links. So there is a different type of problem which is of the following kind that you have a source node, you have a destination node. Say the source node is say Mumbai and the destination node is say suppose Delhi, you have, you can go from this source node to this destination node over many different possible paths. One way is that you can go till, you can fly till somewhere here, then you can go, then you can go by, then take another flight and get to Delhi. Another way is that you can go by, you can go from S to some other intermediate node, then you fly till here or you then fly directly to Delhi from here. Another possibility is you can go from here to here and then go there to here, etc, etc, etc. So then you can see there are numerous possible ways by which you can go from one node, from the source node to the destination node. So now if you have this kind of, if you have a general network like this, the problem which we are asked, what we have to, what we want to ask here is what is the shortest path. So every link here suppose has a length or a cost associated with it. So the length say for every i and j, every i and j has a cost, cost C ij, these are all directed edges. There is a cost to go from i to j, cost C ij to, and what we want to know is what is the, what is the route from S to T of minimum cost. What is the route from S to T of minimum cost? Now this is the problem that we end up solving every day when we use Google Maps to find the route from point A to point B. This is exactly what Google Maps is ending up solving for you. It is assuming the cost as say the travel time from i to j. Now if you are within the city, maybe travel time is all you care about in another, when you are travelling from one, from intercity you are caring also about, also about to say tolls, maybe if you are driving on toll road or your cost of a ticket if you are changing modes of transport in between etc. So you can define cost in whichever way you like. So long as you have one consistent notion of cost, this problem can be posed in this particular way. Now we want to know what is the shortest, shortest in the sense of, in the sense of the total cost that you would incur of a route from S to T. So the cost of a route from S to T is simply the S to T is in sum of Cij where i, j is in the, so whenever i, j is an edge that you use in the route it costs you Cij and the cost of the entire route is the sum of all these Cij that are where i, j lies in the route. This is the cost of travelling from i to j. Now here you can see how intuitively how would you solve a problem like this. See if you want to go from Mumbai to Delhi you can see already this simple little graph is a extremely complicated graph. How would you solve a problem like this? You would say well let me go from, let me try out this route, one route here I go from S from, I go from the source node to one node then I try out from here I let me try out this particular possibility, let me try out that particular possibility, etc, etc. I have, you basically have to enumerate a huge number of possibilities and to try to get to the shortest path. Now that seems like, it seems like an extremely complicated optimization over so many because even just enumerating all the possible paths itself would take you a lot of time. And then listing them all out just simply enumerating all the paths and then try and then trying to find which is the one that is of least cost. Now it turns out this can be solved using linear programming in a very very elegant manner. So let me explain how that is done. So on the routes here now I have, say if I have a node i and a node j here I have a cost cij written for that particular link there. Now I want you to, before I write out the linear program I want you to appreciate the difference between this problem which is the shortest path problem and the problem of maximum flow. The problem of shortest path is simply says I want the shortest path from go to go from S to D without, but every when I travel on any edge in the path, any edge or any link ij on the path it cost me something. There is a certain toll or a certain fee that I have to pay, but there is the capacity is virtually infinite like any amount of flow can go on. So the problem, whereas the other problem there is no cost associated with traveling from i to j, but there is a limitation of capacity where you cannot send more than a certain amount of flow. So you can think of capacity and cost as two different things capacity is how many cars say a road can take capacity of that road. So the cost of traveling on that road is the toll you have to pay for traveling on it. These are two very different things. There are finitely many nodes yes, there are finitely many nodes that you can by which you can and we want to know the shortest path on that particular from source to a destination. No, no, no. So even in a real life problem you need to model it in such a way that it brings it you have finitely many nodes and finitely many decisions to make. So even though there are, the point is even though there are just finitely many, the number is too large. If you just think of all the possible routes you can take, the number of combinations you can make is immense. But what is very nice is you can actually solve this using linear programming in a very clean way. So as I was saying there are two, these are two different problems. The first problem is that of the earlier problem which is the maximum flow problem is about sending the maximum flow over capacity constrained networks. That is about finding the bottleneck. This problem is there is no bottleneck. You can set as much flow as you like. But the which links will you choose is the question. Because the links that you will choose based on the links you will choose you will incur a cost. So now since the cost and the cost here we will, what we will do is say let us say let me write this in this sort of way. Now suppose just imagine suppose I had one unit of flow entering S, just one unit. Some one unit of goods say one truck or whatever, one unit of goods let us not one truck, one unit of goods entering node S and which has to reach a node T. So it enters here and has to reach T. Whenever this flow, one unit of flow reaches any particular node say it reaches this node I, it has a decision to, there is a decision we need to make which is that out of all the links that are going out from node I which one should I pick. Now suppose at node I I have these links which have costs say 10, 20 and 30. These are the costs of the links not capacity costs of the links which and suppose from I know that from here let us say for simplicity from here this is the cost that I would incur say if I came here and then from here if I had to go all the way till here is suppose the cost I would incur someone told me this number that here is the cost I would incur if I came here. So if I came to node I and I chose this particular this particular link it would cost me 20 to get to Delhi if I chose this particular link it would cost me 10 to get to Delhi the other one would cost me 30 to get to Delhi not just to the next node I am taking suppose all the way till Delhi for simplicity. In that case how where would you send your flow? You would send the flow on to the one that is that has the least possible cost of all of these naturally the reason is because the links do not have any capacity constraint there is no reason for you when the flow arrives at a particular node there is no reason for you to split the flow across multiple edges you would auto you will always pick the one that the pick the one that has the least possible cost to reach the destination from there on. So this simple observation is all that we actually need here. So let us write let us write out the some variables and I will explain to you how this works out. So suppose suppose X ij so suppose I am sending so imagine one into node s. So you send a unit flow into node s let X ij be the flow on link ij X ij be the flow on link ij. So what is the objective in expressed in terms of X ij suppose I had a if I have so if I am sending flow X ij on link ij what we will use this interpretation and it will later turn out that this is actually correct. So we will have this interpretation that this is equal to 0 if i, j is not on the chosen path and one otherwise. So it will turn out that if it is not on the shortest path then I X ij would be 0 which means that it will not send any flow on and if it is on the shortest path it will have to send the full flow on it. So the reason for that is exactly what I just said whenever the flow arises arrives at a particular node if it you look at the cost that it has to incur to get to the final destination and the path that will give you the least possible cost. The entire flow will go on to that path it has to be. So if at all a flow is there on a path that path must be the one that encounters the least cost it cannot be that part of it is there here part of it is there, part of it is there in or on another path. So now let X ij be the flow on link i, j and it will have the we will take this interpretation that will be 0 if i, j is not on the chosen path and one otherwise. So the objective is to simply then in these terms is to minimize. So what is this? This is the total cost of a chosen path and now all I need to make sure is that these flows satisfy my flow conservation constraints. So I look at X j, so my flow conservation constraints again my inflow is sum over j such that ij belongs to E this is the inflow, inflow into i then I have a sum over j and this is not ij this should be j i belongs to E, this is ij belongs to E this is this should be equal this is 1 if i is the source node, 0 if i is neither the source node nor the destination node and minus 1 if i is the if i is the is the destination node is this correct sorry my mistake here sorry this should be the other way around this should be minus 1 here that is correct. So this should be minus 1 if i is the source node because so that positive 1 inflow into i so that is correct it is minus 1 this would be it would be 0 at all nodes except for the source node and destination node and it would be equal to 1 at the outflow and we have that X ij is greater than equal to 0. So what have we done we have taken a problem of shortest path and of which was about which was about trying to enumerate all the possible paths in the network and trying to find the shortest path and we have converted it into a problem of finding of minimizing the cost of flow. He said let us imagine a unit flow that was sent in if a unit flow sent in and it had to follow my flow conservation equations what would be the path it would choose it is almost like you know you are sending a flow of water and it is trying to find the path of least resistance or least to go from a particular source to a destination. You solve this and it turns out that this actually gives you the shortest path. So this is a linear programming formulation of a problem that on the face of it looks extremely complicated just you know if you had to enumerate all the possible path would be a horrendously complicated problem but knowing the knowing but with this sort of way of looking at it we are able to reduce it to a linear programming problem. There are many other such problems that end up getting reduced to linear programming that is why linear programming is such an extremely powerful tool across all of engineering and science. So with this we conclude our study of linear programming what I have not touched upon at all is algorithms for linear programming because I plan to come to that next but what I want you to remember the biggest takeaway I want you to remember from linear programming is linear programming duality and associated Farkash lemma. So Farkash lemma is something that we will use again and in one shot you will see how that gives us also optimality conditions for any type of convex optimizations so that is that would be next on the agenda. The form of there is another form of let me mention this also so there is another form of Farkash lemma which we will different form which will be very useful in the in the next lecture. So let A in R m cross n and C belong to R n then the following statements are equivalent for all x such that A x is less than equal to 0 we have C transpose x less than equal to 0 for all x such that A x is less than equal to 0 we have C transpose x less than equal to 0 and then there exists A lambda greater than equal to the other statement. So the Farkash lemma is saying that there are two statements that are equivalent the first statement is that for all x such that A x is less than equal to 0 we must have C transpose x less than equal to 0 the second statement is that there exists a lambda greater than equal to 0. So, lambda is in R m lambda greater than equal to 0 such that A transpose lambda equals C. So, this statement is essentially this this version of Farkash lemma is a different form of of of stating Farkash lemma this is not stating it in the form of two statements out of which only one can be true rather it is saying that these two are equivalent. These are two equivalent ways of saying the same thing one is that for all x such that A x is less than equal to 0 we have C transpose x less than equal to 0. The other is saying that there always is a lambda greater than equal to 0 such that A transpose lambda is equal to C right. So, what this basically is if you look at the second statement what it is saying is that it says is that C is in the cone generated by the columns of A transpose C is present in the cone generated by the columns of A transpose. So, you can always find a conic combination of the columns of A transpose such that the that conic combination equals C right. The first statement says something completely different it says that A x whenever A x is less than equal to 0 it has to be that C transpose x is also less than equal to 0. So, columns of A transpose is consider a cone formed by the columns of A transpose that contains C that is one statement the other statement says that if you look at the if you look at vectors x such that such that A x is less than equal to 0 then they must make an obtuse or greater than equal to 90 degree angle with C C transpose x less than equal to 0. It turns out these two are actually equivalent. So, this is this is another form of Arka Schlemmer and we will this again can be proved using linear programming duality again you have to think of the right sort of linear program look at its dual and again you will be able to argue from that. In fact, you may even be able to prove linear programming duality itself from linear form this particular Arka Schlemmer. So, without you know going through preparating hyperplanes and so on. So, the first principles proof of this Arka Schlemmer would be as hard as LP duality itself. So, the important thing the reason I mentioned is now is that remember this we will use this in a definitive way in the next class. So, we will end it.