From: "Gold APP Instruments Andy" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: DelaunayTri efficiency
Date: Fri, 31 May 2013 02:46:17 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 54
Message-ID: <ko92tp$4f$>
References: <ko8adp$p8r$>
Reply-To: "Gold APP Instruments Andy" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1369968377 143 (31 May 2013 02:46:17 GMT)
NNTP-Posting-Date: Fri, 31 May 2013 02:46:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4344200
Xref: comp.soft-sys.matlab:796457

"R Wat" wrote in message <ko8adp$p8r$>...
> I have recently been working with Delaunay triangulation and was surprised at how long the triangulation procedure was taking. In total, my data has around 100,000 points in a relatively nicely spaced grid, which is large, but doesn't seem to be outrageous. In my tinkering around with things, I came across an interesting finding which is demonstrated in the following code:
> % Random grid of points
> X1 = rand(300*300,2); 
> % Equally spaced, well ordered, grid (of the same size as the above random data)
> [x,y] = meshgrid(1:300,1:300); 
> X2 = [x(:),y(:)];
> % Triangulate the random data and calculate the run time
> tic;
> random = DelaunayTri(X1);
> toc;
> % Triangulate the well ordered data
> tic;
> ordered = DelaunayTri(X2);
> toc;
> % Take the well ordered grid data and scramble it so that it is no longer well ordered
> scramble = randperm(numel(x)).';
> X3 = [x(scramble),y(scramble)];
> % Triangulate the now scrambled data
> tic;
> scrambled = DelaunayTri(X3);
> toc;
> Which gives the following output for the timing:
> Elapsed time is 1.037137 seconds. (Random data)
> Elapsed time is 10.460786 seconds. (Grid data)
> Elapsed time is 0.900113 seconds. (Scrambled grid data)
> What confuses me is that for the first two cases, triangulation of the same number of points takes a drastically different amount of time (10x slower). What is even more confusing is that, when you scramble the order of the grid data, the performance drops back to that of the random data.
> Does anybody know why this occurs? I kind of have a guess, but it is hind of "hand wavy."
Gold APP Instruments Corporation China, the leader, specializes in BET surface analyser, surface area and pore size analyzer, gas pycnometer true density analyzer and high pressure gas sorption analyzer manufacturing for laboratories, institutes and manufacturers.

Dealers, distributors, agents, wholesalers are recruiting currently. If you interest pls let us know. 

Gold APP Instruments Corp. China
Tel.: 0086-10-82133318 Ext.810
Fax: 0086-10-82118197
Mobile: 0086-18210009838
Skype: Gold-APP-Instruments

We can provide materials for tender or bid/binding documents, such as authorization letter, technology compliance data sheet, also can offer some experiences in invitation for bids, bid security form, checklist, submission of bids, technical bid, price schedule, performance security, commercial bid and so on.