Room allocation with friendship externalities (source code)

= Room allocation with friendship externalities
{title2=$u_i(a)=v_{i,a_i}+f_i\mathbf1_{\{|a_i-a_{F(i)}|=1\}}$}

Assign distinct rooms along a hallway to participants. A participant's <utility> is their own room value plus a positive bonus if their designated friend receives a physically adjacent room; participants without friends receive only their room value. When friendships form disjoint pairs, consecutive choosing slots allow each pair to settle its own adjacency before later participants act. Consecutive slots in <serial dictatorship> do not themselves require adjacent allocated rooms.