I have come up with a script that I know isn't completed, but I was wondering if someone could tell me if I am on the right track.
Here is my script so far, but it does have some notes that I added because I wasn' sure where to place certain things within the code:
chart=[10 280 3;70 180 7;80 160 4;170 20 5;220 100 2;270 80 6]
distance= sqrt((x2-x1)^2 + (y2-y1)^2) ;----------
if cost < cost?
Here is the Question for the problem that I am trying to figure out:
Suppose that you are an engineer tasked with finding a new location for your distribution center (let's say you work as an industrial engineer at a cosmetics company). You have a good idea of who your customers are and how many tons of cosmetics you must ship per week. Using your company headquarters as the origin, you plot out the following table:
Customer x-location (miles) y-location (miles) Volume (tons/week)
JC Penney 10 280 3
BB&B 70 180 7
Target 80 160 4
Bath&Body Works 170 20 5
Walmart 220 100 2
Macy's 270 80 6
Your job as an industrial engineer is to come up with the location of the distribution center (to the nearest mile) that minimizes the cost for your company. The cost is given by the formula cost = 0.5 * distance * volume. Assume a dense network of roads such that the distance between your new distribution center and the customer is a straight line.
Any help is appreciated!