Jus Measuring: Algorithm and Complexity

Min-Zheng Shieh · 2004

We study the water jug problem and obtain new lower and upper bounds on the minimum number of measuring steps. These bounds are tight and significantly improve previous results. We prove that to compute the crucial number μc(x) (i.e., min x=x·c ||x||1, where c ∈ N, x ∈ N, ||x||1 = ∑n i=1 |xi|) for estimating the minimum measuring steps is indeed a problem in P . Moreover, we prove that testing whether μc(x) is bounded by a fixed number is indeed NP-complete and thus the optimal jug measuring problem is NP-hard, which was also proved independently by [6]. Finally, we give a pseudo-polynomial time algorithm for computing μc(x) and a polynomial time algorithm, which is based on LLL basis reduction algorithm, for approximating the minimum number of jug measuring steps efficiently.

Read the paper · More papers on PaperTik