Applications are becoming increasingly data-intensive, requiring significant computational resources to meet their demand. Cloud-based services are insufficient to meet such demand, leading to a shift of the computation towards the devices closer to the edge of the network, leading to the emergence of an Edge-to-Cloud computing Continuum (E2C). An application can offload part of its computation toward the E2C. The allocation of applications to a set of available computing nodes is a challenging problem, as the allocation needs to take into account several factors, including the application requirements and demands as well as the optimization of the resource utilization in the E2C infrastructure and the minimization the CO2 footprint of the executed applications. Control and optimization techniques provide a vast array of tools for optimizing the Edge-to-Cloud continuum's management. This paper provides a mathematical formulation for the application offloading with specific requirements in the cloud computing domain. The problem is modeled as integer linear programming and constraint programming models and implemented in commercially available software. Finally, we provide the results of performed comparison between the two models.