# Novel Matrix Hit and Run for Sampling Polytopes and Its GPU Implementation

arXiv: https://arxiv.org/abs/2104.07097 · HTML: https://mlsanity.com/paper/2104.07097/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 14 Apr 2021.

## Built on by (most cited first, 2 of 2)

- [Efficient Preimage Approximation for Neural Network Certification](https://mlsanity.com/paper/2505.22798/) (2025)
- [Simplex Decomposition for Portfolio Allocation Constraints in Reinforcement Learning](https://mlsanity.com/paper/2404.10683/) (2024)

## Abstract (arXiv)

We propose and analyze a new Markov Chain Monte Carlo algorithm that generates a uniform sample over full and non-full dimensional polytopes. This algorithm, termed "Matrix Hit and Run" (MHAR), is a modification of the Hit and Run framework. For the regime n^1+frac13 ll m, MHAR has a lower asymptotic cost per sample in terms of soft-O notation (SO) than do existing sampling algorithms after a textitwarm start. MHAR is designed to take advantage of matrix multiplication routines that require less computational and memory resources. Our tests show this implementation to be substantially faster than the textithitandrun R package, especially for higher dimensions. Finally, we provide a python library based on Pytorch and a Colab notebook with the implementation ready for deployment in architectures with GPU or just CPU.
