I am searching an algorithm for testing all possibilities in an 2D-array
Author Message
I am searching an algorithm for testing all possibilities in an 2D-array

Hi,

the first thing: Sorry for my bad english!

And the problem:
I have an 2D-array and have to set a fixed number of "flags" in all
possible variations on it.... So it is a "binary" problem that should
simulate all possible situation for X bits on it...

But the more I think about it the more I get confused....

Does anybody have something like that, or an idea to help me??

Thanx!

Sun, 26 Sep 2004 02:17:08 GMT
I am searching an algorithm for testing all possibilities in an 2D-array

Quote:
> I have an 2D-array and have to set a fixed number of "flags" in all
> possible variations on it.... So it is a "binary" problem that should
> simulate all possible situation for X bits on it...

> But the more I think about it the more I get confused....

> Does anybody have something like that, or an idea to help me??

Try one of the newsgroups with 'algs' in them.

Sun, 26 Sep 2004 02:19:16 GMT
I am searching an algorithm for testing all possibilities in an 2D-array

Quote:
> I have an 2D-array and have to set a fixed number of "flags" in all
> possible variations on it.... So it is a "binary" problem that should
> simulate all possible situation for X bits on it...

> But the more I think about it the more I get confused....

> Does anybody have something like that, or an idea to help me??

Dimensions are a figment of your imagination. Have a look at this:

#define R 42         /* the number of rows */
#define C 13         /* the number of columns */
#define N (R*C)      /* the population */
#define K ...        /* the sample<= N */

tydedef unsigned char flag_t;

typedef union {
flag_t your_problem[R][C];
flag_t simple_stuff[N];
} data_t;

data_t my_data;

Now, rip some C(n, k) implementing algorithm from the net and
pass it my_data.simple_stuff to chew on. After that, have a look
at my_data.your_problem.

kind regards,

ps. comp.programming would've been a more appropriate group for this
type of questions ...

Sun, 26 Sep 2004 03:59:37 GMT
I am searching an algorithm for testing all possibilities in an 2D-array

Quote:

> > I have an 2D-array and have to set a fixed number of "flags" in all
> > possible variations on it.... So it is a "binary" problem that should
> > simulate all possible situation for X bits on it...

> > But the more I think about it the more I get confused....

> > Does anybody have something like that, or an idea to help me??

> Dimensions are a figment of your imagination. Have a look at this:

>     #define R 42         /* the number of rows */
>     #define C 13         /* the number of columns */
>     #define N (R*C)      /* the population */
>     #define K ...        /* the sample<= N */

>     tydedef unsigned char flag_t;

>     typedef union {
>         flag_t your_problem[R][C];
>         flag_t simple_stuff[N];
>     } data_t;

>     data_t my_data;

> Now, rip some C(n, k) implementing algorithm from the net and
> pass it my_data.simple_stuff to chew on. After that, have a look
> at my_data.your_problem.

> kind regards,

> ps. comp.programming would've been a more appropriate group for this
>     type of questions ...

Great Jos.
Dimensions are figments of imagination?
What is C(n,k)?
What color is the grass in Holland now? :-)
--

"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---

Sun, 26 Sep 2004 07:57:00 GMT
I am searching an algorithm for testing all possibilities in an 2D-array

Wed, 18 Jun 1902 08:00:00 GMT
I am searching an algorithm for testing all possibilities in an 2D-array

Quote:

> > Dimensions are a figment of your imagination. Have a look at this:
> > ps. comp.programming would've been a more appropriate group for this
> >     type of questions ...
> Great Jos.
> Dimensions are figments of imagination?
> What is C(n,k)?
> What color is the grass in Holland now? :-)

You mean the stuff I'm smoking right now or the stuff being
regurgitated by those four legged steak-generators? Erm, pink?
And C(n,k) isn't that a network television channel?

Nah, I plea temporary insanity your honour ... ;-)

Sun, 26 Sep 2004 14:02:18 GMT
I am searching an algorithm for testing all possibilities in an 2D-array
Quote:

> > > Dimensions are a figment of your imagination. Have a look at this:

> > > ps. comp.programming would've been a more appropriate group for this
> > >     type of questions ...

> > Great Jos.
> > Dimensions are figments of imagination?
> > What is C(n,k)?
> > What color is the grass in Holland now? :-)

> You mean the stuff I'm smoking right now or the stuff being
> regurgitated by those four legged steak-generators? Erm, pink?
> And C(n,k) isn't that a network television channel?

> Nah, I plea temporary insanity your honour ... ;-)

The court accepts your plea and suspends your sentence. You are free to
go. :-)
--

"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---

Mon, 27 Sep 2004 08:32:00 GMT

 Page 1 of 1 [ 7 post ]

Relevant Pages