0

I am trying to write an algorithm for optimizing a function for its global minimum, given certain constraints it presents. For the sake of the argument, I will give a real-world example: I am trying to minimize a basket f(*args)=7x+8z+12y , where, for example,

x=2 , in range(12) x=10 , in range(12,20) x=12 , in range(20,30) x=14 ,in range(30,++)
y=7 ,in range (18,29) y=16 ,in range (29,++)
z=132, in range(0,200) z=312, in range(200,400) z=987, in range(400,++)

This basket is a basket of raw materials supplied by Alibaba sellers. The problem is, there are multiple sellers selling one, two, or even all of these materials. The trick is they all have a minimum total cost of actually doing business with you. How do I minimize this basket- find its global minimum? All the methods that I have tried only find a local minimum and then sum it up- which is nonetheless not efficient. I took into consideration the Knapsack problem, genetic and greedy algorithms but I can't say any of these have sparked into me the 'AHA' moment, or at least I did not understand their full potential. I would love it if you could give me some advice on how I could approach this. Thanks!

  • Look into [lineair programming](https://en.wikipedia.org/wiki/Linear_programming), and [simplex method](https://en.wikipedia.org/wiki/Simplex_algorithm). There are also [python libraries](https://stackoverflow.com/questions/5791466/what-libraries-should-i-use-for-linear-programming-in-python) for doing the work. – trincot Feb 16 '21 at 11:45
  • I think in general we only get local minimum, which may be the global minimum as well. – thebluephantom Feb 16 '21 at 14:08
  • Any local minimum in a linear problem is also the global one - I didn’t look too much into your issue, but if your model can be represented by a linear system, then any local optimum is a global one. – Infinity77 Feb 17 '21 at 06:40

0 Answers0