OK, this example is the famous transportation problem.
Suppose we have our factories on the left hand side.
As one to a three and we have Jay demand points, let's call them, do you want to do, for example?
And the question is how much we can, uh, produce from each factory in order to minimize the objective
cost?
And also, um, knowing that the capacity of each factory is limited, the capacity of each route is
limited, and also the demand should be satisfied.
OK, this is a famous transportation problem, and we have some factories on the left hand side and
we have these are the factories, these are the demand points and we know the demand of each point and
the capacity of each factory and the cost of production and the cost of transportation.
So the question is, in order to satisfy the demand on the right hand side, how much each factory should
produce and from which route we should transport these products from the factories to the demand in
order to satisfy all the constraints.
So there are two sections in the objective function.
So first of all, is telling us that transportation costs depends on the distance between the nodes
and also how much good are being transported from I to J.
Hi, this is the transportation problem.
And in this example, we want to know and if we have some factories and let's call them I and they are
running from as to history and there are some demand points.
Do you want to die for?
And the question is how much each factory should produce.
And in order to minimize the objective function, which is the summation of their production costs and
the transportation costs.
This is the transportation costs and this is the production cost.
And also there is another thing that should be satisfied that is that and the capacity of the factories
are limited and they should produce between some specific ranges and also the demand as each point should
be satisfied.
OK, so let me talk about the, um, promo codes for solving this problem.
So first of all, as usual, we have to import the required packages and then, um, define the required
sets.
And they are two different sets.
It's an abstract model.
Um, we have a demand which is defined over J p mean P max and costs are the parameters.
So and also the distance between, um, different nodes are, uh, defined as a parameter.
There's a variable X and telling us how much good is moving from eye to to, uh, from factory eye to
the demand point J.
And it is defined, um, as a real number, could be defined as a positive, real.
And also, uh, it has about between zero and three hundred, for example.
And there are some bounds for the generation side or the production side.
You can say that P.
Mm.
Is the final.
The AI is always within this pound.
Mm hmm.
And also, um.
How much you are producing is calculated this way, some version of, um, I NJ Automation of Model
X, uh, model X IJA for J in Model J.
Maybe we can improve it.
What we will see.
And also, um.
Um, this is this constraint is on the production side and also this side is ensuring that the demand
is satisfied.
I intentionally put it a bigger than equal to demand because it's easier for me to solve it, but it
will not produce more than what is needed.
OK, so this term is the production cost and this term is the, uh, transportation cost.
So, um.
Everything is fine here and also, um, the objective function, um, is this.
And we want to minimize that the saw the model, as you can see, it's a linear programming one and
also we have to.
We have to specify the data, so as you saw, we have some parameters defined on I saw Param.
Um, or I want to three p.m. max and calls, and if you have other characteristics, we could put it
here and also J it is defined over one to four and the demand is specified here in the perimeter distance
and the distance between each pair of, uh, nodes are given here.
OK, so you have to specify that in your.
That's fine.
And if you solve it, let me run the tabs one by one.
This one is wrong.
And also this one is wrong.
You can see the objective function is calculated here.
And if you want to visualize the decision variables, you can do it.
So I run this tab.
So these are the results, let's, uh, read them, uh, it is telling us that, um.
And the amount of, um, transportation, uh, between, uh, production one and demand one is zero,
production one on demand to zero, one on the one, three is three hundred and so on.
You could visually show that as well.
So these are the results that are visually shown.
And you can see the biggest transportation is between, um, point one and demand three.
And the next one is between two and demand one.
So if you have a look at that here, it's here.
So you see the next big quantity to be transported is from point two to demand number one.
Thank you very much.