Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] performance of finite_adjacent_vertices

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] performance of finite_adjacent_vertices


Chronological Thread 
  • From: Frankie Li <>
  • To:
  • Subject: Re: [cgal-discuss] performance of finite_adjacent_vertices
  • Date: Wed, 26 May 2010 10:38:39 -0400

Hi Sebastien,

I'm terribly sorry for wasting your time. I just realized that I had an extra line in the middle of the loop that copies the triangulation, left over from a test I was running and hence the slow down. ( Sleep deprivation => doing stupid things...) As expected, getting adjacent vertices takes sub-second time.

Thanks,

Frankie

Sebastien Loriot (GeometryFactory) wrote:
Frankie Li wrote:
Hi all,

I'm trying to traverse all neighbors of each vertex in a regular triangulation, and naively, I've done something like this:

// pseudo-code

for( Finite_vertex_iterator it = tr.finite_vertices_begin();
it != tr.finite_vertices_end(); ++ it )
{

vector<Vertex_handle> Ngb_vertices;
tr.finite_adjacent_vertices( it, std::back_inserter( Ngb_vertices ));
}

However, I found it to be surprisingly slow. I have approximately 15000 vertices, and I'm using Exact_predicates_inexact_constructions_kernel. (It takes about 3000 seconds to go through the loop above for 15000 vertices. I'm running on a Core 2 Quad machine.)


Any advice is welcomed! Thanks!

Frankie

Hello,

what you report is quite strange, because this is a combinatoric operation usually fast. I just make a quick test with 4500 weighted points and without any optimisation the timing is less 0.03s.

Can you test the program joint (it expects a file with line x y z radius as first argument) and tell us about the running time.


S.




Archive powered by MHonArc 2.6.16.

Top of Page