Skip to main content
Log in

firstCS—New Aspects on Combining Constraint Programming with Object-Orientation in Java

  • Projekt
  • Published:
KI - Künstliche Intelligenz Aims and scope Submit manuscript

Abstract

The aim of the presented constraint programming library firstCS is the integration of the constraint programming paradigm in the object-oriented programming language Java. This open-box library provides its users with the necessary concepts to model and solve constraint satisfaction problems and even constraint optimization problems over finite integer domains. The application focus of firstCS is constraint-based scheduling and resource allocations (e.g. Sandow in INFORMATIK 2011, LNI, vol. P-192, p. 248, 2011), however, it offers all primitives to realize new constraints and according propagation algorithms as well as problem-specific tree search heuristics to find good or even best solutions. Beyond related work and an overview over the general architecture of the system and the supported constraints, this presentation focuses on new aspects of the current version of firstCS, i.e. redundancy checking and the assembling of new search strategies from existing ones using the implementation language Java. The presentation is completed by code fragments showing interesting implementation details.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

Notes

  1. Cf. constraint programming libraries for imperative programming languages at http://en.wikipedia.org/wiki/Constraint_programming.

  2. Called iterated propagation in constraint programming.

  3. See http://www.cosytec.com/production_scheduling/chip/optimization_product_chip.htm.

  4. See http://eclipseclp.org/.

  5. See http://www.sics.se/isl/sicstuswww/site/index.html.

  6. See http://www.emn.fr/z-info/choco-solver/.

  7. See http://jacop.osolpro.com/.

  8. See http://jcp.org/en/jsr/detail?id=331.

  9. This is only recommended for a small number of variables and values.

  10. See http://www.sics.se/sicstus.html.

  11. Good/best with respect to an objective function.

References

  1. Apt KR (2003) Principles of constraint programming. Cambridge University Press, Cambridge

    Book  MATH  Google Scholar 

  2. Baptiste P, le Pape C, Nuijten W (2001) In: Constraint-based scheduling: applying constraint programming to scheduling problems. International series in operations research & management science, Kluwer Academic, Dordrecht, vol 39

    Google Scholar 

  3. Hoche M, Müller H, Schlenker H, Wolf A (2003) firstCS—a pure java constraint programming engine. In: Hanus M, Hofstedt P, Wolf A (eds) 2nd international workshop on multiparadigm constraint programming languages (MultiCPL’03), 29th September

    Google Scholar 

  4. Hofstedt P, Wolf A (2007) Einführung in die Constraint-Programmierung. eXamen.press. Springer, Berlin. ISBN 978-3-540-23184-4

    Google Scholar 

  5. Holzbaur C (1990) Specification of constraint based inference mechanism through extended Unification. PhD thesis, Dept. of Medical Cybernetics & AI, University of Vienna

  6. Kuhnert S (2009) Efficient edge-finding on unary resources with optional activities (revised and extended version). In: Seipel D, Hanus M, Wolf A (eds) Declarative programming and knowledge management—17th international conference on applications of declarative programming and knowledge management (INAP 2007) and 21st workshop on (constraint) logic programming (WLP 2007). Lecture notes in artificial intelligence, vol 5437. Springer, Berlin, pp 38–53

    Google Scholar 

  7. López-Ortiz A, Quimper C-G, Tromp J, van Beek P (2003) A fast and simple algorithm for bounds consistency of the all different constraint. In: Gottlob G, Walsh T (eds) IJCAI-03, Proceedings of the eighteenth international joint conference on artificial intelligence, Acapulco, Mexico, August 9–15, 2003. San Mateo, Morgan Kaufmann, pp 245–250

    Google Scholar 

  8. Marriott K, Stuckey PJ (1998) Programming with constraints: an introduction. MIT Press, Cambridge

    MATH  Google Scholar 

  9. Régin J-C (1994) A filtering algorithm for constraints of difference in CSPs. In: Proceedings of the national conference on artificial intelligence, pp 362–367

    Google Scholar 

  10. Rossi F, van Beek P, Walsh T (eds) (2006) Handbook of constraint programming. Amsterdam, Elsevier

    MATH  Google Scholar 

  11. Sandow S (2011) Ressourcenplanung unter Nutzung der Java-Constraint-Bibliothek firstCS. In: INFORMATIK 2011: Informatik schafft Communities, Lecture notes in informatics (LNI)—proceedings series of the Gesellschaft für Informatik (GI), vol P-192, p 248, Gesellschaft für Informatik e.V.

  12. Schutt A, Wolf A (2010) A new \(\mathcal{O}(n^{2} \log n)\) not-first/not-last pruning algorithm for cumulative resource constraints. In: Cohen D (ed) Proceedings principles and practice of constraint programming (CP 2010), 16th international conference, St. Andrews, Scotland, UK, September 6–10, 2010. Lecture notes in computer science, vol 6308. Springer, Berlin, pp 445–459

    Chapter  Google Scholar 

  13. Schutt A, Wolf A, Schrader G (2006) Not-first and not-last detection for cumulative scheduling in \(\mathcal{ O}(n^{3}\log n)\). In: Declarative programming for knowledge management—16th international conference on applications of declarative programming and knowledge management (INAP 2005), Fukuoka, Japan, October 22–24, 2005. Revised Selected Papers. Lecture notes in artificial intelligence, vol 4369. Springer, Berlin

    Google Scholar 

  14. Vilím P (2004) O(nlogn) filtering algorithms for unary resource constraint. In: Régin J-C, Rueher M (eds) Proceedings integration of AI and OR techniques in constraint programming for combinatorial optimization problems, first international conference (CPAIOR 2004). Lecture notes in computer science, Nice, France, April 20–22 2004, vol 3011. Springer, Berlin, pp 335–347

    Chapter  Google Scholar 

  15. Vilím P (2009) Edge finding filtering algorithm for discrete cumulative resources in \(\mathcal{O}(kn \log n)\). In: Gent IP (ed) Proceedings principles and practice of constraint programming (CP 2009), 15th international conference, Lisbon, Portugal, September 20–24, 2009. Lecture notes in computer science, vol 5732. Springer, Berlin, pp 802–816

    Chapter  Google Scholar 

  16. Wolf A (2003) Pruning while sweeping over task intervals. In: Rossi F (ed) Principles and practice of constraint programming (CP 2003), 9th international conference. Lecture notes in computer science, vol 2833. Springer, Berlin, pp 739–753

    Chapter  Google Scholar 

  17. Wolf A (2006) Object-oriented constraint programming in Java using the library firstCS. In: Fink M, Tompits H, Woltran S (eds) 20th Workshop on logic programming, Vienna, Austria, February 22–24, 2006. INFSYS research report, vol 1843-06-02. Technische Universität, Wien, pp 21–32

    Google Scholar 

  18. Wolf A, Schlenker H (2005) Realizing the alternative resources constraint. In: Seipel D, Hanus M, Geske U, Bartenstein O (eds) 15th international conference on applications of declarative programming and knowledge management (INAP 2004), and the 18th workshop on logic programming (WLP 2004), Potsdam, Germany, March 4–6, 2004, Revised selected papers. Lecture notes in artificial intelligence, vol 3392. Springer, Berlin, pp 185–199

    Google Scholar 

  19. Wolf A, Schrader G (2006) \(\mathcal{O}(n \log n)\) overload checking for the cumulative constraint and its application. In: Declarative programming for knowledge management—16th international conference on applications of declarative programming and knowledge management (INAP 2005), Fukuoka, Japan, October 22–24, 2005. Revised selected papers. Lecture notes in artificial intelligence, vol 4369. Springer, Berlin

    Google Scholar 

Download references

Acknowledgements

I like to thank everybody who contributed to the development of firstCS, namely the “core” developers (in alphabetic order): Matthias Hoche, Sebastian Kuhnert, Henry Müller, Hans Schlenker, Gunnar Schrader, Andreas Schutt and Walter Weininger. I further like to thank all firstCS users that helped to improve the system with their valuable feedback.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Armin Wolf.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Wolf, A. firstCS—New Aspects on Combining Constraint Programming with Object-Orientation in Java . Künstl Intell 26, 55–60 (2012). https://doi.org/10.1007/s13218-011-0161-4

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s13218-011-0161-4

Keywords

Navigation