Minimize cost based on purchased volume Pyomo
问题 I'd like to find the optimal solution for buying goods from suppliers where the shipping cost is dependent on the cost of goods bought from given supplier. I'm using Pyomo. My code so far is: model = ConcreteModel(name="(MN_2)") # products N = ['prod1', 'prod2', 'prod3'] # suppliers M = ['A', 'B'] # price p = {('prod1', 'A'): 10, ('prod2', 'A'): 9, ('prod3', 'A'): 50, ('prod1', 'B'): 16, ('prod2', 'B'): 20, ('prod3', 'B'): 35} # user quantity contraint q_u = {('prod1', 'A'): 2, ('prod2', 'A')