1: for  $i^{\mathrm{th}}$  nice subset of users  $\mathcal{M}^{(\ell, i)} \in \mathcal{M}^{(\ell)}$  with active items  $\mathcal{N}^{(\ell, i)}$  ( $i^{\mathrm{th}}$  set in list  $\mathcal{N}^{(\ell)}$ ) do
2: Set  $t = t_0$ . Set  $\epsilon_{\ell + 1} = \epsilon_{\ell} / 2$ ,  $\Delta_{\ell} = \epsilon_{\ell} / 88\mathsf{C}$  if  $\ell > 1$  and  $\Delta_{\ell} = ||\mathbf{P}||_{\infty}$  otherwise. Set  $\Delta_{\ell + 1} = \epsilon_{\ell + 1} / 88\mathsf{C}$ . // Beginning of a phase
3: Run exploit component for users in  $\mathcal{M}^{(\ell, i)}$  with active items  $\mathcal{N}^{(\ell, i)}$ . Obtain updated active set of items, round index and exploit rounds  $\mathcal{N}^{(\ell, i)}, t, t_{\text{exploit}} \gets \text{Exploit}(\mathcal{M}^{(\ell, i)}, \mathcal{N}^{(\ell, i)}, t, t_{\text{exploit}}, \widetilde{\mathbf{P}}_{\mathcal{M}^{(\ell, i)}, \mathcal{N}^{(\ell, i)}}, \Delta_\ell)$ . //Recommend common set of identified golden items
4: Set  $d_{1} = \max (|\mathcal{M}^{(\ell ,i)}|,|\mathcal{N}^{(\ell ,i)}|)$ ,  $d_{2} = \min (|\mathcal{M}^{(\ell ,i)}|,|\mathcal{N}^{(\ell ,i)}|)$  and  $p = c\left(\frac{\log d_1}{\Delta_{\ell + 1}^2d_2}\right)$  for some appropriate fixed constant  $c > 0$ .
5: if  $|\mathcal{N}^{(\ell, i)}| \geq T^{1/3}$  and  $p < 1$  then
6: Run explore component for users in  $\mathcal{M}^{(\ell, i)}$  with active items  $\mathcal{N}^{(\ell, i)}$ . Update estimate and round index  $\widetilde{\mathbf{P}}, t \gets \text{Explore}(\mathcal{M}^{(\ell, i)}, \mathcal{N}^{(\ell, i)}, t, p)$  such that  $\left|\left|\widetilde{\mathbf{P}}_{\mathcal{M}^{(\ell, i)}, \mathcal{N}^{(\ell, i)}} - \mathbf{P}_{\mathcal{M}^{(\ell, i)}, \mathcal{N}^{(\ell, i)}}\right|\right|_{\infty} \leq \Delta_{\ell+1}$  w.h.p. //Random Exploration and estimation of relevant reward sub-matrix
7: For every user  $u\in \mathcal{M}^{(\ell ,i)}$  , compute  $\mathcal{T}_u^{(\ell)}\equiv \{j\in \mathcal{N}^{(\ell ,i)}\mid \tilde{\mathbf{P}}_{u\pi_u(\mathrm{TB}^{-1} - t_{\mathrm{exploit}}\mathsf{B}^{-1})} - \tilde{\mathbf{P}}_{uj}\leq 2\Delta_{\ell +1}\}$
8: Construct graph  $\mathcal{G}^{(\ell, i)}$  whose nodes are users in  $\mathcal{M}^{(\ell, i)}$  and an edge exists between two users  $u, v \in \mathcal{M}^{(\ell, i)}$  if  $\left|\widetilde{\mathbf{P}}_{ux}^{(\ell)} - \widetilde{\mathbf{P}}_{vx}^{(\ell)}\right| \leq 2\Delta_{\ell+1}$  for all items  $x \in \mathcal{N}^{(\ell, i)}$ . // Construct graph encoding user similarity
9: Initialize lists  $\mathcal{M}_i^{(\ell +1)} = []$  and  $\mathcal{N}_i^{(\ell +1)} = []$
0: For each connected component  $\mathcal{M}^{(\ell, i, j)} \left( \cup_{j} \mathcal{M}^{(\ell, i, j)} \right. \equiv \mathcal{M}^{(\ell, i)}$ , compute  $\mathcal{N}^{(\ell, i, j)} \equiv \cup_{u \in \mathcal{M}^{(\ell, i, j)}} \mathcal{T}_u^{(\ell)}$ . Append  $\mathcal{M}^{(\ell, i, j)}$  into  $\mathcal{M}_i^{(\ell + 1)}$  and  $\mathcal{N}^{(\ell, i, j)}$  into  $\mathcal{N}_i^{(\ell + 1)}$ . //Construct finer clusters and identify joint good items
11:Invoke B-LATTICE(  $\ell +1,\mathcal{M}_i^{(\ell +1)},\mathcal{N}_i^{(\ell +1)},\mathsf{C},\mathsf{T},\sigma^2,||\mathbf{P}||_{\infty},\mu ,t,t_{\mathrm{exploit}},\widetilde{\mathbf{P}},\epsilon_{\ell +1},\mathbf{K},\mathbf{L})$  // Recurse for new list of user groups and corresponding surviving items
12: else
13: For each user  $u \in \mathcal{M}^{(\ell, i)}$ , recommend unblocked items in  $\mathcal{N}^{(\ell, i)}$  until end of rounds.
14: end if
15: end for