Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Find combinations in k-subsets

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14089] Find combinations in k-subsets
  • From: "Carlos Carreto" <ccarreto at ipg.pt>
  • Date: Fri, 25 Sep 1998 03:15:17 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

I would like to solve the following problem:

Having k-subsets given in lexicographic order as input:
 
{1,2,3},{1,2,4},{1,2,5},{1,2,6},{1,3,4},{1,3,5},{1,3,6},{1,4,6},
{2,3,4},{2,3,6},{2,4,6},{3,4,6}

I would like to determine the possible combinations.

In this case the k-subsets:

{1,2,3},{1,2,4},{1,2,6},{1,3,4},{1,3,6},{1,4,6},{2,3,4},
{2,3,6},{2,4,6},{3,4,6}

correspond to the combination:  [{1, 2, 3, 4, 6}, 3] 

and there are  two remaining k-subsets: {1,2,5} and {1,3,5}

This is more or less the opposite of the function KSubsets[ ].

Is there any function to do this? 
Can you think of an efficient algorithm? 

Thank you for your help

-:- Carlos



  • Prev by Date: Plotting (x,y,z) style data
  • Next by Date: Re: Cut and paste edits mis...
  • Previous by thread: Re: Bad error messages
  • Next by thread: Re: Find combinations in k-subsets