分布式计算-具有近邻知识的深度优先搜索

本文介绍了一种在令牌环网络中优化遍历过程的方法,通过记录已访问进程避免重复遍历,提高通信效率。

1、如果进程知道近邻的标识,通过在令牌中包括一张访问过的进程的表,就可避免令牌对非树边的遍历。进程p接到带有表L的令牌,并不将令牌转发给L中的进程。

2、算法

var fatherp:  process init udef;

for the initiator only,execute once:

     begin fatherp=udef then fatherp:=q0;

               send <tlist,{p}> to q

     end

 

for each process,upon receipt of  <tlist,L> from q0:

       begin if fatherp=udef then fatherp:=q0;

                 if 存在q∈Neightp\L

                    then begin choose qNeighp\L;

                                      send <tlist,L∪{p}> to q

                             end

               else if p is initiator

                      then decide

                      else send <tlist,L∪{p}>  to  fatherp

     end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值