Skip to main content
. 2021 Jan 28;12(2):191. doi: 10.3390/genes12020191
Algorithm 2. Twoobjection() pseudocode
Input:
X: m × n matrix consisted of 1 and 0, representing the states of m samples at n SNP sites.
Y: 1 × m vector consisted of 0 and 1, representing the state of m samples.
Pop:t × K matrix, represents t K-SNP combinations
Output:
Objvalue: 1 × t vector, representing the fitness value of t K-SNP combinations, which is a positive integer greater than or equal to 1.
01: begin
02: Initialization: objvalue(1:pm) = 2
03: For i = 1:t
04:  [objvalue1(i), objvalue2(i)] = TwoScore01(X(:,pop(i,:)),y);
05: end
06: For each i, j = 1:t
07: If((objvalue1(j)<objvalue1(i))&&(objvalue2(j)<objvalue2(i)))||((objvalue1(j)<objvalue1(i))
&&(objvalue2(j)==objvalue2(i)))||((objvalue1(j)==objvalue1(i))&&(objvalue2(j)<objvalue2(i)))
08:     objvalue(j) = objvalue(j) + objvalue(i);
09:     objvalue(i) = 1;
10:     break;
11:    end
12: end