mospy26 / complete-bookstore

0 stars 0 forks source link

[1]/[5] Find a warehouse that can fulfil the complete order #1

Closed mospy26 closed 4 years ago

mospy26 commented 4 years ago

Note: For these purposes, all warehouses that can fulfill the order are equally good – that is, we don’t have to find the ‘best’ warehouse for an order.

mospy26 commented 4 years ago

f1d0b024aae4e178034bc9c03e660b9b6a6504c4

mospy26 commented 4 years ago

Warehouse and stock correctly modelled - 12d118cc99dff8d4d775211495ba2d4a303d6361

Things needed to be fixed:

blam135 commented 4 years ago

@mospy26 plz check the logic see if it's all good or if I missed anything

652f80fec707d1aa9d6da60cb5ded4c031938940

SuKaiwen commented 4 years ago

IDEA: 1) Sort the warehouses by total stock. 2) For each warehouse (most stock -> least), check if it can satisfy the order. 3) Get the first warehouse that satisfies the order. 4) If you cant satisfy the whole order, loop again until satisfied (use a boolean to check if order is impossible to be satisfied).

mospy26 commented 4 years ago

Algorithm still remaining to be done

SuKaiwen commented 4 years ago

Warehouse stuff finished but uses GREEDY SOLUTION (not optimal)...