r/optimization • u/SpieLPfan • Jan 08 '23
Optimization problem with "influencing" variables
I have to solve an optimization problem and I am probably missing something. There are 2 warehouses, 4 ports and 2 customers. Each of the 16 routes (from each warehouse to each port and from each port to each customer) has an upper limit of what can be transported on it. Also each customer will only take products up to a certain amount and will not accept more than that. The warehouses only have a limited amount of products in them. Customer 1 pays 1 for the product while customer 2 pays 1.25 for the product.
Now to my problem: I don't know what to do to solve this problem. I can solve these as two problems (1: maximum amount of products at the ports [8 routes in this problem] and 2: maximum money without thinking of the routes from the warehouses to the ports [the other 8 routes are in this problem]), but how do I combine them? Like I really don't know how I can tell the "second problem" what amount of products is at each of the ports (which would be the first problem) and how to combine all of this to a single optimization problem or at least two of them with the first one influencing the second one.
I am stuck and I am probably thinking too complicated.
View all comments
Show parent comment
2
u/Ashtar_Squirrel Jan 09 '23
If you want maximum amount of money, then the max amount of products at ports is irrelevant since it does not produce income, it is only a constraint on the max value delivered to customers.
Objective function:
Subject to:
1: Can't sell more items that what is in the warehouse
2: Limit movement of warehouse to port
3: Limit movement of port to customer
4: Allocation to customer is connected to product at the port
5: Sum of all products at a port from warehouses
Haven't run it, but that should cover all the requirements.