CVT
Centroidal Voronoi Tessellations
CVT
is a MATLAB library which
creates Centroidal Voronoi Tessellation (CVT) datasets.
The generation of a CVT dataset is of necessity more complicated than
for a quasirandom sequence. An iteration is involved, so there
must be an initial assignment for the generators, and then a
number of iterations. Moreover, in each iteration, estimates must
be made of the volume and location of the Voronoi cells. This is
typically done by Monte Carlo sampling. The accuracy of the resulting
CVT depends in part on the number of sampling points and the number
of iterations taken.
The library is mostly used to generate a dataset of points
uniformly distributed in the unit hypersquare. However, a user
may be interested in computations with other geometries or
point densities. To do this, the user needs to replace the
USER routine in the CVT library, and then specify
the appropriate values init=3 and sample=3.
The USER routine returns a set of sample points from the
region of interest. The default USER routine samples points
uniformly from the unit circle. But other geometries are
easy to set up. Changing the point density simply requires
weighting the sampling in the region.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
CVT is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
CCVT_BOX,
a MATLAB program which
constructs a modified CVT in which some points are forced to
lie on the boundary.
CCVT_REFLECT,
a MATLAB program which
tries to construct a modified CVT in which some points are forced to
lie on the boundary, using a reflection idea.
CVT,
a dataset directory which
contains a variety of examples of CVT datasets.
CVT_1D_LLOYD,
a MATLAB program which
computes an Npoint Centroidal Voronoi Tessellation (CVT)
within the interval [0,1], under a uniform density.
CVT_1D_NONUNIFORM,
a MATLAB program which
constructs a CVT in one dimension,
under a nonuniform density function.
CVT_1D_SAMPLING,
a MATLAB program which
computes an Npoint Centroidal Voronoi Tessellation (CVT)
within the interval [0,1], under a uniform density,
using sampling to estimate the Voronoi regions.
CVT_2D_SAMPLING,
a MATLAB program which
computes an Npoint Centroidal Voronoi Tessellation (CVT)
within the unit square [0,1]x[0,1], under a uniform density,
using sampling to estimate the Voronoi regions.
CVT_DATASET,
a MATLAB program which
creates a CVT dataset.
CVT_DEMO,
a MATLAB program which
demonstrates a CVT calculation.
FAURE,
a MATLAB library which
computes elements of a Faure quasirandom sequence.
GRID,
a MATLAB library which
computes elements of a grid dataset.
HALTON,
a MATLAB library which
computes elements of a Halton quasirandom sequence.
HAMMERSLEY,
a MATLAB library which
computes elements of a Hammersley quasirandom sequence.
HEX_GRID,
a MATLAB library which
computes elements of a hexagonal grid dataset.
IHS,
a MATLAB library which
computes elements of an improved distributed Latin hypercube dataset.
LATIN_CENTER,
a MATLAB library which
computes elements of a Latin Hypercube dataset, choosing center points.
LATIN_EDGE,
a MATLAB library which
computes elements of a Latin Hypercube dataset, choosing edge points.
LATIN_RANDOM,
a MATLAB library which
computes elements of a Latin Hypercube dataset, choosing
points at random.
LCVT,
a MATLAB library which
computes a latinized Centroidal Voronoi Tessellation.
NEAREST_NEIGHBOR,
a MATLAB library which
works in a given Mdimensional space, seeking, for each point
in a set S, the nearest point in a set R,
by Richard Brown.
NIEDERREITER2,
a MATLAB library which
computes elements of a Niederreiter quasirandom sequence with base 2.
SOBOL,
a MATLAB library which
computes elements of a Sobol quasirandom sequence.
TEST_NEAREST,
a MATLAB program which
tests the time complexity of various procedures for solving the
nearest neighbor problem.
UNIFORM,
a MATLAB library which
computes elements of a uniform pseudorandom sequence.
VAN_DER_CORPUT,
a MATLAB library which
computes elements of a van der Corput quasirandom sequence.
Reference:

Franz Aurenhammer,
Voronoi diagrams 
a study of a fundamental geometric data structure,
ACM Computing Surveys,
Volume 23, Number 3, September 1991, pages 345405.

Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Second Edition,
Springer, 1987,
ISBN: 0387964673.

John Burkardt, Max Gunzburger, Janet Peterson, Rebecca Brannon,
User Manual and Supporting Information for Library of Codes
for Centroidal Voronoi Placement and Associated Zeroth,
First, and Second Moment Determination,
Sandia National Laboratories Technical Report SAND20020099,
February 2002.

Qiang Du, Vance Faber, Max Gunzburger,
Centroidal Voronoi Tessellations: Applications and Algorithms,
SIAM Review,
Volume 41, Number 4, December 1999, pages 637676.

Bennett Fox,
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,
ACM Transactions on Mathematical Software,
Volume 12, Number 4, December 1986, pages 362376.

John Halton,
On the efficiency of certain quasirandom sequences of points
in evaluating multidimensional integrals,
Numerische Mathematik,
Volume 2, Number 1, December 1960, pages 8490.

Lili Ju, Qiang Du, Max Gunzburger,
Probabilistic methods for centroidal Voronoi tessellations
and their parallel implementations,
Parallel Computing,
Volume 28, 2002, pages 14771500.
Source Code:

ch_cap.m
capitalizes a single character.

cvt.m
computes a Centroidal Voronoi Tessellation.

cvt_energy.m
computes the CVT "energy" of a given dataset.

cvt_iterate.m
takes one step of the CVT iteration.

cvt_sample.m
returns sample points.

data_read.m
reads data from a file.

find_closest.m
finds the Voronoi cell generator closest to a point X.

get_seed.m
returns a seed for the random number generator.

halham_leap_check.m
checks LEAP for a Halton or Hammersley sequence.

halham_n_check.m
checks N for a Halton or Hammersley sequence.

halham_dim_num_check.m
checks DIM_NUM for a Halton or Hammersley sequence.

halham_seed_check.m
checks SEED for a Halton or Hammersley sequence.

halham_step_check.m
checks STEP for a Halton or Hammersley sequence.

halton_base_check.m
checks BASE for a Halton sequence.

i4_to_halton_sequence.m
next N elements of an DIM_NUMdimensional Halton sequence

prime.m
returns the Nth prime number.

r8mat_transpose_print.m
prints the transpose of an R8MAT, with an optional title.

r8mat_transpose_print_some.m
prints the transpose of some of an R8MAT, with an optional title.

r8mat_uniform_01.m
returns a unit pseudorandom R8MAT.

r8mat_write.m
writes an R8MAT to a file.

random_initialize.m
initializes the MATLAB random number seed.

s_eqi.m
is TRUE if two strings are equal, ignoring case.

s_len_trim.m
returns the length of a string to the last nonblank.

timestamp.m
prints the current YMDHMS date as a timestamp.

tuple_next_fast.m
computes the next element of a tuple space, "fast".

user.m
a sample version of the USER routine, which can be used to
specify a region which is not the unit hypercube.

user_circle_2d.m
a sample version of the USER routine, which in this case,
returns points in the unit circle, under a uniform density.

user_box_3d.m
a sample version of the USER routine, which in this case,
returns points in a 3D box of dimension [0,5]x[1,+1]x[2,4],
under a uniform density.
Examples and Tests:

cvt_test.m,
runs all the tests.

cvt_test_output.txt,
the output file.

cvt_test01.m
works in 2D, computes 10 points, using UNIFORM initialization
and UNIFORM sampling, IT_FIXED is 1, 10000 sample points are
used, and the random number seed is 123456789.

cvt_test02.m
repeats test 1 with twice as many iterations.

cvt_test03.m
repeats test 1 with 100 times as many sample points.

cvt_test04.m
repeats test 1 with UNIFORM initialization and HALTON sampling.

cvt_test05.m
repeats test 1 with UNIFORM initialization and GRID sampling.

cvt_test06.m
repeats test 1 with UNIFORM initialization and RANDOM sampling.

cvt_test07.m
repeats test 1 with a different seed.

cvt_test08.m
repeats test 1 with a different batch size.

cvt_test09.m
repeats test 1 with IT_FIXED = IT_MAX.

cvt_test10.m
generates 100 points in 3D.

cvt_test11.m
experiments with a Cartesian grid as starting point.

cvt_test12.m
tests the 'RANDOM' initialization option.

cvt_test13.m
works in 2D, computes 100 points, using USER initialization
and USER sampling, IT_FIXED is 1, 10000 sample points are
used, and the random number seed is 123456789. The user
geometry is the unit circle, with uniform density.

cvt_test14.m
works in 1D (where we know the exact answer) and shows that
it can take a long time for the computation to get close
to the exact answer.

cvt_circle.txt,
a set of 100 CVT points in a circle, generated using
the built in USER routine.

cvt_circle.png,
a PNG image
of the 100 CVT points in a circle.
You can go up one level to
the MATLAB source codes.
Last revised on 12 March 2010.