{"id":17311144,"url":"https://github.com/paulk-asert/groovy-constraint-programming","last_synced_at":"2026-03-06T07:02:08.092Z","repository":{"id":56546685,"uuid":"189792750","full_name":"paulk-asert/groovy-constraint-programming","owner":"paulk-asert","description":"Three common programming paradigms or styles are the imperative (OO \u0026 procedural), functional, and logic (or constraint) styles. This repo shows examples of the latter using the Apache Groovy programming language and other (mostly JVM) languages which support this style of programming (often using libraries).","archived":false,"fork":false,"pushed_at":"2024-12-10T08:23:34.000Z","size":28772,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-13T05:39:32.274Z","etag":null,"topics":["constraint-programming","groovy","jvm-languages","linear-programming","programming-language"],"latest_commit_sha":null,"homepage":"https://speakerdeck.com/paulk/groovy-constraint-programming","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulk-asert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-02T01:26:35.000Z","updated_at":"2024-12-10T08:23:39.000Z","dependencies_parsed_at":"2024-03-13T22:47:50.203Z","dependency_job_id":"182122d3-1698-40ee-8d5f-cb495f74918d","html_url":"https://github.com/paulk-asert/groovy-constraint-programming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paulk-asert/groovy-constraint-programming","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulk-asert%2Fgroovy-constraint-programming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulk-asert%2Fgroovy-constraint-programming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulk-asert%2Fgroovy-constraint-programming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulk-asert%2Fgroovy-constraint-programming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulk-asert","download_url":"https://codeload.github.com/paulk-asert/groovy-constraint-programming/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulk-asert%2Fgroovy-constraint-programming/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constraint-programming","groovy","jvm-languages","linear-programming","programming-language"],"created_at":"2024-10-15T12:39:37.134Z","updated_at":"2026-03-06T07:02:08.060Z","avatar_url":"https://github.com/paulk-asert.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Groovy Constraint Programming\n\nThis repo contains examples from an Introduction to Constraint Programming talk:\n\nhttps://speakerdeck.com/paulk/groovy-constraint-programming\n\nYou have 4 options to run the examples:\n\n* [running locally](docs/RunningLocal.md) on the command-line or in an IDE\n* [running via gitpod](docs/RunningGitpod.md)\n* [running as a Jupyter/BeakerX](docs/RunningBeakerX.md) notebook\n* [running in the Groovy Console or Groovy Web Console](docs/RunningConsole.md)\n\n---\n\nThe [Pythagorean subproject](subprojects/Pythagorean/)\nis an introductory example comparing an imperative style solution (using a brute-force approach), and\na constraint-programming solution (using Choco[1]).\n\n![Pythagorean](docs/images/Pythagorean.png)\n\nRun Choco solution via Jupyter/BeakerX:\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/paulk-asert/groovy-constraint-programming/master?filepath=subprojects%2FPythagorean%2Fsrc%2Fmain%2Fnotebook%2FPythagorean.ipynb)\n\nCommand-line arguments for Gradle to run the script:\n`:Pythagorean:run`\n\n---\n\nThe [McNuggets subproject](subprojects/McNuggets/)\nillustrates solving a fairly simple Frobenius numbers puzzle\nusing Choco[1] and Ojalgo[2].\n\n![McNuggets](docs/images/McNuggets.png)\n\nCommand-line arguments for Gradle to see the task names for the available solutions:\n```\n:McNuggets:tasks --group=\"Application\"\n```\nThen pick one of those tasks to run, e.g. to run the Ojalgo solution:\n```\n:McNuggets:runOjalgo\n```\n\n---\n\n## Cryptarithmetic puzzles\n\nThis example solves a classic cryptarithmetic puzzle using constraint programming.\nThe Groovy solution is contrasted with brute-force approaches and solutions in other JVM languages.\n\n![Constraint programming](docs/images/cp_screenshot.png)\n\nSee the [SendMoreMoney subproject](subprojects/SendMoreMoney/) for all the details.\n\nConstraint-programming libraries covered:\n[Choco][]\n\nProgramming languages covered:\n[Clojure][],\n[Groovy][],\n[Frege][],\n[Java][],\n[Nashorn][],\n[JRuby][],\n[Jython][],\n[Kotlin][],\n[Luaj][],\n[Scala][],\n[tuprolog][].\n\n---\n\n## Diet optimization\n\nThis example solves an optimization/linear programming problem.\nNumerous technologies and approaches are used to solve the problem.\n\n![Linear programming](docs/images/lp_screenshot.png)\n\nSee the [Diet subproject](subprojects/Diet/) for all the details.\n\nTechnologies illustrated:\n[Apache Commons Math][],\n[Hipparchus][],\n[Choco][] (with and without ibex integration),\n[JaCoP][] (using scalar-product/weighted-sum and knapsack algorithms),\n[Ojalgo][],\n[OptaPlanner][],\n[OrTools][],\n[SAS/OR][].\n\n---\n\n## Genetic algorithms\n\nThis example uses genetic algorithms to explore the\n[infinite monkey theorem](https://en.wikipedia.org/wiki/Infinite_monkey_theorem).\n\n![Chimpanzee at keyboard](docs/images/Chimpanzee.png)\n\nSee the [Monkeys subproject](subprojects/Monkeys/) for all the details.\n\nTechnologies illustrated:\n[Apache Commons Math][],\n[Jenetics][].\n\n---\n\n## Technology summary\n\nLibraries used:\n\n[Choco][],\n[Hipparchus][],\n[Apache Commons Math][],\n[JaCoP][],\n[OptaPlanner][],\n[OrTools][],\n[Jenetics][],\n[SAS/OR][] (commercial product).\n\n[Apache Commons Math]: https://commons.apache.org/proper/commons-math/\n[Hipparchus]: https://hipparchus.org/\n[Choco]: http://www.choco-solver.org/\n[Ojalgo]: https://www.ojalgo.org/\n[JaCoP]: https://github.com/radsz/jacop\n[OptaPlanner]: https://www.optaplanner.org/\n[OrTools]: https://developers.google.com/optimization \"Google OR Tools\"\n[SAS/OR]: https://www.sas.com/en_us/software/or.html\n[Jenetics]: https://jenetics.io/\n\n[Clojure]: https://clojure.org/\n[Groovy]: https://groovy-lang.org/\n[Frege]: https://github.com/Frege/frege \"JVM Haskell\"\n[Java]: https://www.java.com/\n[Nashorn]: https://docs.oracle.com/javase/10/nashorn/ \"JavaScript for JVM up to JDK\"\n[JRuby]: https://www.jruby.org/ \"Ruby for the JVM\"\n[Jython]: https://www.jython.org/ \"Python for the JVM\"\n[Kotlin]: https://kotlinlang.org/\n[Luaj]: https://github.com/luaj/luaj \"LUA for the JVM\"\n[Scala]: https://www.scala-lang.org/\n[tuprolog]: http://apice.unibo.it/xwiki/bin/view/Tuprolog/ \"A prolog for the JVM\"\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulk-asert%2Fgroovy-constraint-programming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulk-asert%2Fgroovy-constraint-programming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulk-asert%2Fgroovy-constraint-programming/lists"}