<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.cas-group.net/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.cas-group.net/index.php?feed=atom&amp;target=Jamesbruk&amp;title=Special%3AContributions%2FJamesbruk</id>
		<title>CasGroup - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.cas-group.net/index.php?feed=atom&amp;target=Jamesbruk&amp;title=Special%3AContributions%2FJamesbruk"/>
		<link rel="alternate" type="text/html" href="https://wiki.cas-group.net/index.php?title=Special:Contributions/Jamesbruk"/>
		<updated>2026-04-18T07:37:18Z</updated>
		<subtitle>From CasGroup</subtitle>
		<generator>MediaWiki 1.16.2</generator>

	<entry>
		<id>https://wiki.cas-group.net/index.php?title=Distributed_GCD_Algorithm</id>
		<title>Distributed GCD Algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.cas-group.net/index.php?title=Distributed_GCD_Algorithm"/>
				<updated>2010-03-12T08:37:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jamesbruk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''distributed GCD algorithm''' belongs to a special class of &lt;br /&gt;
[[Distributed Algorithm|distributed algorithms]] for mathematical operations. &lt;br /&gt;
At each node in the distributed system, one or more values are stored, the &lt;br /&gt;
nodes can communicate with each other, and are allowed to perform certain&lt;br /&gt;
mathematical operations. The distributed algorithm now has to &lt;br /&gt;
determine the exact sequence of operations that each node &lt;br /&gt;
has to follow in order to achieve a global goal (for instance [http://www.research-service.com/custom-research-paper.html research paper]&lt;br /&gt;
find the max, min, gcd or average value for all nodes).&lt;br /&gt;
&lt;br /&gt;
The distributed GCD algorithm is a very simple [[Distributed_Algorithm|distributed algorithm]] &lt;br /&gt;
to determine the Greatest Common Divisor (GCD) of n numbers.&lt;br /&gt;
Because it is so simple and elegant, it is often used as an &lt;br /&gt;
introductory example for [[Distributed_Algorithm|distributed algorithms]], for &lt;br /&gt;
explanatory purposes and to illustrate the workings of &lt;br /&gt;
[[Distributed_Algorithm|distributed algorithms]] in general&lt;br /&gt;
(for instance the problem of termination detection).&lt;br /&gt;
The algorithm for a ring topology with as many nodes&lt;br /&gt;
as numbers works as follows: each process begins&lt;br /&gt;
with a number z, and the algorithm is&lt;br /&gt;
finished if all nodes have the same number.&lt;br /&gt;
&lt;br /&gt;
On receiving a message from a neighbor:&lt;br /&gt;
&lt;br /&gt;
 Receive (int e)&lt;br /&gt;
 { &lt;br /&gt;
    if (e &amp;lt; z) &lt;br /&gt;
    {&lt;br /&gt;
      z = ((z-1)%e)+1);&lt;br /&gt;
      Send()&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Sending messages:&lt;br /&gt;
&lt;br /&gt;
 Send()&lt;br /&gt;
 {&lt;br /&gt;
   SendMsg (z, left Neighbor)&lt;br /&gt;
   SendMsg (z, right Neighbor) &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributed Algorithms]]&lt;/div&gt;</summary>
		<author><name>Jamesbruk</name></author>	</entry>

	</feed>