#Coffee shop problem
21 messages · Page 1 of 1 (latest)
we also have to generalize a solution to any grid and any number of friends
the algorithm i proposed is assigning every point on the grid the value of steps every friend needs to get there : https://prnt.sc/l9poFJtDav-y so the point with the lowest value is where we will put the shop
but the teacher said there is a better algorithm with lower complexity
any ideas?
Consider a simpler problem: if the friends are just on a line, what is the best place to put the coffee shop?
This generalises well to 2 dimensions
i know the trick for the line but i don;t get how it applies here
well ok i see
i don't see it, you get 14 if you pick (1,1) but the optimal is (2,2) with 12
no (3,3) with 10 of course
@bitter lodgewhat's the trick
oh didnt realize that mb
.close