Dijkstra 的自稳定算法是如何工作的?
我读过他的开创性论文,尽管采用分布式控制,但仍具有自稳定系统。然而,我不太明白自稳定算法是如何工作的。我对他的 k 状态机“解决方案”最感兴趣。纸张的密度相当大,我无法理解它的意义。这个算法用简单的英语来说是如何工作的?
I have read his seminal paper, Self-stabilizing systems in spite of distributed control. However, I don't quite get how the self-stabilizing algorithm works. I am most interested in his, 'solution' of k-state machines. The density of the paper is quite intense and I can't make much sense of it. How does this algorithm work in plain English?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我可以尝试用简单的英语解释它......
首先你应该看看 链接< /a> 让-弗朗索瓦·科贝特 (Jean-Francois Corbett) 发表评论。
定义
(来自维基百科)
符号
与研讨会论文中的相同
自稳定系统
在他的论文中,Dijkstra 定义了一个自稳定系统如下:
考虑一个具有 N+1 个节点的圆图。 (从0到N+1)
每个节点可以处于不同的状态。
每个节点可以有不同的权限。 (例如 xS = xR 可以是一种特权)
在每一步中,如果在一个节点中存在特权,我们将应用某种规则:
合法状态
他将合法状态定义为仅存在一种特权的状态。
结论
如果您将 Dijkstra 论文中的不同规则应用于所描述的系统,您将得到一个自稳定系统。 (参见定义。)
即,从具有 n 个特权的任何状态(即使一个节点具有多个特权),您将在有限数量的状态中达到仅存在一个特权的状态,并在此状态之后保持合法状态。你将能够达到任何合法的状态。
你可以自己尝试一个简单的例子。
4 状态解决方案的示例
让我们只采用一个底部节点和一个顶部节点:
这是 3 个节点的结果: 底部 (0) 中间 (1) 顶部 (2):我以 2 个权限开始(不是合法状态,然后一旦我进入合法状态,我就会停留在其中):
这是一个小的Python [<=2.7]代码(我不太擅长Python,所以它可能很难看),用于使用 n 的系统测试 4 种状态方法节点,它停止时你会发现所有合法的状态:
I can try to explain it in plain English...
First you should have a look at the link Jean-Francois Corbett wrote as a comment.
Definition
(from Wikipedia)
Notations
Same as the one on the seminar paper
Self Stabilizing system
In his paper Dijkstra defines a self stabilizing system as follow:
Consider a circle graph with N+1 nodes. (From 0 to N+1)
Each node can be in different states.
Each node can have different privilege. (for example xS = xR can be a privilege)
At each step if in one node a privilege is present we will apply a certain rule :
Legitimate States
He defines a legitimate state to be a state with only one privilege present.
Conclusion
If you apply the different rules in Dijkstra's paper for the described system you will get a self-stabilizing system. (cf definition.)
i.e. from any state with n privilege presents (even with multiple privileges for one node) you will reach in a finite number of states a state with only one privilege present, and stay in legitimate states after this state. And you will be able to reach any legitimate state.
You can try yourself with a simple example.
Example for the 4 states solution
Let's take only a bottom node and a top node:
and here is a result for 3 nodes: bottom (0) middle (1) top (2): I start with 2 privileges (not legitimate state, then once I get into a legitimate state I stay in it):
Here is a small Python [<=2.7] code (I am not very good at python so it's may be ugly) to test the 4 states methods with a system of n nodes, it stops when you find all the legitimate states:
这是一个经过实战测试的自稳定库(具有非常异步的设计):
https://github.com/hpc/libcircle
有关如何将 Dijkstra 的自稳定环纳入此库(工作队列分割技术)的更多信息,请访问:http://dl.acm.org/itation.cfm?id=2389114。
如果您不想阅读本文,该代码也有很好的注释。例如,请查看: https://github.com/hpc /libcircle/blob/master/libcircle/token.c
免责声明:我是该库和论文的作者。
Here's a battle tested self-stabilization library (with a very asynchronous design):
https://github.com/hpc/libcircle
More information on how Dijkstra's self-stabilizing ring has been incorporated into this library (work queue splitting techniques) can be found at: http://dl.acm.org/citation.cfm?id=2389114.
The code is also commented fairly well if you don't feel like working through the paper. For example, take a look at: https://github.com/hpc/libcircle/blob/master/libcircle/token.c
Disclaimer: I'm an author of the library and paper.
对于Dijkstra自稳定环算法,可以将每个不可区分过程的动作划分为闭合动作和收敛动作。特异进程P0的动作是关闭动作。收敛动作不参与非进展循环。对于包括P0在内的关闭动作,只能形成单个权限循环的死循环。如果碰巧您拥有多个特权,则关闭操作无法使它们保持循环。换句话说,当经过P0:杰出进程时,特权数量不断减少。
除了 Dijkstra 在 1986 年的证明之外,以下两篇出版物特别有趣:
1- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.70.976&rep=rep1&type=pdf
2- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.27.4320&rep=rep1&type=pdf
For Dijkstra's self-stabilizing ring algorithm, you can partition the actions of each non-distinguishable process into closure actions and convergence actions. The action of the distinguished process P0 are closure actions. The convergence actions do not participate into non-progress cycles. As to the closure actions including those of P0, they can only form an infinite loop of a single privilege circulating. If it happens that you have more than one privilege, there is no way that the closure actions keep them circulating. In other words, the number of privileges keep decreasing as they pass through P0: the distinguished process.
The following two publications are particularly interesting, besides Dijkstra's proof in 1986:
1- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.70.976&rep=rep1&type=pdf
2- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.27.4320&rep=rep1&type=pdf