Research Article

Algorithm for Identification of Infinite Clusters Based on Minimal Finite Automaton

Algorithm 1

FA traversing algorithm.
Data: Initial grid
Result: is number of infinite clusters and labeled blue-red paths
;
;
;
Labeling = false;
countingCluster = true;
= neighbor of the ;
while   <> 0  do
if  labeling    then
  label ;
end
if  north neighbor of  is blue  cell  and  countingCluster
 then
   ;
   labeling  ;
   countingCluster = false;
end
if  ,   neighbor of  currentCell  is  red,  white, respectly, and
    then
   labeling = false;
   countingCluster = true;
end
;
;
= neighbor of the  ;
end