Skip to content

Help improve generation of sets of 3  #1

@dblock

Description

@dblock

I'm using ambit in https://github.com/dblock/slack-sup, specifically in https://github.com/dblock/slack-sup/blob/master/slack-sup/models/round.rb#L31, which is a rewrite of a much more complex https://github.com/artsy/sup.

In plain English: we want people to meet every week with some people from the company they haven't met in a long time.

We generate as many permutations of N (eg. 3) people out of M (eg. ~200 in our company), such as people appear only once, then we repeat a week later, but this time make sure that no 2 people in a triad have met last time (or in the past 3 months).

Two questions:

  • Currently I was only able to avoid having people appear multiple times in the result set by storing the fact that they are meeting "centrally" and then checking against it, is there a better way to avoid backtracking over any of the people already in existing triads?

  • The result is not always the most optimal, and I had to bake in abandoning after 60 seconds or so. Any suggestions of not having to do that or turning this into a selection of sets of triads? For example: 1) find a set of triads until no more triads are possible 2) store if more triads than last time 3) repeat with a new selection. I couldn't get that working.

PS: this gem, ambit, is a ... gem, an incredibly elegant solution to generic backtracking!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions