Pharmacy Duty Scheduling (PDS) is the activity of assigning pharmacies to days during a planning horizon with the purpose of serving society outside regular working hours. In Turkey, pharmacies are retailers who operate during the working hours in weekdays. However, demand for medicine at nights, at the weekends and on holidays must be satisfied by allocating times to pharmacies to open at these times. The problem is a multi-period p-median problem with the additional problem specific constraints, and it is NP-Hard. In this study, we develop a branch-and-price algorithm to solve the PDS to optimality. We decompose the problem into single period problems and apply column generation on the decomposed problem. We propose several enhancements on the algorithm and conduct computational tests on randomly generated instances to compare the performance of the developed algorithm with the state-of art general purpose solver. The branch-and-price algorithm outperforms the state-of-art general purpose solver. (C) 2016 Elsevier Ltd. All rights reserved.