由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - 求教一个算法题.
相关主题
Algorithm:find smallest subtree which contain two random帮忙看看这个问题有现成算法么?
问:关于调用节点和cpu数目的关系,谢谢 (转载)有没有更快一些的计算transitive closure的算法
有人set up过 多个node的Cassandra 么?怎样随机建立线性graph的adjacency matrix?
[转载] Re: 有人搞P2P里的DHT吗?This Woman is really cute
****老板想买wireless sensor node,请问在那里有的卖?Neural Networks 求助
Napster query?关于A* 和BFS
Re: 请教一个 graph connectivity 的问题请教一个搜索问题
mind execise请问matlab能不能算一个graph的diameter? (转载)
相关话题的讨论汇总
话题: nodes话题: row话题: chessboard话题: node话题: find
进入CS版参与讨论
1 (共1页)
m*******s
发帖数: 9
1
一个算法题,
Given a chessboard G, each node v is labeled by a real number x(v), how to
find a local minimum of G using only O(n) probes to the nodes of G.
*. A chessboard can be thought of as a graph, whose node set is the set of
all ordered pairs of natural numbers (i, j), where 1 <= i <= n and 1 <= j <=
n; the nodes (i, j) and (k, l) are joined by an edge if and only if |i – k
| + |j – l| = 1
*.a node v of T is a local minimum if the label x(v) is less than the label
x(w) for all nodes w that are j
r********g
发帖数: 1351
2
starting from any row a,
1. find the smallest element in row a, suppose its column is b
2. find the smallest element in column b, suppose its row is c, if(c==a)
return G[a][b];else goto 3
3. find the smallest element in row c, suppose its column is d; if(d==b)
return
G[c][b];else goto 4
4. return G[c][d]
m*******s
发帖数: 9
3
谢谢.
但有一个问题, 你怎样保证G[C][D}比G[C-1][D] 和G[C+1][D]小呢?
r********g
发帖数: 1351
4
you can see G[c][d] is the smallest element among elements in row a,c and
column b,d

【在 m*******s 的大作中提到】
: 谢谢.
: 但有一个问题, 你怎样保证G[C][D}比G[C-1][D] 和G[C+1][D]小呢?

m*******s
发帖数: 9
5
G[c][d]是row a,c and column b里最小的,
但我不明白 G[c][d]怎么是column d 里最小的呢? 谢了.
r********g
发帖数: 1351
6
sorry. making a mistake
what about this.
From row a , a+1 ,a+2 , find the smallest element?

【在 m*******s 的大作中提到】
: G[c][d]是row a,c and column b里最小的,
: 但我不明白 G[c][d]怎么是column d 里最小的呢? 谢了.

m*******s
发帖数: 9
7
Thanks a lot for discussion.
你能不能把你"From row a , a+1 ,a+2 , find the smallest element?"的想法说详细
一些, 怎么保证O(n) 复杂度呢?
g*******g
发帖数: 18
8
I think it's impossible to find such number in O(n).
1 (共1页)
进入CS版参与讨论
相关主题
请问matlab能不能算一个graph的diameter? (转载)****老板想买wireless sensor node,请问在那里有的卖?
单链表翻转有几种方法Napster query?
算法问题Re: 请教一个 graph connectivity 的问题
问两个Wireless Network的问题?mind execise
Algorithm:find smallest subtree which contain two random帮忙看看这个问题有现成算法么?
问:关于调用节点和cpu数目的关系,谢谢 (转载)有没有更快一些的计算transitive closure的算法
有人set up过 多个node的Cassandra 么?怎样随机建立线性graph的adjacency matrix?
[转载] Re: 有人搞P2P里的DHT吗?This Woman is really cute
相关话题的讨论汇总
话题: nodes话题: row话题: chessboard话题: node话题: find