MathGroup Archive 2010

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

Search the Archive

Re: Building clusters out of a nested list


Am 23.12.2010 09:56, schrieb Dmitry:
>   { {A,B,C},{C,D},{E,F},{F,H}}


Repeat replacing two sublists with at least on common element by their 
common Union

In:
{{A, B, C}, {C, D}, {E, F}, {F, H}} //.
  {X___List, {x1___, a_, y1___}, Y___List, {x2___, a_, y2___},
    Z___} :>
	{X, Y, Z, Union[{x1, a, y1}, {x2, a, y2}]}


{{A, B, C, D}, {E, F, H}}

-- 

Roland Franzius


  • Prev by Date: Re: ODBC-connection
  • Next by Date: Re: Building clusters out of a nested list
  • Previous by thread: Building clusters out of a nested list
  • Next by thread: Re: Building clusters out of a nested list