A water-energy-food security nexus framework based on optimal resource allocation