MathGroup Archive 1997

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

Search the Archive

Re: lists of pairs

  • To: mathgroup at
  • Subject: [mg8545] Re: [mg8511] lists of pairs
  • From: Russell Towle <rustybel at>
  • Date: Sat, 6 Sep 1997 23:16:13 -0400
  • Sender: owner-wri-mathgroup at

Hi all,

With reference to Jens' comparative Timings for two methods of discarding
"reversals" from a list of pairs of integers, I have done some more tests,
using larger lists of pairs. As mentioned before, this problem has to do
with obtaining a list of the edges of a polyhedron (as indices into a list
of vertices), with duplicates dropped.

In my test, instead of the edges of a pentagonal dodecahedron, where the
initial list contained 60 pairs, and the desired list has but 30 pairs, I
used the edges of an n=12 polar zonohedron, where the initial list has 528
pairs of integers, and the desired list, 264 pairs. In practice, I shall be
working at times with much more complicated polyhedra.

Let the initial list of pairs be called "edges." I will list the timings
for (1), my bad method, (2) Jens' method, and (3) the method proposed by C.
Woll and others, which differs from the first two in that, rather than
returning indices into "edges," it returns the desired subset of "edges."

1.  573 seconds (my method).
2.  298 seconds (Jens' method).
3.  .0833 seconds (Woll's method).

The drastic improvement of (3) over (1) and (2) may be ascribed to not
having to use Position[] at all, I guess.

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

  • Prev by Date: Combining Lists?
  • Next by Date: Re: importing images
  • Previous by thread: Re: lists of pairs
  • Next by thread: Re: Bra-Ket