{"id":22784488,"url":"https://github.com/anushadatta/royalmatch","last_synced_at":"2025-08-27T04:16:25.001Z","repository":{"id":130892646,"uuid":"299929208","full_name":"anushadatta/RoyalMatch","owner":"anushadatta","description":"👑 Implementing Gale-Shapley algorithm with Flask \u0026 Heroku.","archived":false,"fork":false,"pushed_at":"2020-10-12T14:53:41.000Z","size":427,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T17:54:23.219Z","etag":null,"topics":["flask","gale-shapley-algorithm","heroku","stable-matching-problem"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anushadatta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-09-30T13:32:05.000Z","updated_at":"2024-08-16T06:40:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0e176f6-fade-4eb4-8bf3-3c62c8e094f4","html_url":"https://github.com/anushadatta/RoyalMatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anushadatta/RoyalMatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anushadatta%2FRoyalMatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anushadatta%2FRoyalMatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anushadatta%2FRoyalMatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anushadatta%2FRoyalMatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anushadatta","download_url":"https://codeload.github.com/anushadatta/RoyalMatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anushadatta%2FRoyalMatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272289702,"owners_count":24907801,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["flask","gale-shapley-algorithm","heroku","stable-matching-problem"],"created_at":"2024-12-11T22:24:13.658Z","updated_at":"2025-08-27T04:16:24.983Z","avatar_url":"https://github.com/anushadatta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RoyalMatch\n\u003eImplementing Nobel Prize winning Gale-Shapley algorithm with Flask \u0026amp; Heroku \\\n\u003eReference: The Creativity Code, Marcus Du Sautoy\n\n\nIn mathematics, economics, and computer science, the Gale–Shapley algorithm (also known as the deferred acceptance algorithm) is an algorithm for finding a solution to the stable matching problem. The stable marriage problem (also stable matching problem or SMP) is the problem of finding a stable matching between two equally sized sets of elements given an ordering of preferences for each element. A matching is a bijection from the elements of one set to the elements of the other set. A matching is not stable if:\n\n1. There is an element A of the first matched set which prefers some given element B of the second matched set over the element to which A is already matched, and\n2. B also prefers A over the element to which B is already matched.\n\nIn other words, a matching is stable when there does not exist any match (A, B) which both prefer each other to their current partner under the matching.\n\n\u003cb\u003e Applications \u003c/b\u003e\n\nThis algorithm finds application for a variety of real world scenarios, such as:\n* Match children to day-cares, in Denmark\n* Allocate rabbis to synagogues, in New York\n* Match students to universities, in China, Germany and Spain\n* Match patients to organ donations, in UK (National Health Service)\n\n## About \n\n\u003cimg src=\"client/assets/Header.png\"\u003e\n\nThis implementation of the Gale–Shapley algorithm aims to find stable matching for the following 4 Kings and 4 Queens given their preferences. The algorithm may be scaled to N pairs of people by simply reassigning the parameter.\n\n### INSTRUCTIONS\n* To specify preferences for each King and Queen use the given drop down menu.\n* Ensure that each King or Queen has 4 unique preferences [♣, ♦, ♥, ♠], which may be listed in any order of preference.\n* Please note that the algorithm will not work if the preferences for each Royal are not unique.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"client/assets/RoyalMatch.png\" width=\"550\"\u003e\u003c/p\u003e\n\n### RESULTS\n* \u003cb\u003e Stable Matching: \u003c/b\u003e The stable matching result for the given preferences is computed and displayed. There may or may not be alternate optimal solutions.\n* \u003cb\u003e Calculation Logs: \u003c/b\u003e The verbose calculations for the optimal result produced are also displayed for reference. \n\n\u003cp align=\"center\"\u003e\u003cimg src=\"client/assets/Results.png\" width=\"550\"\u003e\u003c/p\u003e\n\n## SET UP: Local Deployment\nTo set up and deploy the application locally, follow the steps below: \n\n* Set up local virtual environment \n```bash\n~$ virtualenv env\n```\n* Activate virtual environment\n```bash\n~$ source env/bin/activate \n```\n* Install dependencies\n```bash\n~$ pip install -r requirements.txt\n```\n* Run server on localhost:5000\n```bash\n~$ python server/app.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanushadatta%2Froyalmatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanushadatta%2Froyalmatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanushadatta%2Froyalmatch/lists"}