{"id":13769814,"url":"https://github.com/juliendelplanque/StableMarriage","last_synced_at":"2025-05-11T02:33:38.634Z","repository":{"id":83914638,"uuid":"95919457","full_name":"juliendelplanque/StableMarriage","owner":"juliendelplanque","description":"A solver for the stable marriage problem written in Pharo.","archived":false,"fork":false,"pushed_at":"2018-01-02T19:05:16.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T17:31:07.811Z","etag":null,"topics":["pharo","smalltalk","stable-marriage-problem"],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","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/juliendelplanque.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}},"created_at":"2017-06-30T19:53:31.000Z","updated_at":"2018-10-11T14:56:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2a0499c-8cda-4bf7-b8b4-f7ed49f8aea9","html_url":"https://github.com/juliendelplanque/StableMarriage","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/juliendelplanque%2FStableMarriage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FStableMarriage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FStableMarriage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FStableMarriage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliendelplanque","download_url":"https://codeload.github.com/juliendelplanque/StableMarriage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213832282,"owners_count":15644975,"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":["pharo","smalltalk","stable-marriage-problem"],"created_at":"2024-08-03T17:00:31.785Z","updated_at":"2024-08-03T17:02:34.995Z","avatar_url":"https://github.com/juliendelplanque.png","language":"Smalltalk","funding_links":[],"categories":["Algorithms"],"sub_categories":[],"readme":"# StableMarriage\nA solver for the [stable marriage](https://en.wikipedia.org/wiki/Stable_marriage_problem#Algorithm) problem written in Pharo.\n\n## Install\nIn a fresh Pharo image, execute the following code snippet in a Playground.\n```\nMetacello new\n    baseline: 'StableMarriage';\n    repository: 'github://juliendelplanque/StableMarriage/repository';\n    load\n```\n\n## Example\nIn the stable marriage problem, you have two list of `n` element: a list of men and a list of women. Each person rank people of the other gender according to its preferences. The stable marriage algorithm find the best matches between men and women according to all rankings.\n\nIn this implementation a man or a woman is represented as a `SMContender` object. The `#data` instance variable (and its accessor/mutator) of a `SMContender` allows to wrap the real objects to match.\n\nFor `3` men and `3` women with a list of preferences for each contender, the implementation would be the following:\n\n```\n\"We define men.\"\nm1 := SMContender data: 'John'.\nm2 := SMContender data: 'Fred'.\nm3 := SMContender data: 'Alexander'.\n\"We define women.\"\nw1 := SMContender data: 'Elia'.\nw2 := SMContender data: 'Mary'.\nw3 := SMContender data: 'Judith'.\n\"Now, let's define men's preferences\"\nm1 preferences: {w1.w2.w3}.\nm2 preferences: {w2.w1.w3}.\nm3 preferences: {w3.w2.w1}.\n\"Same for women\"\nw1 preferences: {m1.m3.m2}.\nw2 preferences: {m3.m1.m2}.\nw3 preferences: {m1.m2.m3}.\n\"Lets find the best set of marriages for those people.\"\nSMSolver new\n\t\tmen: {m1.m2.m3};\n\t\twomen: {w1.w2.w3};\n\t\tsolve.\n\"a Set(\n  a SMMarriage(a SMContender('John'),a SMContender('Elia'))\n  a SMMarriage(a SMContender('Fred'), a SMContender('Mary'))\n  a SMMarriage(a SMContender('Alexander'),a SMContender('Judith'))\n)\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2FStableMarriage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliendelplanque%2FStableMarriage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2FStableMarriage/lists"}