The shrinking populations of many regions in Portugal have led to a debate on the criteria which should guide the restructuring of public services at the local scale, and namely how to balance raising per capita costs with guaranteeing equity in accessibility. This article contributes to this debate by analyzing the spatial distribution of primary schools in the municipality of Vagos. It is based on a linear programming approach to optimize the resources needed for the operation and installation of school facilities and the level of accessibility that is provided. The simulated configurations are used as benchmarks for the actual spatial distribution of schools, identifying how it could be made more efficient or equitable and the criteria which have been prioritized in recent school planning policies. This allowed to conclude that, in the analyzed context, changes to the spatial distribution of schools have been made with significant equity concerns and that, while it would be possible to decrease costs through further consolidation, this would pose significant equity challenges.