Erin Catto mentioned in a talk that resolving restrictions requires precisely cubic time and quadratic space. What algorithm are you talking about when you mention cubic time?
Slide PDF with the following quotation:
We can model and program our restrictions perfectly. Good enough to drive a robot arm on an assembly line or
launch a satellite into space. Unfortunately for games, we don't have enough cycles to resolve restrictions precisely.
Resolving restrictions with precision requires cubic time and quadratic space. For the games we do with linear time and
space, so we are constantly struggling with our solvers. The better you understand the constraint solvers, the better
opportunity to create robust simulations in your game.