G家面试题请教# JobHunting - 待字闺中
j*n
1 楼
1.
Given multiple printers on a grid map, find the location to place papers
such that the sum of distance from the
paper to all printers is minimal; note that there are obstacles in the grid
map. What if there is no obstacles?
2
2d array *代表障碍物 #代表货物 空白就是正常的路
问
如何找到一个点为出发点 能实现总共取货路径最短? 每次只能拿一个货物,遇到障碍
需要绕开,拿到以后要放回出发点,然后再取另一个
******
* # *
* *** *
* *
* ** *
* # #*
** ****
如果没有障碍物,就是曼哈顿最短距离,http://stackoverflow.com/questions/10402087/algorithm-for-minimum-manhattan-distance,如果有障碍物,什么算法比较好? 大牛请解惑
Given multiple printers on a grid map, find the location to place papers
such that the sum of distance from the
paper to all printers is minimal; note that there are obstacles in the grid
map. What if there is no obstacles?
2
2d array *代表障碍物 #代表货物 空白就是正常的路
问
如何找到一个点为出发点 能实现总共取货路径最短? 每次只能拿一个货物,遇到障碍
需要绕开,拿到以后要放回出发点,然后再取另一个
******
* # *
* *** *
* *
* ** *
* # #*
** ****
如果没有障碍物,就是曼哈顿最短距离,http://stackoverflow.com/questions/10402087/algorithm-for-minimum-manhattan-distance,如果有障碍物,什么算法比较好? 大牛请解惑