{"id":19608954,"url":"https://github.com/davecom/constrained","last_synced_at":"2026-05-12T13:35:20.775Z","repository":{"id":14232561,"uuid":"16939619","full_name":"davecom/constraineD","owner":"davecom","description":"Constraint Satisfaction Problem Solver for Dart","archived":false,"fork":false,"pushed_at":"2014-04-17T06:53:36.000Z","size":208,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T09:53:16.398Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davecom.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}},"created_at":"2014-02-18T06:42:01.000Z","updated_at":"2024-04-16T15:18:40.000Z","dependencies_parsed_at":"2022-09-03T10:22:54.740Z","dependency_job_id":null,"html_url":"https://github.com/davecom/constraineD","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FconstraineD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FconstraineD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FconstraineD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FconstraineD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davecom","download_url":"https://codeload.github.com/davecom/constraineD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240898273,"owners_count":19875151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-11T10:18:43.925Z","updated_at":"2026-05-12T13:35:20.727Z","avatar_url":"https://github.com/davecom.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"constraineD\n===========\n\nConstraint Satisfaction Problem Solver for Dart that uses a basic backtracking algorithm.\nIt has no external dependencies and currently works. It is quite slow due to unimplemented optimizations like MAC3 and LCV.\n\nIt does however support the MRV optimization.\n\n## Constraints\nConstraints are defined with an object hierarchy that begins with the primitive abstract class **Constraint**. All **Constraint** objects must implement one method - *isSatisfied()* - which returns a *bool* indicating whether the constraint has been satisfied by the provided assignment. The abstract subclasses **UnaryConstraint**, **BinaryConstraint**, and **ListConstraint** should typically be subclassed by a program using *constraineD* with an implementation of *isSatisfied()* being the primary definition of a problem.\n\n## CSPs\nA **CSP** is an object that defines a (C)onstraint (S)atisfaction (P)roblem. It holds all of the variables and constraints utilizing those variables that make up a problem. It also holds a domain for each variables through a map called *domains*. \n\n## Solving a CSP\nA **CSP** is solved using a simple backtracking algorithm via the function *backtrackingSearch()*. It takes a **CSP** and a *Map* called *assignment*. Typically *assignment* will just be a blank map when you start up *backtrackingSearch*. *backtrackingSearch* returns a *Future\u003cMap\u003e* that represents a Map of the resulting assignments from successfully solving the **CSP**. If no result could be found this *Future* will hold a *null* value (equivalent of *new Future.value(null)*).\n\n*backtrackingSearch()* has optional placeholders for the MRV, LCV, and MAC3 backtracking search constraint satisfaction problem optimizations that can be turned on via optional boolean parameters. A buggy implemention of MRV is already written, but for now LCV and MAC3 are just true placeholders.\n\n## Examples\nThere are examples of SEND + MORE = MONEY, the Australian Map Coloring Problem, and a couple circuit board layout problems in the *test* directory. There is also an example of using constraineD for creating a non-overlapping wordsearch grid in Chapter 16 of Dart for Absolute Beginners.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavecom%2Fconstrained","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavecom%2Fconstrained","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavecom%2Fconstrained/lists"}