Skip to main content

Space-Time Tradeoffs for the Regular Constraint

  • Conference paper
Principles and Practice of Constraint Programming (CP 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7514))

Abstract

Many global constraints can be described by a regular expression or a DFA. Originally, the regular constraint, uses a DFA to describe the constraint, however, it can also be used to express a table constraint. Thus, there are many representations for an equivalent constraint. In this paper, we investigate the effect of different representations on natural extensions of the regular constraint focusing on the space-time tradeoffs. We propose a variant of the regular constraint, nfac(X), where X can be an NFA, DFA or MDD. Our nfac algorithm enforces GAC directly on any of the input representations, thus, generalizing the mddc algorithm. We also give an algorithm to directly convert an NFA representation to an MDD for nfac(MDD) or mddc. Our experiments show that the NFA representation not only saves space but also time. When the ratio of the NFA over the MDD or DFA size is small enough, nfac(NFA) is faster. When the size ratio is larger, nfac(NFA) still saves space and is a bit slower. In some problems, the initialization cost of MDD or DFA can also be a significant overhead, unlike NFA which has low initialization cost. We also show that the effect of the early-cutoff optimization is significant in all the representations.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Pesant, G.: A Regular Language Membership Constraint for Finite Sequences of Variables. In: Wallace, M. (ed.) CP 2004. LNCS, vol. 3258, pp. 482–495. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  2. Cheng, K.C.K., Yap, R.H.C.: An mdd-based generalized arc consistency algorithm for positive and negative table constraints and some global constraints. Constraints 15, 265–304 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  3. Lecoutre, C.: Str2: optimized simple tabular reduction for table constraints. Constraints 16, 341–371 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  4. Lecoutre, C., Likitvivatanavong, C., Yap, R.H.C.: A path-optimal gac algorithm for table constraints. In: ECAI (2012)

    Google Scholar 

  5. Lagerkvist, M.Z.: Techniques for Efficient Constraint Propagation. Ph.D. thesis, Royal Institute of Technology (2008)

    Google Scholar 

  6. Quimper, C.-G., Walsh, T.: Global Grammar Constraints. In: Benhamou, F. (ed.) CP 2006. LNCS, vol. 4204, pp. 751–755. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  7. Sellmann, M.: The Theory of Grammar Constraints. In: Benhamou, F. (ed.) CP 2006. LNCS, vol. 4204, pp. 530–544. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  8. Katsirelos, G., Narodytska, N., Walsh, T.: Reformulating Global Grammar Constraints. In: van Hoeve, W.-J., Hooker, J.N. (eds.) CPAIOR 2009. LNCS, vol. 5547, pp. 132–147. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  9. Srinivasan, A., Kam, T., Malik, S., Brayton, R.: Algorithms for discrete function manipulation. In: Computer Aided Design, pp. 92–95 (1990)

    Google Scholar 

  10. Cheng, K.C.K., Yap, R.H.C.: Maintaining generalized arc consistency on ad-hoc n-ary boolean constraints. In: ECAI, pp. 78–82 (2006)

    Google Scholar 

  11. Carlsson, M.: Filtering for the case constraint. Talk given at Advanced School on Global Constraints (2006)

    Google Scholar 

  12. Mackworth, A.K.: On reading sketch maps. In: IJCAI, pp. 598–606 (1977)

    Google Scholar 

  13. Bryant, R.E.: Graph-based algorithms for Boolean function manipulation. IEEE Trans. on Comp. 35(8), 667–691 (1986)

    Google Scholar 

  14. Thompson, K.: Regular expression search algorithm. Comm. of the ACM 11(6), 419–422 (1968)

    Article  MATH  Google Scholar 

  15. Blum, N., Koch, R.: Greibach normal form transformation, revisited. Information and Computation 150, 47–54 (1997)

    Google Scholar 

  16. Leslie, T.: Efficient approaches to subset construction. Master’s thesis, University of Waterloo (1995)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cheng, K.C.K., Xia, W., Yap, R.H.C. (2012). Space-Time Tradeoffs for the Regular Constraint. In: Milano, M. (eds) Principles and Practice of Constraint Programming. CP 2012. Lecture Notes in Computer Science, vol 7514. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33558-7_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-33558-7_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-33557-0

  • Online ISBN: 978-3-642-33558-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics