One can either use simple random sampling (srs) to generate the partition or solve the maximally diverse grouping problem (mdgp) using the algorithm by Lai and Hao (2016) in order to maximize time since last meets over all groups.

rsocialroulette(
  current_frame,
  past_partitions = NULL,
  m,
  algorithm = c("mdgp", "srs"),
  ...
)

Arguments

current_frame

A tibble containing the participants of the current round, i.e. it has a column `id` containing a unique identifier and a `date` column representing the date of the partition.

m

minimum group size, i.e. all groups will be at least size m.

...

Additional arguments to be sent to the solver

Value

A partitioning of current_frame maximizing the overall sum of gossip to be exchanged.

References

Höhle M (2021), Long time, no see: Virtual Lunch Roulette, Blog post, https://staff.math.su.se/hoehle/blog/2021/04/04/socialsamp.html

Xiangjing Lai and Jin-Kao Hao (2016). *Iterated maxima search for the maximally diverse grouping problem*. European Journal of Operational Research, 254(3), pp. 780-800, https://doi.org/10.1016/j.ejor.2016.05.018

See also

mdgp_solver

Examples

today <- Sys.Date() frame <- tibble::tibble( id=sprintf("id%.02d",1:5), date=today) round1 <- rsocialroulette(current_frame = frame, m=2, algorithm="srs")
#> Partitioning 5 individuals into groups of at least 2 (no past partitions). #> Created 2 groups of sizes 3 2.
round1
#> [[1]] #> [1] "id02" "id04" "id05" #> #> [[2]] #> [1] "id01" "id03" #>
#Generate list of past partitions past_partitions <- list(round1) %>% setNames(today) frame2 <- frame %>% dplyr::mutate(date = today+7) round2 <- rsocialroulette(current_frame = frame2, past_partitions=past_partitions, m=2, algorithm="mdgp")
#> Partitioning 5 individuals into groups of at least 2 (Optimizing wrt. past partitions). #> Input file: /var/folders/3g/8qpqpqtx2cz_r4fzd8bjvcyw0000gq/T//RtmpGs4Egl/file31242c2ca60c.txt #> Output file: /var/folders/3g/8qpqpqtx2cz_r4fzd8bjvcyw0000gq/T//RtmpGs4Egl/file31242749747c #> Solution file: /var/folders/3g/8qpqpqtx2cz_r4fzd8bjvcyw0000gq/T//RtmpGs4Egl/file3124477e8d0a #> Time_limit: 30.000000 #> Inputting... #> Read file... #> Assigning memory... #> Building neighbours... #> Running... #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #> 49.000000 #>
#> Error in cols(): could not find function "cols"
round2
#> Error in eval(expr, envir, enclos): object 'round2' not found