MathGroup Archive 1997

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

Search the Archive

Re: lists of pairs

  • To: mathgroup at
  • Subject: [mg8505] Re: lists of pairs
  • From: Seth Chandler <SChandler at>
  • Date: Thu, 4 Sep 1997 02:19:49 -0400
  • Organization: University of Houston
  • Sender: owner-wri-mathgroup at

Russell Towle wrote:

> Hi all, I have a problem in discarding duplicates from a list of
> integer
> pairs, where if pairs of the form {a, b} and {b,a} exist in the list,
> I
> wish to discard (or select) only one, it doesn't matter which.  The
> method
> I use below works, but is slow.


> Suggestions?  It is desired to minimize the time it takes to do this.
> Russell Towle
> Giant Gap Press:  books on California history, digital topographic
> maps
> P.O. Box 141
> Dutch Flat, California 95714
> ------------------------------
> Voice:  (916) 389-2872
> e-mail:  rustybel at
> ------------------------------

If z is your list of pairs with duplicates, how about Union[Map[Sort,z]]

Seth J. Chandler
Associate Professor of Law
University of Houston Law Center

  • Prev by Date: Q??: Solve::"eqf": "False is not a well-formed equation
  • Next by Date: Q: Union and precision.
  • Previous by thread: Re: lists of pairs
  • Next by thread: Re: lists of pairs