What is the most memory efficient algorithm for calculating $A\cdot B$, where $A,B\in \mathbb{R}^{n \times n}$?  

The result of this multiplication might be stored in one of the given matrices ($A$ or $B$). The 'ideal' algorithm would perform calculations with $O(1)$ additional memory and return $A\cdot B$ and $B$



Memory efficient matrix multiplication
[This](http://ljk.imag.fr/membres/Brice.Boyer/pdf/winoschedule.pdf) may help.


