Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] ]
>>> OK, so I need to be more precise.
>>> Given a list of sets, output the largest list of sets (from this list,
>>> order does not matter) such that:
>>> 1) there is no set that is a PROPER subset of another set in this list
>>> 2
On 18 Mar 2005 19:41:55 -0800, [EMAIL PROTECTED] wrote:
>Once again my specs were incomplete.
>By largest I mean exactly what you pointed out as in sum(map(len,
>setlist)).
>
But that will not necessarily yield a single setlist taken from the source set
list,
so you still need a selection amongst
Once again my specs were incomplete.
By largest I mean exactly what you pointed out as in sum(map(len,
setlist)).
I think this might work--sorting of the initial list should do the
trick.
1) sort the sets by size (in decending order)
2) put the first (largest) into a new list (Lu)
for s in Lnew[1:
[EMAIL PROTECTED] ]
> >OK, so I need to be more precise.
> >Given a list of sets, output the largest list of sets (from this list,
> >order does not matter) such that:
> >1) there is no set that is a PROPER subset of another set in this list
> >2) no two sets have exactly the same members (100% ove
On 18 Mar 2005 15:46:44 -0800, [EMAIL PROTECTED] wrote:
>OK, so I need to be more precise.
>Given a list of sets, output the largest list of sets (from this list,
>order does not matter) such that:
>1) there is no set that is a PROPER subset of another set in this list
>2) no two sets have exactly
OK, so I need to be more precise.
Given a list of sets, output the largest list of sets (from this list,
order does not matter) such that:
1) there is no set that is a PROPER subset of another set in this list
2) no two sets have exactly the same members (100% overlap)
Seems like this problem is m
On Thu, 17 Mar 2005 23:56:46 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
>
>"Kent Johnson" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Raymond Hettinger wrote:
>> > [EMAIL PROTECTED]
>> >
>> >>I have many set objects some of which can contain same group of object
>> >>w
Looking at all the hyperedges in the connected component is a big
waste... You can look at just the hyperedges that share one or more
nodes.
(Nodes are the original letters contained in the sets, and they must be
hashable).
If nodes aren't integers in [0, len(l)) then you can use this simpler
code
s1 = set(['a','b','c'])
s2 = set(['a','c'])
s3 = set(['a','d','e','f'])
s4 = set(['r','k','l'])
s5 = set(['r','k','l'])
ls = [s1,s2,s3,s4,s5]
result1 = [s1, s3, s5]
A result can contain s4 or s5 at random. This problem looks like the
one of searching the correct hyperedges for a hypergraph. s1-5 a
"Kent Johnson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Raymond Hettinger wrote:
> > [EMAIL PROTECTED]
> >
> >>I have many set objects some of which can contain same group of object
> >>while others can be subset of the other. Given a list of sets,
> >>I need to get a list of
Steven Bethard wrote:
> Can you just do:
>
> py> def uniq(lst):
> ... result = []
> ... for s1 in sorted(lst, reverse=True):
> ... for s2 in result:
> ... if s1 <= s2:
> ... break
> ... else:
> ... result.append(s1)
> ... return
Kent Johnson wrote:
Raymond Hettinger wrote:
[EMAIL PROTECTED]
I have many set objects some of which can contain same group of object
while others can be subset of the other. Given a list of sets,
I need to get a list of unique sets such that non of the set is an
subset of another or contain exactl
Raymond Hettinger wrote:
[EMAIL PROTECTED]
I have many set objects some of which can contain same group of object
while others can be subset of the other. Given a list of sets,
I need to get a list of unique sets such that non of the set is an
subset of another or contain exactly the same members.
[EMAIL PROTECTED]
> I have many set objects some of which can contain same group of object
> while others can be subset of the other. Given a list of sets,
> I need to get a list of unique sets such that non of the set is an
> subset of another or contain exactly the same members.
>
> Tried to do t
[EMAIL PROTECTED] wrote:
Hi,
I have many set objects some of which can contain same group of object
while others can be subset of the other. Given a list of sets,
I need to get a list of unique sets such that non of the set is an
subset of another or contain exactly the same members.
Tried to do th
Hi,
I have many set objects some of which can contain same group of object
while others can be subset of the other. Given a list of sets,
I need to get a list of unique sets such that non of the set is an
subset of another or contain exactly the same members.
Tried to do the following:
s1=set(['a'
16 matches
Mail list logo