# Constrained MDPs with Trajectory Constraints

*Martino Bernasconi, Matteo Castiglioni, Alberto Marchesi*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/154144) · [OpenReview](https://openreview.net/forum?id=FvA1nYXCFk) · [Open on the map](../papers.html#p154144)

Category: [Reinforcement Learning & Games](../pcat/10.md) › [Constrained Reinforcement Learning](../pgroup/567.md) · Type: new method · Keywords: trajectory constraints, constrained MDPs, non-Markovian policies, safety guarantees, dynamic programming

## Summary
We introduce a framework for constrained MDPs with trajectory-wise safety constraints that provides an exact characterization of optimal history-dependent policies and a polynomial-time approximation algorithm under a constant number of constraints.

## Explained to a 5-year-old
In a game where you try to reach a goal while staying safe, sometimes you need to remember everything you’ve done before. The paper says that just looking at the current step isn’t enough to stay safe all the time. It shows that making the safest choices is really hard when there are many rules, but if there are only a few rules, we can find a good plan. This helps create robots and cars that avoid danger more reliably. We can think of it like a treasure hunt where you must follow all the safety clues to win.

## Explained to a 5-year-old, longer
Imagine you are playing a video game where you have to reach a finish line without getting hurt. Sometimes the game has rules that say you must never go too close to a dangerous spot. The old way of making games only checked if you were safe on average, but that could miss a single dangerous moment. This paper says we need a new way to make sure you are safe no matter which path you take. It shows that the best way to stay safe might need to remember everything you have done before, not just where you are now. When there are many safety rules, finding the perfect safe plan becomes very hard, like solving a super difficult puzzle. But if there are only a few safety rules, we can use a simple step-by-step method to get a good safe plan. The idea is to keep track of all possible rewards and costs you could get in the future and choose the best actions. This helps designers of robots, self-driving cars, and other important machines make decisions that are safer. By using this new approach, you can avoid accidents that might happen with older methods. It also tells us why we should not trust a robot that only looks at the present moment when safety matters. Overall, the paper gives us a clearer way to think about safety in complex decision-making systems.

## For a technical reader
The paper addresses constrained Markov decision processes (MDPs) where safety must hold for every possible trajectory, not just on average. It proves that optimal policies are generally non-Markovian, meaning they need to remember past states to satisfy trajectory-wise constraints. The authors show that computing such policies is NP-hard when many constraints are present, but they provide an exact characterization using reachable reward-cost sets. Leveraging this characterization, they devise a polynomial-time approximation algorithm that works when the number of constraints is constant, using dynamic programming. This work enables more reliable safety guarantees for high-stakes applications like autonomous driving and robotics by ensuring constraints are respected along entire execution paths.

## Problem
Designing policies for constrained Markov decision processes that satisfy safety constraints on each possible trajectory, not merely in expectation, is challenging because optimal policies may need to be history-dependent and computing them is computationally hard.

## Method
The approach exploits a recursive formulation of reachable reward-cost sets to characterize optimal history-dependent policies exactly, and then uses dynamic programming to compute an approximately-safe optimal policy when the number of constraints is constant.

## Results
The work shows that optimal policies may need to be non-Markovian, that the problem is NP-hard with many constraints, and that a polynomial-time approximation algorithm works when the number of constraints is constant.

## Contributions
We characterize optimal history-dependent policies for trajectory-wise constrained MDPs, prove hardness of the problem, and give a polynomial-time approximation algorithm for a constant number of constraints.

## Limitations and assumptions
The polynomial-time approximation algorithm requires a constant number of constraints, limiting scalability to many constraints.

## Practical relevance
These results enable safer decision-making in critical domains such as autonomous driving and robotics by providing stronger trajectory-wise safety guarantees.

## Research questions this paper is counted under

- [How can reinforcement learning agents learn policies that guarantee hard safety constraints while achieving optimal performance under uncertainty?](../q/44.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/154144)
