浏览 2955 次
锁定老帖子 主题:HS算法
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-01-14
message包括三元组{uid,{in|out},hop-count} state包括: u,uid send+,msg send-,msg state,{unknown|leader} phase,N+ 每一个process的message-generation function产生下面的消息: send send+ to process i+1 send send- to process i-1 transition function: send+:=null send-:=null if msg from i-1 is(v,out,h) then case v>u and h>1:send+:=(v,out,h-1) v>u and h=1:send-:=(v,out,1) v=u:status:=leader endcase if msg from i+1 is(v,out,h) then case v>u and h>1:send+:=(v,out,h-1) v>u and h=1:send-:=(v,out,1) v=u:status:=leader endcase if msg from i-1 is (v,in,1) and v>u then send+:=(v,in,1) if msg from i+1 is (v,in,i) and v>u then send-:=(v,in,1) if msg from i-1 and i+1 are both (u,in,1) then phase:=phase+1 send+:=(u,out,2phase) send-:=(u,out,2phase) 复杂度: 时间复杂度:O(n) 通信复杂度:O(nlogn) 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |