Vertical farming has developed as a potentially more sustainable alternative to conventionally grown produce. Vertical farms provide an opportunity for locally farmed vegetables and herbs, although it requires electricity to power lights and other climate regulators, which affects both environment and the financial viability of farming businesses. Based on research on plant responses to different methods of lighting this paper describes a study on minimizing lighting costs in vertical farms. Six lighting strategies are studied and compared to a control of 16 hours of continuous light. Four of the strategies implements intermittent lighting with 10 minutes of light during each dark hour, and 12 light hours distributed in different ways, while strategies using only continuous light has a photoperiod of 16 hours. Optimization was done using either a dynamic programming algorithm or an exhaustive algorithm depending on the size of the optimization problem, with objective of minimizing costs using Swedish electricity prices. For each lighting strategy the schedule with least and greatest cost was found and compared. The study found that the best lighting schedule with respect to lighting cost is obtained by intermittent lighting with light hours from 22:00 to 8:00 and from 14:00 to 16:00. This also uses less electricity than the control schedule. For all examined strategies the optimized schedules will reduce electricity costs, and for those using intermittent lighting all possible schedules of each strategy will reduce costs. The environmental impact is dependent on the distribution of production of energy by different sources at different hours, which requires thorough analysis of export and import of electricity between countries, and electricity sources.