Serving edge node (smart) Idle edge node Naive-policy target Mobile device
Serving: node 0
State: connected

Edge Server Handoff: Mobility-Aware Migration Simulator (2D)

Mobile edge computing only pays off if a moving device is actually connected to a nearby edge node — but the "nearest node" changes constantly as the device moves, and migrating a live session between nodes isn't free. This 2D top-down version places edge-compute nodes on a flat map, drives a device along a route, and computes real round-trip latency to every node from screen-space distance and a fibre-backhaul propagation model. A hysteresis-based handoff policy — the same anti-flapping rule cellular and Wi-Fi handover use — decides when the gain from switching to a closer node outweighs the fixed migration cost, and a naive "always nearest" shadow policy runs the identical route alongside it so you can directly compare total cost. Drop the hysteresis margin to zero and watch the ping-pong counter climb as the device thrashes between nodes near a coverage boundary; raise the migration cost and watch mean latency rise as the policy gets more conservative about migrating.