Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Testing Lipschitz Functions on Hypergrid Domains

  • 158 Accesses

  • 2 Citations


A function \(f(x_1, \ldots , x_d)\), where each input is an integer from 1 to \(n\) and output is a real number, is Lipschitz if changing one of the inputs by 1 changes the output by at most 1. In other words, Lipschitz functions are not very sensitive to small changes in the input. Our main result is an efficient tester for the Lipschitz property of functions \(f: [n]^d \rightarrow \delta {\mathbb {Z}}\), where \(\delta \in (0,1]\) and \(\delta {\mathbb {Z}}\) is the set of integer multiples of \(\delta \). A property tester is given an oracle access to a function \(f\) and a proximity parameter \(\epsilon \), and it has to distinguish, with high probability, functions that have the property from functions that differ on at least an \(\epsilon \) fraction of values from every function with the property. The Lipschitz property was first studied by Jha and Raskhodnikova (FOCS’11) who motivated it by applications to data privacy and program verification. They presented efficient testers for the Lipschitz property of functions on the domains \(\{0,1\}^d\) and \([n]\). Our tester for functions on the more general domain \([n]^d\) runs in time \(O(d^{1.5} n\log n)\) for constant \(\epsilon \) and \(\delta \). The main tool in the analysis of our tester is a smoothing procedure that makes a function Lipschitz by modifying it at a few points. Its analysis is already nontrivial for the 1-dimensional version, which we call Bubble Smooth, in analogy to Bubble Sort. In one step, Bubble Smooth modifies two values that violate the Lipschitz property, namely, differ by more than 1, by transferring \(\delta \) units from the larger to the smaller. We define a transfer graph to keep track of the transfers, and use it to show that the \(\ell _1\) distance between \(f\) and BubbleSmooth\((f)\) is at most twice the \(\ell _1\) distance from \(f\) to the nearest Lipschitz function. Bubble Smooth has several other important properties that allow us to obtain a dimension reduction, i.e., a reduction from testing functions on multidimensional domains to testing functions on one-dimensional domains. Our dimension reduction incurs only a small multiplicative overhead in the running time and thus avoids the exponential dependence on the dimension.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3
Fig. 4


  1. 1.

    In the definition of a property tester, we set the success probability to 2/3. By standard arguments, it can be amplified to \(1-\gamma \) for any \(\gamma \in (0,1/3)\) with \(\Theta (\log 1/\gamma )\) overhead in the complexity of the tester.

  2. 2.

    The distance measure on the space of functions used here and in previous work on property testing is Hamming distance. After the conference version of this article was published, Berman et al. [6] proposed to use \(\ell _p\) distances in property testing of real-valued functions. We note that even though testing with respect to \(\ell _p\) distances is very useful, testing with respect to Hamming distance is still important. In particular, the applications of Lipschitz testers to privacy developed in [11, 20] require the use of Hamming distance.

  3. 3.

    The set \(\{1,\ldots ,n\}\) is denoted by \([n]\).

  4. 4.

    If \(\delta >1\) then \(f\) is Lipschitz iff it is 0-Lipschitz (that is, constant). Testing if a function is constant takes \(O(1/\epsilon )\) time.

  5. 5.

    For example, the case when \(k\) is smaller than \(j\) occurs when running \(\mathbf{BubbleSmooth } \) over the sequence \(f(1) = 5\), \(f(2) = 0\), and \(f(3) = 2\), during phase \(\mathbf{Fix } (1)\).


  1. 1.

    Ailon, N., Chazelle, B., Comandur, S., Liu, D.: Estimating the distance to a monotone function. Random Struct. Algorithm. 31(3), 371–383 (2007)

  2. 2.

    Awasthi, P., Jha, M., Molinaro, M., Raskhodnikova, S..: Testing Lipschitz functions on hypergrid domains. Proceedings of APPROX-RANDOM, pp. 387–398 (2012)

  3. 3.

    Bhattacharyya, A., Grigorescu, E., Jung, K., Raskhodnikova, S., Woodruff, D.P.: Transitive-closure spanners. SIAM J. Comput. 41(6), 1380–1425 (2012)

  4. 4.

    Blum, M., Luby, M., Rubinfeld, R.: Self-testing/correcting with applications to numerical problems. J. Comput. Syst. Sci. 47(3), 549–595 (1993)

  5. 5.

    Batu, T., Rubinfeld, R., White, P.: Fast approximate PCPs for multidimensional bin-packing problems. Inf. Comput. 196(1), 42–56 (2005)

  6. 6.

    Berman, P., Raskhodnikova, S., Yaroslavtsev, G.: \(L_p\)-testing. In: Proceedings of the 46th Symposium on Theory of Computing, STOC , pp. 164–173 (2014)

  7. 7.

    Chakrabarty, D., Dixit, K., Jha, M., Seshadhri, C.: Property testing on product distributions: optimal testers for bounded derivative properties. In Proceedings of the 26th Symposium on Discrete Algorithms, SODA, pp. 1809–1828 (2015)

  8. 8.

    Czumaj, A., Sohler, C.: Sublinear-time algorithms. In: Property Testing, Lecture Notes in Computer Science 6390, pp. 41–64. Springer, Berlin (2010)

  9. 9.

    Chakrabarty, D., Seshadhri, C.: Optimal bounds for monotonicity and Lipschitz testing over hypercubes and hypergrids. In: Proceedings of the 45th Symposium on Theory of Computing, STOC, pp. 419–428 (2013)

  10. 10.

    Dodis, Y., Goldreich, O., Lehman, E., Raskhodnikova, S., Ron, D., Samorodnitsky, A.: Improved testing algorithms for monotonicity. In: Proceedings of APPROX-RANDOM , pp. 97–108 (1999)

  11. 11.

    Dixit, K., Jha, M., Raskhodnikova, S., Thakurta, A.: Testing the Lipschitz property over product distributions with applications to data privacy. In: Proceedings of the 10th Theory of Cryptography Conference, TCC, pp. 418–436 (2013)

  12. 12.

    Ergun, F., Kannan, S., Kumar, S.R., Rubinfeld, R., Viswanathan, M.: Spot-checkers. J. Comput. Syst. Sci. 60(3), 717–751 (2000)

  13. 13.

    Fischer, E., Lehman, E., Newman, I., Raskhodnikova, S., Rubinfeld, R., Samorodnitsky, A.: Monotonicity testing over general poset domains. In: Proceedings of the 34th Symposium on Theory of Computing, STOC, pp. 474–483 (2002)

  14. 14.

    Goldreich, O., Goldwasser, S., Lehman, E., Ron, D., Samorodnitsky, A.: Testing monotonicity. Combinatorica 20(3), 301–337 (2000)

  15. 15.

    Goldreich, O., Goldwasser, S., Ron, D.: Property testing and its connection to learning and approximation. J. ACM 45(4), 653–750 (1998)

  16. 16.

    Goldreich, O.: Introduction to testing graph properties. In Studies in Complexity and Cryptography, Lecture Notes in Computer Science 6390, pp. 470–506. Springer, Berlin (2011)

  17. 17.

    Gromov, M.: Metric Structures for Riemannian and non-Riemannian Spaces. Birkhauser, Switzerland (1999)

  18. 18.

    Halevy, S., Kushilevitz, E.: Testing monotonicity over graph products. Random Struct. Algorithm. 33(1), 44–67 (2008)

  19. 19.

    Jutla, C.S., Patthak, A.C., Rudra, A., Zuckerman, D.: Testing low-degree polynomials over prime fields. Random Struct. Algorithm. 35(2), 163–193 (2009)

  20. 20.

    Jha, M., Raskhodnikova, S.: Testing and reconstruction of Lipschitz functions with applications to data privacy. SIAM J. Comput. 42(2), 700–731 (2013)

  21. 21.

    Kaufman, T., Ron, D.: Testing polynomials over general fields. SIAM J. Comput. 36(3), 779–802 (2006)

  22. 22.

    McDiarmid, C.: On the method of bounded differences. Surv. Comb. Lond. Math. Soc. Lecture Note 141, 148–188 (1989)

  23. 23.

    Ollivier, Y.: Ricci curvature of Markov chains on metric spaces. J. Funct. Anal. 256(3), 810–864 (2009)

  24. 24.

    Ron, D.: Algorithmic and analysis techniques in property testing. Found. Trend Theor. Comput. Sci. 5(2), 73–205 (2009)

  25. 25.

    Rubinfeld, R., Sudan, M.: Robust characterization of polynomials with applications to program testing. SIAM J. Comput. 25(2), 252–271 (1996)

  26. 26.

    Rubinfeld, R., Shapira, A.: Sublinear time algorithms. SIAM J. Discret. Math. 25(4), 1562–1588 (2011)

  27. 27.

    Seshadhri, C., Vondrák, J.: Is submodularity testable? Algorithmica 69(1), 1–25 (2014)

Download references

Author information

Correspondence to Pranjal Awasthi or Madhav Jha or Marco Molinaro or Sofya Raskhodnikova.

Additional information

A preliminary version of this paper appeared in RANDOM’12 [2]. P.A. is supported by NSF Grant CCF-1116892. M.J. and S.R. are supported by NSF CAREER Grant CCF-0845701 and NSF Grant CCF-0729171. M.M. is supported by NSF Grant CMMI-1024554.

Appendix: McDiarmid’s Inequality

Appendix: McDiarmid’s Inequality

We state the well-known McDiarmid’s inequality [22] specialized to the domain \([n]^d\).

Theorem 5.6

([22]) For every Lipschitz function \(f:[n]^d \rightarrow \mathbb {R}\) and uniformly distributed \(X \in [n]^d\), the following holds (where the expectation is taken over the uniformly distributed \(X\)): \(\Pr [|f(X) - {\mathbb {E}}[f(X)]| \ge t] \le 2e^{\frac{-2t^2}{dn^2}}\).

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Awasthi, P., Jha, M., Molinaro, M. et al. Testing Lipschitz Functions on Hypergrid Domains. Algorithmica 74, 1055–1081 (2016). https://doi.org/10.1007/s00453-015-9984-y

Download citation


  • Lipschitz functions
  • Property testing
  • Dimension reduction
  • Smoothing operator