Economic constraints, by inducing the selection of low cost energy dense diets, could indirectly be responsible for the high prevalence of obesity in low socio-economic status groups. Diet optimisation by linear programming was used to test this hypothesis, by examining the relationship between the cost and the energy density (ED) of modelled diets. Models were developed that minimized the departure from the mean adult French diet estimated from a cross-sectional dietary survey. Palatability constraints were introduced into all models. The impacts of cost on ED and of ED on cost were explored by introducing and strengthening first a constraint on cost and then a constraint on ED. Forcing the cost of the linear programming diets to decrease induced a strong increase in their EDs. In contrast, forcing the ED to increase induced only a moderate decrease in diet costs. These results suggest that, although an energy dense diet can be selected at a relatively high cost, when cost is not influencing food choices, an energy dense diet will be preferentially selected to maintain habitual French dietary patterns when the budget for food is low. This supports the hypothesis that economic constraints play a role in the high prevalence of obesity in low-income people.