clever programming solution wanted

Larry Bates lbates at swamisoft.com
Fri Jul 16 00:34:49 CEST 2004


Maybe someone else can decipher this.  I just don't
know what "such that the groups are maximal" could
possibly mean.

Larry Bates

"Scott Rifkin" <sar38 at pantheon.yale.edu> wrote in message
news:Pine.LNX.4.44.0407151728020.7818-100000 at ajax.its.yale.edu...
> If anyone has a good, quick solution to the following in python2.3
> I'd appreciate it:
>
> I have a dictionary with keys K1, K2, ..., K10000
> Each entry looks like:
>
> dict[K1]=[T1,T4,T500]
>
> where the T's are indexed from, say, 1 to 20000 and each K has some number
> of Ts (not always 3).
>
> I want to create groups of Ks which share Ts such the groups are maximal,
> for instance:
>
> dict[K1]=[T1,T4,T500]
> dict[K2]=[T1]
> dict[K3]=[T500,T7000]
>
> these would be grouped [K1,K2,K3].
>
> At the end, most of the Ks will be by themselves, but some will be grouped
> with some number of other Ks.
>
>
> Thanks for any help,
>
> Scott Rifkin
>
> scott dot rifkin at yale dot edu
>
>





More information about the Python-list mailing list