离线环境下分散消息广播所需的算法(通过电话)

发布于 2024-11-18 15:38:59 字数 466 浏览 5 评论 0原文

该系统应该允许一种快速、可靠和去中心化的方式通过电话(语音或文本)向预先注册的社区广播消息。消息根据预定义的规则和联系人列表在成员之间转发。

准备阶段是在线进行的:

  1. “广播公司”正在打开一个“邮件列表”
  2. ,人们通过使用自己的电话号码(和安全短语)注册来加入,
  3. 每个人都会获得包含 2-4 个其他成员号码(及其安全短语)的联系人列表。

广播公司通过呼叫他的联系人列表来发起消息。 广播规则很简单:当您接到电话(并听到安全短语)时,您会收听消息并以相同的方式将其转发到您的联系人列表。

我的问题是 - 如何以优化的方式链接成员(意味着如何构建他们的联系人列表):

  1. 快速分发消息(树的最低级别)
  2. 每个列表中的联系人不超过 4 个(最好是 2 个或3)
  3. 一定程度的冗余(因此,如果某个成员不可用,则不会切断整个分支)。

The system should allow a fast, reliable and decentralized way to broadcast a message by phone (voice or text) to a preregistered community. Messages are forwarded between members according to predefined rules and contact lists.

The preparation phase is online:

  1. the "broadcaster" is opening a "mailing list"
  2. people join by registering with their phone number (and security phrase)
  3. each get a contact list of 2-4 numbers of other members (together with their security phrases).

The broadcaster initiate a message by calling his contact list.
The broadcast rule is simple: when you get a call (and hear your security phrase) you listen to the message and forward it to your contact list in the same way.

My question is - how to link the members (meaning how to build their contact lists) in a way that will be optimized to:

  1. distribute the message quick (minimum levels of the tree)
  2. not more then 4 contacts in each list (better 2 or 3)
  3. some level of redundancy (so if a member is not available it won't cut the whole branch).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉鱼一梦 2024-11-25 15:38:59

简单的答案是,分出一棵树,然后将每个分支上的“叶子”与其他分支上的所有非叶子连接起来。

让我提供更多解释。假设您有 15 个人。然后按如下方式开始:

{
  1: [2, 3],
  2: [4, 5],
  3: [6, 7],
  4: [8, 9],
  5: [10, 11],
  6: [12, 13],
  7: [14, 15],

然后 2 下面的叶子是 8, 9, 10, 11, 3 下面的叶子是 12, 13, 14, 15。 现在你将它们连接起来:

    8: [3, 6],
    9: [7, 12],
    10: [13, 14],
    11: [15],
    12: [2, 4],
    13: [5, 8],
    14: [9, 10],
    15: [11]
  }

所以你有一棵下面 2 的树,以及低于 3 的树。如果一侧缺少任何内容,则将其连接到另一侧。

如果增加分支因子,那么就会增加树中叶子的部分,这使得更容易使所有内容多重连接。 (它还会减少从根到任何元素的距离。)

Simple answer, branch out a tree, and then have the "leaves" on each branch connect up with all of the non-leaves on the other branches.

Let me offer more explanation. Suppose that you have 15 people. Then start them off as follows:

{
  1: [2, 3],
  2: [4, 5],
  3: [6, 7],
  4: [8, 9],
  5: [10, 11],
  6: [12, 13],
  7: [14, 15],

Then the leaves below 2 are 8, 9, 10, 11 and the leaves below 3 are 12, 13, 14, 15. So now you connect them up with:

    8: [3, 6],
    9: [7, 12],
    10: [13, 14],
    11: [15],
    12: [2, 4],
    13: [5, 8],
    14: [9, 10],
    15: [11]
  }

So you have a tree below 2, and a tree below 3. And if anything is missing on the one side, it is connected to on the other.

If you increase the branching factor then you increase the portion of the tree that are leaves, which makes it even easier to make everything be multiply connected. (It also decreases the distance from root to any element.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文