1

I'm trying to solve a problem very similar to the example here: https://pythonhosted.org/PuLP/CaseStudies/a_set_partitioning_problem.html

This uses the optimization framework called PuLP to assign seats to guests at a wedding.

To provide some context, I have N guests, T tables and max S seats at each table. I have a cost matrix (N by N) which represents how much each guest wants to sit with another guest.

In the first code section, they are creating a list of all possible tables:

possible_tables = [tuple(c) for c in pulp.allcombinations(guests, max_table_size)]

This doesn't make sense to me. I didn't expect that generation of candidate tables to be done outside the algorithm.

Is this very different from just doing a N choose K to generate candidates, score the generated tables using the cost matrix and pick the best tables?

I'm not limited to using PuLP. I've looked at cvxpy, jump, mini-zinc, etc. I'm just having trouble how to formulate the objective and constraint when there is such interaction among elements of selected sets (it's as if items in the knap-sack problem hated or loved each other!)

Shahbaz
  • 10,395
  • 21
  • 54
  • 83
  • 1
    The problem is modeled as a set partitioning problem. This requires to compute the covering data in advance. There are other formulations possible for this problem (i.e not as a SPP) that does not require this. – Erwin Kalvelagen Jul 06 '18 at 20:47
  • Yes it does generate all the tables in advance, The Set partitioning problem then works out the best solution where the the tables fit together in a complete solution. – Stuart Mitchell Jul 08 '18 at 23:21
  • @ErwinKalvelagen Could you point me to resources on how else to formulate this problem. Even standard industry/academic terms I can google will be enough. Thx. – Shahbaz Jul 12 '18 at 17:12
  • 1
    Here is a [link](https://yetanothermathprogrammingconsultant.blogspot.com/2012/02/weddings-and-optimal-seating.html) with an example model that uses a straight MIP formulation – Erwin Kalvelagen Jul 12 '18 at 17:27

0 Answers0