 In this video, we'll provide another example of setting up a linear system of equations to help us. In this case, it's gonna be a network flow type problem. So imagine we have this following grid with nodes, A, B, D, G, H, Z. Imagine these are names of cities or warehouses or something like that. And so what we have to do is we have to ship 7,000 commodities from site A to site Z. So it'll end with 7,000 as well. Now, they can take different paths so 1,000 can maybe go to B, 6,000 could go to G, something like that. It perhaps could break off from there. Don't worry about that right now. But when you look at this, each of the nodes in this network has a conservation law in play here. So if you look at node B, you have all of the things coming from A directly. You have all the things coming from G. That's the input into the node. And then exiting B can ship to D or to H and so the conservation is the amount of commodities entering the node B must be the same as exiting. And so in the presence of this conservation law, we then get a system of linear equations and we're gonna get an equation for each of the nodes in this network. So the first one, we're always gonna write the input on the left side and the output on the right side. So if you look at the vertex A, you have 7,000 coming in. That's where they start, right? But then they can exit. They can either go to B using the edge, which we've labeled X1, or then go to G using the edge X2. So the 7,000 has to be X1 and X2 combined. So some combination, so like X1 could be 1,000, X2 could be 6,000, like we said. Then let's just go through alphabetical order here. If you look at vertex B, so X1 and X3 enter the system. Exiting the system is X5 plus X6. Look at then D next. Entering the system is just X6. Exiting the system, oh, I take that back. I'm sorry, X6 comes in, but you also have X7 from H. Exiting the system is just X9 to the final site Z right there. Let's now go to G. G has input from X2, but then it exits to B via X3 and it goes to H using X4. Now, if this was like a multigraph and there was multiple edges, maybe there's more than one path between two sites, we would label each of the edges differently, not a big deal, and we would accommodate those with a different X. All right, we just did G. Let's now do H. H has input from X4 and X5, and it has output to D via X7 and then to Z via X8. And then finally, let's do vertex Z. Z has input from X8 and X9, and then in the end, there should be 7,000 commodities that end up at Z because they don't go anywhere, right? They stay put. And so now we have this linear system. If we were to put it in the more standard form, we like to put all of the variables on the left-hand side. So we get something like X1 plus X2, that's equal to 7,000. For the next one, we have X1 plus X3. We're gonna get a minus X5 minus X6, that's now equal to zero. We're then looking at the next equation, you have an X6 plus X7 minus X9, that's equal to zero. The third equation, we have an X2. You'll notice I'm trying to line up the variables as much as I can. That does help for a cleaner system of equations. So you get X2 minus X3 minus X4 is equal to zero. Next we're gonna get X4 plus X5 minus X7 minus X8 is equal to zero. And in the last situation, you get X8 plus X9 is equal to the 7,000. I'm a little crowded over there, sorry about that. But then we get this system of linear equations like so. And so now in this one, this is again, going to be an under-determined system because we have more variables than equations. There's these, we have these six equations from the six nodes, but we had these nine possible paths that one could take. Now that means there are gonna be free variables and that's because there's some flexibility. What should X1 and X2 original division be? But once some of those free decisions are made, then the rest of them will be dependent upon those. But also in practice, there's some more rules coming in that aren't part of this linear system. Like for example, we probably have the observation that XI should be non-negative. Like you can't, do you send something backwards? No, that doesn't really make any sense. So there's a constraint there. It could also be that there's certain capacities. So like XI is less than or equal to some capacity CI. Maybe in the original picture, I said 1,000 and 6,000 but maybe the capacity for X2 is actually 5,000. So then you can send 2,000 here maybe or something like that. There could be some extra constraints. Now we're not gonna worry so much about that. Those extra considerations lead to a very rich application of linear algebra called linear programming. For this video, of course, we're just focusing on setting up this linear system by looking at the conservation laws for this network flow.