Skip to main content
. 2023 Feb 17;23(4):2275. doi: 10.3390/s23042275
Algorithm 2: Collaborative group selection
Input. T,rj|tjT,Fk,cS,IS
Output: a group of users Gk
Step 1: Initialization.
1: Gk,Q
Step 2.
2: GkGksk
3: for tjTQk do
4:      rjrj1
5:      if rj=0, then
6:          QQtj
7:          TT\tj
8:      end if
9: end for
10:while T; and Fk; do
11:    for siFk do
12:        if QisT=, then
13:             FkFk\si
14:        else
15:            calculate ΛiS
16:        end if
17:    end for
18:    siFk18: For all ΛiS, sort in a non-decreasing way.
19:    si— has the least number of users ΛiS
20:    GkGksi
21:    FkFk\si
22:    for tjTQi do
23:        rjrj1
24:        if rj=0, then
25:             QQtj
26:            TT\tj
27:        end if
28:    end
29: end while
30: return the user group: Gk