由买买提看人间百态

topics

全部话题 - 话题: heuristics
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)
s*i
发帖数: 388
1
来自主题: JobHunting版 - 攒人品,google电话面经
兄弟,这些选过AI的人都知道,问题是能不能在电面的时候又快又准的code出来。。。
。你可以自己试试看,给你20min,你把heuristic写出来
f********e
发帖数: 55
2
1 - online portfolio一般是你的作品,不需要包括low-fi or high-fi的设计过程,
当然
了如果你有也可以,不过不要放在醒目的地方,否则网页会太大太多让人看不过来。面
试时他们会跟
你go over。
2 - 不同的公司有自己不同的理念,所以采用的process也不一样,需要通过面试来了
解或者今后
工作中掌握,但基本的思路书中可以寻到,比如heuristic evaluation,usability
inspection,还有quantitative的methods等;至于设计的过程,那更是各有个的搞法
,没有
统一规范。比如apple我听说是不怎么做external的user research的,所以他们的产品
保密能
做的那么好,也很让人惊讶他们不涉及end user的process居然能设计出可用性及高的
产品。书很
多,但是again我觉得经验大于书本,我就读过一本usability engineering - Jacob
Nielson,其他没读过的不敢妄作评价。
3 - 当然可以申请:)主要取决于他们看中什么,prototyping的能力,还... 阅读全帖
d****j
发帖数: 293
3
来自主题: JobHunting版 - 一道有关String的面试题
可以转化为解多元方程的问题.
假设x1 is 'a', x2 is 'b', ..., x26 is 'z',这个问题就变成:
给定:
hello--> 1*x8 + 1*x5 + 2*x12 + 1 * x15 = 1
hi --> 1*x8 + 1*x9 = 1
...
求解: hlleowlord-->
1*x8 + 3*x12+1*x5+...... = ?
当然并不是真正要解出每个xi,而是要用已知方程式组合出求解的式子。
能变成矩阵的什么相关通用问题了?数学达人解决一下?
不行的话,就只好用DP+backtrack+heuristics策略来匹配这些系数,如何?
k*p
发帖数: 1526
4
来自主题: JobHunting版 - 问一道算法题
想到一个heuristic的算法
设数组为a,定义一个vector b,一个计数器n记录当前找到的出现了的数字的个数
while(n<100) {
if(!b[a[i]]) {
b[a[i]]==true;
n++;
}
i++;
}
当n==100,说明除了那个没有的,其余都出现了,scan可以提前结束
10000个数只有101个可能,如果平均分布,很快就能找到
n*****y
发帖数: 361
5
来自主题: JobHunting版 - 请教一道电面算法题
It's interesting to think it as feature selection.
But your solution is only a heuristic, not guaranteed to find the minimum
set.
Notice the optimal solution not only prefers shorter sentence, but also
prefers words that are shared among multiple sentences.
Image there are 10 sentences, and 8 words as the following, the solution
will keep the longer sentences.
楼上的 bipartite graph 是正解. just my 2 cents.
S1 (W1, W2)
S2 (W1, W3)
S3 (W1, W4)
S4 (W2, W3)
S5 (W2, W4)
S6 (W3, W4)
S7 (W5)
S8 (W6)
S9 (W7)... 阅读全帖
b*****e
发帖数: 474
6
来自主题: JobHunting版 - 请教一道电面算法题
A* works (of course only for very small size problems):
Each word is a 0, 1 variable x_i.
Solution is (x_0, x_1, .... x_n)
start state: (0, 0, 0....)
step: change one 0 to 1. cost:1
heuristic: median value of all #of unknown words for each sentence.
it should be 0 when half of sentences are totally recognized.
If number of sentences is small (say 20), then I think the brute force
method is not bad, as it requires not much space at all.
j**w
发帖数: 382
7
来自主题: JobHunting版 - 请教一道电面算法题

minimum
Yes, in each step, if there is a tie. More work is needed.
The appropriate solution is based on the question itself. If the input
data are quite large (eg. all webpages in Internet), we need some
heuristic approaches because we can't put all words into memory.
However, if the input size is decent, the graph-based one should be the
better choice and DP might be over-skilled.
n*****y
发帖数: 361
8
来自主题: JobHunting版 - 请教一道电面算法题
DP won't work, because there is no ordering for those sentences.
The problem is combinatorial in nature.
Given the simple description of the problem, I thought it must be a well
known problem or equivalent to some of the well known set covering or
bipartite graph matching problems, but I cannot find the answer - I kind of
suck at these algorithms.
As far as interview goes, I believe if you can formulate it as a bipartite
graph and provide some search heuristics (greedy, branch and bound), it
sho... 阅读全帖
b***e
发帖数: 1419
9
典型的长平赵括。
在工业界,核心的算法就那么几个,没有什么太多的time/space。到了最后大家都差不
多,看谁的
heuristics好些罢了。真正的问题其实是在于software development scalability,说
白了就
是东西做大了,人多了,怎么搞才能多快好省。大公司里的software architect,鲜有
精专研究算
法的。重要的是如何选择platform, 在其上建立什么样的framework, 然后设计
patterns让整个系
统可以scale, not only for run-time performance, but also for development
performance.
y***m
发帖数: 7027
10
码农=砌砖工
架构师=建筑设计师
测试=...
问问贝聿铭是否精于砌砖?...

典型的长平赵括。
在工业界,核心的算法就那么几个,没有什么太多的time/space。到了最后大家都差不
多,看谁的
heuristics好些罢了。真正的问题其实是在于software development scalability,说
白了就
是东西做大了,人多了,怎么搞才能多快好省。大公司里的software architect,鲜有
精专研究算
法的。重要的是如何选择platform, 在其上建立什么样的framework, 然后设计
patterns让整个系
统可以scale, not only for run-time performance, but also for development
performance.
f*****w
发帖数: 2602
11
来自主题: JobHunting版 - amazon 1st phone interview

Fibonacci ?
没很明白 难道用两个stack 全倒出来一遍?
heuristic, 就number of different chars 好了
g*******s
发帖数: 490
12
来自主题: JobHunting版 - 一个设计题目,大家讨论一下
这个题目挺有意思得。
假设大概知道每个任务需要得cpu时间和产生得文件大小
简言之,应该就是simulate这些任务得执行情况根据不同顺序和调度策略,然后选择出
一个比较好得顺序or策略了,而评判得条件就是模拟这些任务完成需要得时间了
最naive得就是purely random得调度了,但是可以有一些heuristic得调度策略,比如
在某个state,系统cpu占用大并且还需要较长得占用时间,但是i/o空闲,就选择cpu时
间少但是i/o时间多得任务。如此
b*f
发帖数: 212
13
来自主题: JobHunting版 - 求一道 面世题 的解答思路
Word Rectangle
Write a program to find the largest possible rectangle of letters such that
every row forms a word (reading left to right) and every column forms a word
(reading top to bottom). Words should appear in this dictionary: WORD.LST (
1.66MB). Heuristic solutions that may not always produce a provably optimal
rectangle will be accepted: seek a reasonable tradeoff of efficiency and
optimality. (Hint: Use a B-Tree)
我只能想到把词典里的单词按长度分组,然后穷举法。感觉这样的话计算机要被搞死。
不知道哪位大虾有什么巧妙的方法!!
i**********e
发帖数: 1145
14
来自主题: JobHunting版 - 求一道 面世题 的解答思路
很明显阿。。。
你看问题里提到:“Heuristic solutions that may not always produce a provably
optimal rectangle will be accepted: seek a reasonable tradeoff of
efficiency and optimality.”
如果你要寻找最大的任意矩形而这答案必须正确,是不可能在短时间内搜索到的。
r*******g
发帖数: 1335
15
来自主题: JobHunting版 - 报面经+offer
进来拜大牛
第一题和我最近看的论文很像,但是是heuristic的
d*c
发帖数: 121
16
optimization modeling, algorithms, especially simple heuristics which can
scale easily.
some programming questions
h****e
发帖数: 928
17
来自主题: JobHunting版 - dropbox的challenges
大家看过吗:
https://www.dropbox.com/jobs/challenges
我觉得好难。最后一道题就是NP问题,但是又觉得或许用一些
heuristics得到最优解或次优解。
a***u
发帖数: 36
18
这个评论很中肯。看某大公司内部人说为什么他们招人考算法:
Big companies like Smarts and common sense people. Medium and Small
companies like experienced people. We hire for smarts and for skills.
Sometimes, in a pinch, we'll settle for one or the other. Our hiring
philosophy is that if someone is smart and motivated, then they should be
able to make up for any particular skills they might be lacking, provided
they have "enough" of the basic skills according to some ill-defined but
hopefully intuitive heuristic.
f*****e
发帖数: 2992
19
来自主题: JobHunting版 - InterviewStreet problem - Meeting Point
和clustering有点像,heuristic就是先求重心,然后求离重心最近的一点。
n**l
发帖数: 17
20
来自主题: JobHunting版 - amazon OR scientist面经
EE phd,非OR专业,不过一些相关的部分有了解.很想拿到这个机会,跟做过的东西比较相
关.第二轮被灭了,问题很变态,现在郁闷中.分享一下题目.
第一轮.中规中矩.面试人是一个OR PHD,人很nice.
1.介绍一个做过的项目.问了一些细节.
2.两个人扔dice, A开始扔,谁扔到6,谁赢,问A赢得概率.(6/11)
3.一个仓库, 给一些价格参数,和demanding pattern,pdf/cdf,预测profit.
(这个人很好,给的条件很详细,而且很清楚.他说他希望听到大概思路,人也非常有礼貌.)
4.怎么从uniform成生norm distribution
第二轮.印度人or法国人 master.
(听口音像印度人,不知道怎么在法国读书,难道法国人说英语和印度人有点像?).
1.介绍一个项目. 他没听懂.
2.有很多package, 每个package重量不同,装到2000lb的车子上,最少需要多少车子.
说这个是NP,给了一个方法,heuristic solution,他问怎么prove别人,这个解是接近最
优解得.(给了一些思路,比如分析不同的package we... 阅读全帖
n**l
发帖数: 17
21
来自主题: JobHunting版 - amazon OR scientist面经
EE phd,非OR专业,不过一些相关的部分有了解.很想拿到这个机会,跟做过的东西比较相
关.第二轮被灭了,问题很变态,现在郁闷中.分享一下题目.
第一轮.中规中矩.面试人是一个OR PHD,人很nice.
1.介绍一个做过的项目.问了一些细节.
2.两个人扔dice, A开始扔,谁扔到6,谁赢,问A赢得概率.(6/11)
3.一个仓库, 给一些价格参数,和demanding pattern,pdf/cdf,预测profit.
(这个人很好,给的条件很详细,而且很清楚.他说他希望听到大概思路,人也非常有礼貌.)
4.怎么从uniform成生norm distribution
第二轮.印度人or法国人 master.
(听口音像印度人,不知道怎么在法国读书,难道法国人说英语和印度人有点像?).
1.介绍一个项目. 他没听懂.
2.有很多package, 每个package重量不同,装到2000lb的车子上,最少需要多少车子.
说这个是NP,给了一个方法,heuristic solution,他问怎么prove别人,这个解是接近最
优解得.(给了一些思路,比如分析不同的package we... 阅读全帖
i*****e
发帖数: 5233
22
五轮那也太bt了 基本上or的就是建模 改进heuristics, 统计, 算法,sql ,case
study都有
h**********9
发帖数: 3252
23
来自主题: JobHunting版 - 请问G一题

客气点好吗?我又不是全职解题的,拖家带口的有点时间不容易.
还有一些地方没想通,就当这个是 heuristic greedy 解,不一定能算出最优解,先给
个 O((Max(x) - Min(x))*N^2) 的 code, 谁能帮忙验证一下? 如果可行我再解析O((
Max(x) - Min(x))*N*LG(N))。
import java.util.Arrays;
public class Partition {

public static int getMinDifference(int input[]) {
assert (input.length % 2 == 0) : "Input must have even number of
items.";
Arrays.sort(input);
int x[] = new int[input.length / 2];
int y[] = new int[input.length / 2];
for(int i = 0; i < x.... 阅读全帖
h**********9
发帖数: 3252
24
来自主题: JobHunting版 - 请问G一题

客气点好吗?我又不是全职解题的,拖家带口的有点时间不容易.
还有一些地方没想通,就当这个是 heuristic greedy 解,不一定能算出最优解,先给
个 O((Max(x) - Min(x))*N^2) 的 code, 谁能帮忙验证一下? 如果可行我再解析O((
Max(x) - Min(x))*N*LG(N))。
import java.util.Arrays;
public class Partition {

public static int getMinDifference(int input[]) {
assert (input.length % 2 == 0) : "Input must have even number of
items.";
Arrays.sort(input);
int x[] = new int[input.length / 2];
int y[] = new int[input.length / 2];
for(int i = 0; i < x.... 阅读全帖
d**e
发帖数: 6098
25
☆─────────────────────────────────────☆
Geman (Geman) 于 (Sat Apr 21 16:53:44 2012, 美东) 提到:
天天看mitbbs报这些公司的offer。忽然有些想法,只是个人看法,感觉这些公司招人
一个模式,总是考察一些本科生就会的东西。可替代性太强了,万一某天干不动了,随
便找个人甚至半路出家做programming的就可以替代了。在这些公司里除了多了些编程
经验,真的学会了很多东西吗?
应该还是技术性很强,可替代性不强,而有一定的进入壁垒的公司职位好吧?越干越吃
香,不是随便招个码农就可以顶替的。我指的技术是某些研究性质engineer的位置,这
些位置在A,G,F,M这些公司往往很难拿到。大多数进去的人就是混个engineer,想来想
去觉得意义不大,job的安全性低,天天编程时间长了也烦了。
☆─────────────────────────────────────☆
zhaichun108 (onlylonely) 于 (Sat Apr 21 16:58:29 2012, 美东) 提... 阅读全帖
j*****y
发帖数: 1071
26
来自主题: JobHunting版 - 这道题目用 brute force 好慢阿
是这个网站上的一道 puzzle
http://www.itasoftware.com/careers/puzzle_archive.html
我是通过分别 分割 x 坐标 和 y 坐标,得到更小的 area, 实行 brute force
, 看不出来这么小的区域计算量也很大。
Strawberry Fields
Strawberries are growing in a rectangular field of length and width at most
50. You want to build greenhouses to enclose the strawberries. Greenhouses
are rectangular, axis-aligned with the field (i.e., not diagonal), and may
not overlap. The cost of each greenhouse is $10 plus $1 per unit of area
covered.
Write a program that chooses the ... 阅读全帖
h****y
发帖数: 12
27
bless!
迷宫那个用a-star搜索是不是会比较有效。heuristic函数可以直接用曼哈顿距离(不
是最优,但是最容易实现)。

onsite
J*****D
发帖数: 190
28
我在想没人回复是不是信息提供的太少,离开lab前再发一个:
现在在一个牛导的组里做product design optimization. Basically about utilizing
trade space exploration and data visualization to facilitate design
decision-making, and to improve design cycle time. funding从令一个外系的组出
,当年自己折腾找来的。
做过很多supply chain modeling projects. Monte Carlo simulation for inventory
positioning with downward substitution using stochastic linear programming.
Simio (discrete event simulation) based supply chain network design and
optimization (transportation networ... 阅读全帖
G****A
发帖数: 4160
29
来自主题: JobHunting版 - 发个刚面完的rocket fuel的面经吧
这两道题onsite肯定拿不下来啊
1. 算是binary search的一个应用。2分法找pivot,对于每个pivot计算相应的
expected k. 如果expected k和当前pivot的位置吻合(i.e., k >= A[pivot] && k <=
A[pivot + 1]),则返回k
2. 他应该不是想求最优解吧?!能不能给个heuristic? 排序 p(i) / (l(i) * w(i))
,然后顺序选取。

26,
G****A
发帖数: 4160
30
来自主题: JobHunting版 - 发个刚面完的rocket fuel的面经吧
这两道题onsite肯定拿不下来啊
1. 算是binary search的一个应用。2分法找pivot,对于每个pivot计算相应的
expected k. 如果expected k和当前pivot的位置吻合(i.e., k >= A[pivot] && k <=
A[pivot + 1]),则返回k
2. 他应该不是想求最优解吧?!能不能给个heuristic? 排序 p(i) / (l(i) * w(i))
,然后顺序选取。

26,
D*********Y
发帖数: 3382
31
来自主题: JobHunting版 - 做Big data的前景如何?
 Bachelor’s Degree in engineering, mathematics, computer science
, statistics, physics, economics, operations research or related field;
graduate or post-graduate degree a plus
 A minimum of 5 years of experience at a financial company or in
a research organization working with large data-sets and multi-variate
analysis.
 Demonstrated quantitative aptitude including financial modeling
and a well-developed analytical skill set.
 Background in statistic... 阅读全帖
d*******n
发帖数: 124
32
来自主题: JobHunting版 - 发个题目看谁会做
yes, and some heuristic can be used to find the circle more quickly

we
n
l*n
发帖数: 529
33
来自主题: JobHunting版 - 讨论下nexussnap的twitter灯泡题
你这已经是通行的heuristic解法了。
http://www.hamusutaa.com/pilot/solution.html
http://lbv-pc.blogspot.com/2012/08/turn-lights-off.html
就是第一行按或者不按,然后通过下面一行改上面一行。第一行2^n次方后还不行就是
不行了。
s*********l
发帖数: 103
34
来自主题: JobHunting版 - 杂七杂八的一些面经 (转载)
> Q9:为什么有时候K means算法不能converge?
http://en.wikipedia.org/wiki/K-means_clustering
The algorithm has converged when the assignments no longer change. Since
both steps optimize the WCSS objective, and there only exists a finite
number of such partitionings, the algorithm MUST converge to a (local)
optimum. There is NO guarantee that the global optimum is found using this
algorithm.
...
As it is a heuristic algorithm, there is no guarantee that it will converge
to the global optimum, and the result m... 阅读全帖
p*******r
发帖数: 14
35
来自主题: JobHunting版 - 报个Box Offer,和面经
My solution is, reduce the elevator direction turns as possible as we can.
For example, if the elevator is going up, and there are some requests from
above, then the elevator keeps going up. It is heuristic algorithm.
Q*******1
发帖数: 91
36
怎么确定是否被学校坑了。给你看一个学校的课程表,你看看会不会被坑呢。
%%%%%%%%%%%%%%%这个是bgsu的课程设置
Fall
MSA 5020 Regression Analysis
MSA 5400 Database Management
MSA 5470 Exploratory Data Analysis
MSA 6010 Decision Optimization
MSA 6701 Analytics Project I
Spring
MSA 5160 Time-Series Analysis and Forecasting
MSA 5600 Business Intelligence
MSA 6440 Data Mining
MSA 6500 Big Data Analytics
MSA 6702 Analytics Project II
Summer
MSA 6450 Advanced Data Analytics
MSA 6600 Project Management
MSA 6703 Analytics Project III
%%%%%%%%%%%%%这个是S... 阅读全帖
Q*******1
发帖数: 91
37
怎么确定是否被学校坑了。给你看一个学校的课程表,你看看会不会被坑呢。
%%%%%%%%%%%%%%%这个是bgsu的课程设置
Fall
MSA 5020 Regression Analysis
MSA 5400 Database Management
MSA 5470 Exploratory Data Analysis
MSA 6010 Decision Optimization
MSA 6701 Analytics Project I
Spring
MSA 5160 Time-Series Analysis and Forecasting
MSA 5600 Business Intelligence
MSA 6440 Data Mining
MSA 6500 Big Data Analytics
MSA 6702 Analytics Project II
Summer
MSA 6450 Advanced Data Analytics
MSA 6600 Project Management
MSA 6703 Analytics Project III
%%%%%%%%%%%%%这个是S... 阅读全帖
r**********n
发帖数: 97
38
Most BS has not idea about machine learning/data mining and can only do
heuristic solution which is useless at search results and ads ranking/
bidding.

writing
A*********c
发帖数: 430
39
本来我是带着娱乐的态度来回帖的,但是既然碰到了大牛,请educate我。
请告诉我任意一个数据结构,比inverted list 更重要,并且广泛地应用到了实际的
text retrieval system中.
请告诉我任意一个document retrieval model,比vector space model 或者 Okapi
BM25, Statistically significantly better for general purpose document
retrieval. Either implemented in Lucene or Lemur.
请告诉我任意一个clustering algorithm,other than Kmeans,will be your safe
first choice of clustering when you see some arbitrary data.
对于Classification,Old Stuff Like KNN works well in many cases. Kernel
algorithms are go... 阅读全帖
A*********c
发帖数: 430
40
本来我是带着娱乐的态度来回帖的,但是既然碰到了大牛,请educate我。
请告诉我任意一个数据结构,比inverted list 更重要,并且广泛地应用到了实际的
text retrieval system中.
请告诉我任意一个document retrieval model,比vector space model 或者 Okapi
BM25, Statistically significantly better for general purpose document
retrieval. Either implemented in Lucene or Lemur.
请告诉我任意一个clustering algorithm,other than Kmeans,will be your safe
first choice of clustering when you see some arbitrary data.
对于Classification,Old Stuff Like KNN works well in many cases. Kernel
algorithms are go... 阅读全帖
a***y
发帖数: 852
41
顶这个,学术圈的state-of-the-art research和工业界的de-facto还是不一样的
但是目的本身也一样,学术界本质目的还是求新知。work的好的但是已经被充分理解的
,或者heuristic没有太大通用意义的发不出来也是正常
classification算法方面我觉得random forest, deep learning, boosting相关的都比
SVM更实用。SVM主要是背后的learning theory牛逼,算法本身已经有点过时了,因为
复杂度高并且本质上是shallow learning,而且不容易fine tune,但是理论不会过时
,因为理论就算暂时解释不了实践,也还是可以持续发展的。
clustering目前无解,因为问题本身定义是模糊的,对任意数据最多能够假设一个
gaussian mixture,也就是用k-means。很多文章也在质疑这个是science 还是 art。
但是可以期待一个好算法帮助选择k-means里面的k,同时又像kmeans本身一样高效。
Bayesian topic modeling可以做这个但感觉没有太大前途。未来... 阅读全帖
a***y
发帖数: 852
42
顶这个,学术圈的state-of-the-art research和工业界的de-facto还是不一样的
但是目的本身也一样,学术界本质目的还是求新知。work的好的但是已经被充分理解的
,或者heuristic没有太大通用意义的发不出来也是正常
classification算法方面我觉得random forest, deep learning, boosting相关的都比
SVM更实用。SVM主要是背后的learning theory牛逼,算法本身已经有点过时了,因为
复杂度高并且本质上是shallow learning,而且不容易fine tune,但是理论不会过时
,因为理论就算暂时解释不了实践,也还是可以持续发展的。
clustering目前无解,因为问题本身定义是模糊的,对任意数据最多能够假设一个
gaussian mixture,也就是用k-means。很多文章也在质疑这个是science 还是 art。
但是可以期待一个好算法帮助选择k-means里面的k,同时又像kmeans本身一样高效。
Bayesian topic modeling可以做这个但感觉没有太大前途。未来... 阅读全帖
A*********c
发帖数: 430
43
来自主题: JobHunting版 - eBay onsite面经,已挂
If I remember it correctly, this is covered in the search chapter of Russel
's classic AI book. It is not hard. nothing fancy there. It is just obsolete
knowledge. Not many people care about it.
It is really strange for them to ask things like that if they are not
working on "game AI path finding" or "heuristic search".
s*******m
发帖数: 38
44
来自主题: JobHunting版 - eBay onsite面经,已挂
h: heuristic
s*******m
发帖数: 38
45
来自主题: JobHunting版 - eBay onsite面经,已挂
h: heuristic
h*****u
发帖数: 109
46
来自主题: JobHunting版 - 贡献个题
这是facility location里的 p-covering 问题。但是这个题有点confusing. 如果
objective is 每个小区到最近的仓库的距离和最小,那么解是 在每个m点建一个仓库。
这样的objective 等于0.
实际上通常的还有的限制如: 1: 最多建k个仓库。2:每个仓库有fixed cost.
General covering problem 是NP-hard. 面试时估计只有Greedy heuristic了吧。
M**********s
发帖数: 8
47
来自主题: JobHunting版 - 求问G面试题,非普通的DP
这是2D bin packing问题吧?这样的话就是NP-hard
先问问是否有额外的条件,照片大小、张数之类的
如果额外条件的话,应该无法在polynomial time求最佳解
可以构思一些一些heuristic approach
题外话,游戏常需要把很多不同大小的textures压在同一张texture
就是要用类似的方法
但optimize的目标不一样:
游戏要用最少的「牆壁」,而这题是只有一面牆壁要贴最多的照片。
不知道我记得的跟您说的是不是同一题
USACO 1.4.1 Packing Rectangles 那道题只有4个矩形,brute force就解掉了
但如果有30张大小不同的照片恰好可以塞在一个大rectangle中,可能是找不出最佳解的
我觉得2D DP不可行,原因如先前有人提到,就是无法model不同大小照片造成的縫隙
另外如果他真的是NP-hard,也显然不可能reduce成2D DP
p********n
发帖数: 165
48
抛个砖:
A*算法的核心是点到点求最短距离,不是点到面。而且需要好的heuristic function,
即使是在矩阵中找点对点最短距离也不一定是最好算法。
这个题,假设gym为n^2 matrix,k个器械。 用Dijkstra计算每个器械到非障碍物的距
离,复杂度为k*n^2*log(n),其中log(n)为maintain 一个priority queue的复杂度,
queue里最多的元素不可能是n^2而是n。
然后iterate 一遍matrix,找出离k个器械距离和最小的一个element,复杂度为n^2.
所以最后复杂度为 O(k*n^2*log(n))
当然这个题两个相邻点的距离都是uniform的话,可以不用Dijkstra,而用Breath-First
Search,复杂度可以进一步降低到O(k*n^2).
h*****u
发帖数: 109
49
来自主题: JobHunting版 - 这题怎么做?
这个是set partitioning problem, NP-hard in strong sense.
能有polynomial solution 吗? 用maximum flow如何保证每个national node 有正好
的color?
用greedy heuristic吧。
d******g
发帖数: 38
50
来自主题: JobHunting版 - 问一道G onsite题
分析很正确,但是感觉后面判断的时候算法流程不是很清晰
假设字符i在每个位置的出现概率是Pi=(px, py, pz),例如你的例子Pa=(0.5, 0, 0)
由于重复的问题,最后只能统计出不同字符的出现概率,例如这个例子只有Pg,Po,Pl,
Pe
问题其实就是要找出一个Pa~Pf的组合,使其概率分布等于观察到的结果,例如
Pa+Pd = Pg
Pb+Pc = Po
Pe = Pl
Pf = Pe //注意区分2个Pe,左边代表第五个字符,右边是字母e
或者找到一个0-1矩阵A,使得A[Pa, ... Pf]^T=[Pg, Po, Pl, Pe]^T
如果概率很有特征(可以认为是概率vector的feature),例如最后一个字母的(0,0,0.
5),那heuristic的方法就可以确定Pf=Pe,但是如果问题的规模大一些可能就会出现
ambiguous的组合,我能想到的办法就是遍历可能的组合,寻找最接近统计结果的组合
如果没有重复字母,那就是很简单了

能。
m
{g
bucket,
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)