Research Article

An Efficient Algorithm for Decomposition of Partially Ordered Sets

Algorithm 1

Find the width of a poset.
Input:
n: the number of elements of a poset P
An × n: the incidence matrix of a poset P
Output: the length of its largest antichain width (P)
Begin
width = 0
while length of matrix A! = 0 do
 sum_column = sum(A, axis = 0)
 sum_row = sum(A, axis = 1)
 sum_cr = 
M = inf
for j = 1 to n
  if (sum_cr [j] ≤ M):
   M = sum_cr [j]
   Index = j
  end
end
 Index_row = []
 Index_column = []
for j = 1 to n
  if (A[j, Index] == 1):
   Index_row.append(j)
  end
  if (A[Index, j] == 1):
   Index_column.append (j)
  end
end
 Delete all columns and row when value = 1 in (rows = Index_row [:],
 columns = Index_column [:] and column = Index)
  width +=1
end
return the best population found (the width of its largest antichain)
End