Abstract
This paper addresses the Infinite Horizon Recurrent Routing Problem (IHRRP), a framework for optimizing service agent routes over an indefinite timeframe. Unlike traditional finite-horizon routing, IHRRP focuses on maximizing long-run average payoffs where rewards are non-linear functions of time elapsed since the last visit. We prove that finding near-optimal schedules in this context is PSPACE-hard. To overcome this complexity, we introduce a two-stage algorithmic pipeline: first, optimizing Randomized Finite-Memory (RFM) schedules using differentiable programming and gradient ascent; second, sampling these strategies to extract high-performing, deterministic periodic cycles. Our results demonstrate that this approach scales effectively to large instances, producing schedules that significantly outperform standard randomized strategies.
Introduction
Most classical routing models, such as the Vehicle Routing Problem with Time Windows (VRPTW), are designed for finite horizons—typically a single working shift. However, many real-world maintenance tasks, such as infrastructure inspection, vending machine servicing, or environmental monitoring, operate on continuous, long-term cycles. In these scenarios, the goal is not merely to complete a list of tasks today, but to maintain a system in an optimal state indefinitely.
The Infinite Horizon Recurrent Routing Problem (IHRRP) formalizes this challenge. In this model, an agent moves through a graph to maximize the "mean payoff" over time. This problem is uniquely difficult because payoffs are often non-linear; servicing a location too early might yield negligible rewards, while servicing it too late might incur severe penalties. Furthermore, the agent may strategically choose to wait at a location to synchronize with a payoff window. We establish that the IHRRP is PSPACE-hard, necessitating a departure from traditional discrete optimization methods.
Methodology
To solve the IHRRP, we propose a novel synthesis of randomized strategies and gradient-based optimization.
1. RFM Synthesis via Gradient Ascent
We represent the agent's strategy as a Randomized Finite-Memory (RFM) schedule. An RFM uses a finite set of internal memory states to determine the next action based on the current location and history. To make this strategy optimizable via modern machine learning frameworks, we transform the routing problem into a differentiable one:
- Edge Splitting: We introduce auxiliary nodes to represent waiting times, allowing the agent's "wait or move" decisions to be treated as transitions in a graph.
- Differentiable Parameterization: We use the Softmax function to parameterize transition probabilities between nodes.
- Gradient Ascent: By treating the routing strategy like the weights of a neural network, we apply the ADAM optimizer to maximize the long-run average payoff directly. This allows us to navigate the complex search space of the IHRRP more efficiently than discrete solvers.
2. Deterministic Sampling
While randomized strategies are mathematically elegant, they are often impractical for human operators or robotic systems requiring predictability. We address this by using the optimized RFM as a "navigator." We sample long trajectories from the randomized strategy and identify high-value cycles. These cycles are then extracted as deterministic, periodic schedules that can be easily followed and implemented.
Experimental Evaluation
We evaluated our approach using parameterized service specifications (denoted as $\mathcal{S}_k$) designed to simulate realistic maintenance environments.
- Benchmarks: We tested instances with up to $k=20$ high-priority nodes. For $k=20$, the environment consisted of 81 nodes (1 depot, 20 high-payoff/long-period nodes, and 60 low-payoff/short-period nodes).
- Layout: Nodes were distributed on a $12 \times 12$ grid with Manhattan distance determining travel times.
- Payoff Structure: The functions were designed to penalize late returns to a central depot (simulating shift ends) while rewarding periodic maintenance within specific windows.
Key Insights and Results
Our experiments yielded several critical insights into the nature of periodic routing:
- The Power of Randomization: Randomized strategies act as a powerful compression tool. A randomized strategy with a single memory state can often outperform a deterministic strategy requiring multiple states, as it can "blur" the edges of rigid schedules to find better average payoffs.
- Scalability and Speed: The gradient ascent process is remarkably efficient, typically converging within 30 steps. Even for the largest 81-node instances, the entire pipeline (optimization and sampling) completed in seconds.
- Cycle Performance: Interestingly, the deterministic cycles sampled from the RFMs consistently outperformed the raw randomized strategies they were derived from. This suggests that the RFM successfully identifies the "neighborhood" of optimal behavior, which the sampling process then refines into a peak-performance cycle.
- Complex Schedules: In large-scale instances, the discovered optimal cycles were often 100–200 nodes long, spanning more than 12 consecutive working shifts. Such complexity explains why traditional Mixed-Integer Linear Programming (MILP) approaches fail to scale for infinite horizon problems.
Conclusion and Future Work
This research demonstrates that combining differentiable programming with randomized finite-memory strategies provides a robust solution for the IHRRP. By treating routing as a continuous optimization problem, we can find high-quality periodic schedules that were previously computationally unreachable.
Future work will focus on expanding the objective function to include secondary costs such as fuel consumption and varying agent speeds. Additionally, we aim to explore how larger memory states ($M > 1$) might further improve performance in highly irregular graph topologies, and how to better present these long-duration cycles to human workers through digital assistance tools.
Summary updated