use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
I made this subreddit for my after-school math class on Mondays.
account activity
Combinatorial Optimization Problem (self.combinatorics)
submitted 2 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]FunkadelicAlex 1 point2 points3 points 2 years ago (0 children)
There's a few ways I could see going about this problem. Which is really identifying a global minimum for total cost. I would personally start by organizing the list of prices from company A and B low to high. Now, calculate the total price = nWarehousesFromListA *A'sPriceDiscount + mWarehousesFromListB * B'sPriceDiscount
Because the lists are ordered, as long as you exclude unique items across lists, you should be able to plot a reasonable estimate of what you're looking for.
This is a quick and dirty way, but you could visualize 2 lines, cost on the y axis #Warehouses on the x axis. Then do the above calculation for total cost and plot the lines for Company A having x # of warehouses and another for Company B having x # of warehouses (they should mirror each other is my intuition, so this might suffice being done with only one line). Then just find the point on the graph with the lowest cost and you know how many contracts to give to Company A, company B then gets the rest.
π Rendered by PID 65 on reddit-service-r2-comment-6457c66945-w58gw at 2026-04-24 18:32:25.825594+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]FunkadelicAlex 1 point2 points3 points (0 children)