Flux cost functions and optimal metabolic states