views:

83

answers:

2

Hi all,

For my university's debate club, I was asked to create an application to assign debate sessions and I'm having some difficulties as to come up with a good design for it. I will do it in Java. Here's what's needed:

What you need to know about BP debates: There are four teams of 2 debaters each and a judge. The four groups are assigned a specific position: gov1, gov2, op1, op2. There is no significance to the order within a team.

The goal of the application is to get as input the debaters who are present (for example, if there are 20 people, we will hold 2 debates) and assign them to teams and roles with regards to the history of each debater so that:

  • Each debater should debate with (be on the same team) as many people as possible.
  • Each debater should uniformly debate in different positions.
  • The debate should be fair - debaters have different levels of experience and this should be as even as possible - i.e., there shouldn't be a team of two very experienced debaters and a team of junior debaters.
  • There should be an option for the user to restrict the assignment in various ways, such as:
    • Specifying that two people should debate together, in a specific position or not.
    • Specifying that a single debater should be in a specific position, regardless of the partner.
    • etc...

If anyone can try to give me some pointers for a design for this application, I'll be so thankful! Also, I've never implemented a GUI before, so I'd appreciate some pointers on that as well, but it's not the major issue right now.

Also, there is the issue of keeping Debater information in file, which I also never implemented in Java, and would like some tips on that as well.

A: 

This seems like a textbook constraint problem. GUI notwithstanding, it'd be perfect for a technology like Prolog (ECLiPSe prolog has a couple of different Java integration libraries that ship with it).

But, since you want this in Java why not store the debaters' history in a sql database, and use the SQL language to structure the constraints. You can then wrap those SQL queries as Java methods.

Greg Harman
@Greg Harman Isn't Prolog strictly for constraints with an actual solution and not for optimization? Same question for SQL.
Amir Rachum
I didn't really see the question, as asked, as being about optimization... but in any case I think it's up to you in how to apply those tools. If your concern is that you want the best candidate for a role (even if he doesn't meet all requirements exactly), then you'd use inequalities or aggregates (e.g. select ... where score=max(...) limit 1) in your constraints. I know this comment is pretty general, but I think the answer is that Prolog and Java/SQL are very general-purpose and can be crafted to do almost anything you need.
Greg Harman
A: 

There are two parts (three if you count entering and/or saving the data), the underlying algorithm and the UI.

For the UI, I'm weird. I use this technique (there is a link to my sourceforge project). A Java version would have to be done, which would not be too hard. It's weird because very few people have ever used it, but it saves an order of magnitude coding effort.

For the algorithm, the problem looks small enough that I would approach it with a simple tree search. I would have a scoring algorithm and just report the schedule with the best score.

That's a bird's-eye overview of how I would approach it.

Mike Dunlavey