Algorithm to generate all possible deals
From: Anonymous (disposable0005_at_yahoo.com)
Date: 01/23/04
- Next message: Elaine Jackson: "circuit logic"
- Previous message: Mark Kvale: "Re: Protein folding and P = NP"
- Next in thread: Just John: "Re: Algorithm to generate all possible deals"
- Reply: Just John: "Re: Algorithm to generate all possible deals"
- Reply: Doc O'Leary: "Re: Algorithm to generate all possible deals"
- Reply: JD: "Re: Algorithm to generate all possible deals"
- Reply: Glenn C. Rhoads: "Re: Algorithm to generate all possible deals"
- Reply: James Dow Allen: "Re: Algorithm to generate all possible deals"
- Reply: Matt: "Re: Algorithm to generate all possible deals"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Jan 2004 12:02:31 -0800
I'm a computer science student working on a AI for the game board game
Clue/Cluedo. If you're not familar with it, the game is basically as
follows (simplified just a little):
7 players are each dealt 3 cards from a deck of 21 card. Then
constraints are revealed about various players hands ("Player 1 does
NOT have card B" or "Player 4 has at least one of the following cards:
A, D, or G"). A player wins when he has determined the correct
location of each card.
In order to do this, I will need to generate all possible sets of
hands (since this is a special case of the infamous satisfyability
problem).
My question is this: What algorithm & data structures should I use
to most-efficiently generate all possible permutations of hands?
The simplest (and worst) would be to go through every possible
"pre-deal" deck (n! decks) and then deal it out to players to create
the set of hands. However this approach has a lot of inefficiency in
it because within a given hand order isn't important (if you get a
King as your first card and a Queen as your second, that is the exact
same hand as if get a Queen first and King second).
Just experimenting, I have improved on this method a lot, but I
suspect my algorithm still is pretty inefficient-- surely somebody
has to have analyzed this problem and come up with the best way to do.
Any ideas?
- Next message: Elaine Jackson: "circuit logic"
- Previous message: Mark Kvale: "Re: Protein folding and P = NP"
- Next in thread: Just John: "Re: Algorithm to generate all possible deals"
- Reply: Just John: "Re: Algorithm to generate all possible deals"
- Reply: Doc O'Leary: "Re: Algorithm to generate all possible deals"
- Reply: JD: "Re: Algorithm to generate all possible deals"
- Reply: Glenn C. Rhoads: "Re: Algorithm to generate all possible deals"
- Reply: James Dow Allen: "Re: Algorithm to generate all possible deals"
- Reply: Matt: "Re: Algorithm to generate all possible deals"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|