The use of airborne laser scanning (LS) is increasing in forestry. Scanning can be conducted from manned aircrafts or unmanned aerial vehicles (UAV). The scanning data are often used to calculate various attributes for small raster cells. These attributes can be used to segment the forest into homogeneous areas, called segments, micro-stands, or, like in this study, stands. Delineation of stands from raster data is equal to finding the most suitable stand number for each raster cell, which is a combinatorial optimization problem. This study tested the performance of the simulated annealing (SA) metaheuristic in the delineation of stands from grids of UAV-LS attributes. The objective function included three criteria: within-stand variation of the LS attributes, stand area, and stand shape. The purpose was to create delineations that consisted of homogeneous stands with a low number of small stands and a regular and roundish stand shape. The results showed that SA is capable of producing stand delineations that meet these criteria. However, the method tended to produce delineations where the stands often consisted of disconnected parts and the stand borders were jagged. These problems were mitigated by using a mode filter on the grid of stand numbers and giving unique numbers for all disconnected parts of a stand. Three LS attributes were used in the delineation. These attributes described the canopy height, the height of the bottom of the canopy and the variation of echo intensity within 1-m2 raster cells. Besides, a texture variable that described the spatial variation of canopy height in the proximity of a 1-m2 raster cell was found to be a useful variable. Stand delineations where the average stand area was about one hectare explained more than 80% of the variation in canopy height.