Abstract
A semimagic square of order n is an n×n matrix containing the integers 0,…,n 2−1 arranged in such a way that each row and column add up to the same value. We generalize this notion to that of a zero k×k -discrepancy matrix by replacing the requirement that the sum of each row and each column be the same by that of requiring that the sum of the entries in each k×k square contiguous submatrix be the same. We show that such matrices exist if k and n are both even, and do not if k and n are relatively prime. Further, the existence is also guaranteed whenever n=k m, for some integers k,m≥2. We present a space-efficient algorithm for constructing such a matrix.
Another class that we call constant-gap matrices arises in this construction. We give a characterization of such matrices.
An application to digital halftoning is also mentioned.
Similar content being viewed by others
References
Aggarwal, A., Klawe, M., Moran, S., Shor, P., Wilber, R.: Geometric applications of a matrix searching algorithm. In: Proc. 2nd ACM Symposium on Computational Geometry, pp. 285–292 (1986)
Asano, T.: Digital halftoning: algorithm engineering challenges. IEICE Trans. Inf. Syst. E86-D(2), 159–178 (2003)
Asano, T., Obokata, K., Katoh, N., Tokuyama, T.: Matrix rounding under the L p -discrepancy measure and its application to digital halftoning. In: Proc. ACM-SIAM Symposium on Discrete Algorithms, San Francisco, pp. 896–904 (2002)
Asano, T., Katoh, N., Obokata, K., Tokuyama, T.: Combinatorial and geometric problems related to digital halftoning. In: Theoretical Foundations of Computer Vision: Geometry, Morphology, and Computational Imaging. Lecture Notes in Comput. Sci., vol. 2616. Springer, New York (2003)
Bayer, B.E.: An optimum method for two-level rendition of continuous-tone pictures. In: Conference Record, IEEE International Conference on Communications, vol. 1, pp. (26-11)–(26-15) (1973)
Chazelle, B.: The Discrepancy Method: Randomness and Complexity. Cambridge University Press, Cambridge (2000)
Heinz, H.D.: Magic squares, magic stars & other patterns. Web site, http://www.geocities.com/CapeCanaveral/Launchpad/4057/
Knuth, D.E.: The Art of Computer Programming, Volume 1, Fundamental Algorithms, 3rd edn. Addison-Wesley, Reading (1997)
Matoušek, J.: Geometric Discrepancy. Springer, New York (1991)
Mitsa, T., Parker, K.J.: Digital halftoning technique using a blue-noise mask. J. Opt. Soc. Am. A 9(11), 1920–1929 (1992)
Ulichney, R.A.: Dithering with blue noise. Proc. IEEE 76(1), 56–79, (1988)
Ulichney, R.: The void-and-cluster method for dither array generation. In: Allebach, J. (ed.) IS&T/SPIE Symposium on Electronic Imaging Science and Technology, Proceedings of Conf. Human Vision, Visual Processing and Digital Display IV. Proc. SPIE, vol. 1913, pp. 332–343. Wiley, New York (1993)
Yao, M., Parker, K.J.: Modified approach to the construction of a blue noise mask. J. Electron. Imag. 3, 92–97 (1994)
Author information
Authors and Affiliations
Corresponding author
Additional information
A preliminary version of this paper appeared in Proceedings of International Symposium on Algorithms and Computation, Hong Kong, December, 2004.
Part of the work on the paper has been carried out when B.A. was visiting JAIST. Work of B.A. on this paper was supported in part by NSF ITR Grant CCR-00-81964.
Work of T.A. was partially supported by the Ministry of Education, Science, Sports and Culture, Grant-in-Aid for Scientific Research (B).
Rights and permissions
About this article
Cite this article
Aronov, B., Asano, T., Kikuchi, Y. et al. A Generalization of Magic Squares with Applications to Digital Halftoning. Theory Comput Syst 42, 143–156 (2008). https://doi.org/10.1007/s00224-007-9005-x
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-007-9005-x