Skip to main content
added 341 characters in body; edited title
Source Link

Generating sets of tuples from possible candidate lists (or finding perfect matchings in uniform hypergraphs)

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(4,3),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$. EDIT: I had before that $O_1 = (1,2),(3,4),(5,6)$. This was incorrect.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.

One more edit: Thanks to the help of Aaron Meyerowitz, It seems to be that this problem can be thought of as the problem of finding perfect matchings in a $T$-uniform hypergraph on $N$ nodes. I'll leave it open a bit more with the hope that it's easier and not equivalent to this problem, but just learning this much about it is helpful.

Generating sets of tuples from possible candidate lists

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(4,3),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$. EDIT: I had before that $O_1 = (1,2),(3,4),(5,6)$. This was incorrect.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.

Generating sets of tuples from possible candidate lists (or finding perfect matchings in uniform hypergraphs)

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(4,3),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$. EDIT: I had before that $O_1 = (1,2),(3,4),(5,6)$. This was incorrect.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.

One more edit: Thanks to the help of Aaron Meyerowitz, It seems to be that this problem can be thought of as the problem of finding perfect matchings in a $T$-uniform hypergraph on $N$ nodes. I'll leave it open a bit more with the hope that it's easier and not equivalent to this problem, but just learning this much about it is helpful.

added 71 characters in body
Source Link

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(3,4),(5,6)$$O_1 = (1,2),(4,3),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$. EDIT: I had before that $O_1 = (1,2),(3,4),(5,6)$. This was incorrect.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(3,4),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(4,3),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$. EDIT: I had before that $O_1 = (1,2),(3,4),(5,6)$. This was incorrect.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.

Source Link

Generating sets of tuples from possible candidate lists

First, apologies for the title. This is an odd question, and I couldn't come up with a simple title for it.

I'm trying to come up with a good algorithm for the following, and it's giving me a headache.

I have (not necessarily disjoint) sets $S_1,\ldots,S_T$, each $S_t$ contains a subset of $1,\ldots,N$ for some $N$. I want to generate all possible objects, where an object is defined as a set of $k$ tuples of length $T$, with each tuple in an object containing exactly one element from each of $S_1,\ldots,S_T$ and in each object no base element from $1,\ldots,N$ is repeated.

For example: $k = 3, T = 2, N = 6$.

$S_1 = \{1,2,4,5\}$

$S_2 = \{2,3,4,6\}$

One valid object would be $O_1 = (1,2),(3,4),(5,6)$ - all six numbers appear and each pair has one element from $S_1$ and one element from $S_2$.

An invalid object would be $(1,5),(2,4),(3,6)$, since $1 \in S_1$ but $5 \notin S_2$.

The reason I'm interested in this is because these valid objects are feasible solutions for a problem I'm working on, and I'd like to enumerate all feasible solutions on small test cases to get some intuition on my problem.