Refer attached image.
Criteria1: Each vendor has known static shipping price
Criteria2: vendor may or may not have minimum purchase charge.
Customer need to purchase n products. Choose the products based on price, minimum purchase charge and shipping price.
e.g -
Vendor(5) has 1.2$ shipping charge and no minimum purchase limit.
Vendor(1) has 1$ shipping charge and a minimum purchase charge 5$ if the order cost is less than 60$.
If we don't purchase product of worth x then minimum purchase charge y will be included into the order total.
Let say you purchase product1 (3 quantity), product2 (1 quantity) from vendor1 and product3 (3 quantity)
from vendor5.
Now (product1 price * 3) + (product2 price * 1)= (10 * 3) + (20 * 1)=50$
Vendor1 minimum purchase order is 60$ which is greater than 50$ hence vendor1 charge 5$ more to the total.
So the total cost is 50 + 5 + (product3 price * 3)=55+ (10 * 3)= 85 + 1 + 1.2 (shipping price) = 87.2$ is our total cost.
The best combination would be
vendor1 - product1 * 3 + product2 * 1 + product3 * 1
+
vendor5 - product3 * 2
= 30 + 20 + 12 + 20 + 1 + 1.2= 84.2$ is our total cost
What we need from you?
* An algorithm to get the best product match from the 2X2 array. If this is done correctly then we will award you 50% of the project cost.
* Solution to run 30 X 20 array faster using your algorithm. Or a better algorithm to run 30 X 20 array faster. (faster = less than 2 hours). We will award you the rest of the project cost if this is accomplished.