algorithm in python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fishfood11
    New Member
    • Jul 2010
    • 1

    algorithm in python

    The problem is:

    -given the number or students, number of weeks, and number of tables, write an algorithm that takes the students and places then at tables for (w) weeks, switching every week, so that the interaction between different students is maximized. As in, each students should not spend too many weeks with one specific student. the number of tables is always less than the number of students, and the number of students does not necesserily need to divide into the number of tables
  • Glenton
    Recognized Expert Contributor
    • Nov 2008
    • 391

    #2
    The trickier thing here is the algorithm rather than the python. There is a forum on algorithms, where you might get some more ideas.

    A crude way would be to take a random permutation, and then keep track of the ways it's been done week by week. Each new week you generate as many permutations as you need until you successfully generate one that is different enough from the ones you've done before.

    But there's probably some brilliant systematic way of doing it out there!

    Comment

    Working...