Here is the output of benchmark program polygon_set_2_join.cpp on my machine
current version (polygon_set_2_join):
Timer for join is 0.316
Timer for remove_redundant_edges is 0.08799999999999997
Timer for _reset_faces is 0
Time for 402 grid crossing polygons 0.404
Timer for join is 1.512
Timer for remove_redundant_edges is 0.008000000000000007
Timer for _reset_faces is 0
Time for 1000 random polygons 1.52s
Timer for join is 3.108
Timer for remove_redundant_edges is 0
Timer for _reset_faces is 0
Time for 100000 nested polygons 3.108s
Timer for join is 6.103999999999999
Timer for remove_redundant_edges is 0.01200000000000045
Timer for _reset_faces is 0.003999999999999559
Time for 40000 disjoint polygons 6.119999999999999s
current version (polygon_set_2_join 2):
Timer for join is 0.636
Timer for remove_redundant_edges is 0.1719999999999999
Timer for _reset_faces is 0
Time for 566 grid crossing polygons 0.8079999999999999
Timer for join is 3.124000000000001
Timer for remove_redundant_edges is 0.01199999999999868
Timer for _reset_faces is 0
Time for 2000 random polygons 3.135999999999999s
Timer for join is 6.892000000000001
Timer for remove_redundant_edges is 0
Timer for _reset_faces is 0
Time for 200000 nested polygons 6.892000000000001s
Timer for join is 32.16799999999999
Timer for remove_redundant_edges is 0.04800000000000182
Timer for _reset_faces is 0.008000000000002672
Time for 160000 disjoint polygons 32.224s
this update the CGAL_JOIN_CREATE_AN_ARRANGEMENT version.
The benchmark program polygon_set_2_join.cpp is now better
using the CGAL_JOIN_CREATE_AN_ARRANGEMENT version.
I've put 2 as weight parameter but it should be fine tune
to better match the cost of removing an edge
this code is faster when the input contains many hole to relocate
but is bit slower on disjoint polygon for example.
This is a temporary commit to start the work with Efi
Here is the output of benchmark program polygon_set_2_join.cpp on my machine
current version (polygon_set_2_join):
Time for 402 grid crossing polygons 10.184
Time for 1000 random polygons 1.1s
Time for 100000 nested polygons 2.544s
Time for 40000 disjoint polygons 5.18s
CGAL_JOIN_CREATE_AN_ARRANGEMENT version (polygon_set_2_join):
Time for 402 grid crossing polygons 1.216
Time for 1000 random polygons 1.108s
Time for 100000 nested polygons 2.572s
Time for 40000 disjoint polygons 5.891999999999999s
current version(polygon_set_2_join 2):
Time for 566 grid crossing polygons 44.416
Time for 2000 random polygons 2.263999999999996s
Time for 200000 nested polygons 5.82s
Time for 160000 disjoint polygons 28.86000000000001s
CGAL_JOIN_CREATE_AN_ARRANGEMENT version (polygon_set_2_join 2):
Time for 566 grid crossing polygons 2.28
Time for 2000 random polygons 2.248000000000001s
Time for 200000 nested polygons 5.68s
Time for 160000 disjoint polygons 32.036s