【问题标题】:Leader Election in an asynchronous undirected Tree异步无向树中的领导者选举
【发布时间】:2020-04-24 03:50:40
【问题描述】:

我有一个 n=|V| 的异步网络无向树 (V,E)过程。对于我的网络,我唯一知道的是所有进程都有唯一的 ID (UID),它们知道邻居的数量,但不知道网络的直径和大小。我尝试在这样的网络中构建一个领导者选举算法,如下所示:

  A convergecast of <leader> messages is initiated starting from the 
  leaves of the tree. 

  Each leaf node is initially enabled to send a <leader> message to 
  its unique neighbor. Any node that receives <leader> messages from 
  all but one of its neighbors is enabled to send an <leader> message 
  to its remaining neighbor.

  In the end,
    1. Some particular process receives <leader> messages along all
    of its channels before it has sent out an <leader> message
     the process at which the <leader> messages converge elects
    itself as the leader.

    2. <leader> messages are sent on some particular edge in both
    directions.
    the process with the largest pid among the processes that are
    adjacent to this edge elects itself as the leader.

我的想法是否正确,上述算法是否在所有进程都知道领导者的情况下终止?

【问题讨论】:

    标签: algorithm graph-algorithm distributed


    【解决方案1】:

    您的算法是正确的,但有以下限制:

    1. 节点现在只是他们的下一个领导者,而不是全局领导者。我不知道你的目标是让每个节点都知道全球领导者还是他们的个人领导者
    2. 全局领导者不一定是具有最大 pid 的进程,也不一定是树的根节点。示例:假设有 5 个节点的链,其中第二个节点为根。该图是一棵以第一个和第五个节点为叶子的树。给根节点最大的pid。您的算法选择链的第三个节点作为全局领导者。
    3. 您的算法实际上不是确定性的:假设是一个平衡树。假设一个休假延迟提交其领导者消息(在实践中可能发生)。选定的全局领导者取决于延迟。
    4. 您的算法仅适用于树。

    我不知道这些限制对您来说是否是个问题。由于我没有足够的声誉来评论您的问题,所以我也无法提问。

    您的算法的正确性可以通过数学归纳来证明。

    1. 基本情况:具有单个节点的树。显然,您的算法是正确的。
    2. 归纳步骤:向树中添加一个节点。有两种情况:

      a) 新节点连接到以前不是叶子的节点。

      b) 新节点连接到以前是叶子的节点。

      证明算法的输出在这两种情况下都是正确的并不难。因此该算法对所有树都是正确的。

    【讨论】:

      猜你喜欢
      • 2012-05-08
      • 2021-11-08
      • 1970-01-01
      • 2019-09-12
      • 2018-05-29
      • 1970-01-01
      • 1970-01-01
      • 2015-09-08
      • 1970-01-01
      相关资源
      最近更新 更多