CVT_1D_LLOYD is a MATLAB program which allows the user to carry out Lloyd's algorithm for a Centroidal Voronoi Tessellation (CVT) in the interval [0,1].
The determination of the Voronoi regions is carried out using exact techniques.
For n generators, the solution is known in advance:
x(i) = ( 2 * i - 1 ) / ( 2 * n )Lloyd's iterative algorithm starts from an arbitrary vector x, however, so it is interesting to see how the approximate solution evolves toward the correct answer.
cvt_1d_lloyd ( n, it_num, init )where
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
CVT_1D_LLOYD is available in a MATLAB version and a Python version.
CCVT_BOX, a MATLAB program which constructs a constrained Centroidal Voronoi Tessellation (CCVT) in which some points are forced to lie on the boundary.
CCVT_REFLECT, a MATLAB program which tries to construct a constrained Centroidal Voronoi Tessellation (CCVT) in which some points are forced to lie on the boundary, using a reflection idea.
CVT, a MATLAB library which computes a Centroidal Voronoi Tessellation (CVT).
CVT, a dataset directory which contains a variety of examples of Centroidal Voronoi Tessellations (CVT).
CVT_1D_NONUNIFORM, a MATLAB program which computes an N-point Centroidal Voronoi Tessellation (CVT) in 1 dimension, under a nonuniform density, and plots the evolution of the locations of the generators during the iteration;
CVT_1D_SAMPLING, a MATLAB program which computes an N-point 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 N-point 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_3D_SAMPLING, a MATLAB program which computes an N-point Centroidal Voronoi Tessellation (CVT) within the unit cube [0,1]x[0,1]x[0,1], under a uniform density, using sampling to estimate the Voronoi regions.
CVT_CIRCLE_UNIFORM, a MATLAB program which calculates a Centroidal Voronoi Tessellation (CVT) over a circle with uniform density.
CVT_DATASET, a MATLAB program which can create a Centroidal Voronoi Tessellation (CVT) dataset.
CVTM_1D, a MATLAB program which estimates a mirror-periodic Centroidal Voronoi Tessellation (CVTM) in the periodic interval [0,1], using a version of Lloyd's iteration.
LCVT, a MATLAB library which computes a "Latinized" Centroidal Voronoi Tessellation (CVT).
RANDOM sets the random initial values, using 40 generators and 400 steps.
SQUASHED sets the "squashed" initial values between 0.01 and 0.02, using 40 generators and 400 steps.
You can go up one level to the MATLAB source codes.