Open In App

Huang’s Termination detection algorithm

Last Updated : 16 May, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Huang’s algorithm is an algorithm for detecting termination in a distributed system. The algorithm was proposed by Shing-Tsaan Huang in 1989 in the Journal of Computers. In a distributed system, a process is either in an active state or in an idle state at any given point of time. Termination occurs when all of the processes becomes idle and there are no any in transit(on its way to be delivered) computational message. Assumptions of the algorithm:

  • One of the co-operating processes which monitors the computation is called the controlling agent.
  • The initial weight of controlling agent is 1
  • All other processes are initially idle and have weight 0.
  • The computation starts when the controlling agent send a computation message to one of the processes.
  • The process become active on receiving a computation message.
  • Computation message can be sent only by controlling agent or an active process.
  • Control message is sent to controlling agent by an active process when they are becoming idle.
  • The algorithm assigns a weight W (such that 0 < W < 1 ) to every active process and every in transit message.

Notations used in the algorithm:

  • B(DW): Computation message with weight DW
  • C(DW): Control message with weight DW

Algorithm:

  • Rule to send B(DW) –
    • Suppose Process P with weight W is sending B(DW) to process Q
    • Split the weight of the process P into W1 and W2. Such that
W = W1 + W2  and W1 > 0, W2 > 0
  • Set weight of the process P as W1 ( i.e W = W1 )
  • Send B(W2) to process Q, here DW = W2.
  • Note: Only the Controlling agent or any active process can send Computation message.
  • On receiving B(DW) by process Q –
    • Add the weight DW to the weight of process Q i.e for process Q, W = W + DW
    • If process Q was idle, it will become active on receiving B(DW).
  • Rule to send C(DW) –
    • Any active process having weight W can become idle by sending C(W) to controlling agent
    • Send a control message C(W) to the controlling agent. Here DW = W.
    • Set weight of the process as 0 i.e W = 0. (After this process will become idle.)
  • On receiving C(DW) by controlling agent –
    • Add the weight received through control message to the weight of controlling agent i.e W = W + DW
    • After adding, if the weight of controlling agent becomes 1 then it can be conclude that the computation has terminated.

Advantages of Huang’s Algorithm:

  • Guaranteed termination: Termination Detection Algorithms ensure that a distributed computation terminates eventually, even in the presence of failures such as process crashes, message loss, or network partitioning. This guarantees that the distributed system will not be stuck in an infinite loop or deadlock.
  • Minimal overhead: Termination Detection Algorithms have a low communication overhead, which means that they do not significantly impact the performance of the distributed system. This is important because many distributed systems have strict latency requirements.
  • Scalability: Termination Detection Algorithms are scalable, which means that they can handle large distributed systems with many processes.
  • Fault tolerance: Termination Detection Algorithms are fault-tolerant, which means that they can handle process crashes, message loss, and other types of failures that can occur in a distributed system.
  • Easy to implement: Termination Detection Algorithms are easy to implement and do not require any special hardware or software.

Limitations of Huang’s Algorithm:

  • Sensitivity to initialization: The performance of Huang’s Algorithm can be sensitive to the initialization of the factors, which can impact the quality of the extracted features. The algorithm may need to be run multiple times with different initializations to find the best solution.
  • Computational complexity: Huang’s Algorithm can be computationally expensive, especially when dealing with large datasets or high-dimensional data. This can limit its applicability to real-world problems that require fast and efficient computations.
  • Non-unique solutions: The NMF model produced by Huang’s Algorithm is not unique, meaning that there can be multiple factorizations that result in similar reconstruction errors. This can make it difficult to interpret the results of the analysis.
  • Limited interpretability: While the NMF model produced by Huang’s Algorithm has a clear interpretation in terms of the extracted factors, the factors themselves may not be easily interpretable or meaningful. This can limit the usefulness of the results in some applications.
  • Limited applicability: Huang’s Algorithm is designed specifically for non-negative matrix factorization, which means that it may not be suitable for all types of data or applications. Other dimensionality reduction techniques, such as principal component analysis (PCA), may be more appropriate in some cases.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads