Efficient Generation of Binary Magic Squares
Alain Riou

TL;DR
This paper introduces an efficient algorithm for generating Binary Magic Squares, providing theoretical guarantees, extending to non-square cases, and releasing GPU-accelerated implementations for practical use.
Contribution
The paper presents a simple, provably correct algorithm for generating Binary Magic Squares, including non-square variants, with publicly available GPU-accelerated Python implementations.
Findings
Algorithm always produces valid BMS with optimal complexity
Extension to non-square BMS with formal conditions
GPU-accelerated implementation for parallel generation
Abstract
We propose a simple algorithm for generating Binary Magic Squares (BMS), i.e., square binary matrices where the sum of all rows and all columns are equal. We show by induction that our algorithm always returns valid BMS with optimal theoretical complexity. We then extend our study to non-square Binary Magic Squares, formalize conditions on the sum of rows and columns for these BMS to exist, and show that a slight variant of our first algorithm can generate provably generate them. Finally, we publicly release two implementations of our algorithm as Python packages, including one that can generate several BMS in parallel using GPU acceleration.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsGraph Labeling and Dimension Problems · Matrix Theory and Algorithms · Advanced Optimization Algorithms Research
