The operation of connected vehicles demands substantial computing power, which cannot be fully supported by on-board units alone. Offloading tasks to network-based computing resources, spanning from the edge to the cloud, presents a promising solution. However, the challenge lies in assigning each request to an appropriate processing unit within this edge-cloud continuum while satisfying strict latency constraints. In this paper, we propose a simplified MILP framework for task offloading across a four-tier hierarchy: vehicle, edge, regional data centers, and cloud. While the MILP approach is impractical for real-time decision-making due to its high computational complexity and the dynamic nature of the problem, it provides an optimal solution that is valuable for benchmarking. We compared the proposed MILP model with four heuristic methods, revealing significant differences in terms of performance. The MILP model achieved a higher success ratio and reduced the average time required to process requests, thereby improving overall system performance.