In this paper an algorithm is described for automated treatment plan genera
tion. The algorithm aims at delivery of the prescribed dose to the target v
olume without violation of constraints for target, organs at risk and the s
urrounding normal tissue. Pre-calculated dose distributions for all candida
te orientations are used as input. Treatment beams are selected in a sequen
tial way. A score function designed for beam selection is used for the simu
ltaneous selection of beam orientations and weights. In order to determine
the optimum choice for the orientation and the corresponding weight of each
new beam, the score function is first redefined to account for the dose di
stribution of the previously selected beams. Addition of more beams to the
plan is stopped when the target dose is reached or when no additional dose
can be delivered without violating a constraint. In the latter case the sco
re function is modified by importance factor changes to enforce better spar
ing of the organ with the limiting constraint and the algorithm is run agai
n.