{"id":16115184,"url":"https://github.com/bwc9876/coop-schedule","last_synced_at":"2026-04-13T18:02:09.385Z","repository":{"id":59682861,"uuid":"538192489","full_name":"Bwc9876/Coop-Schedule","owner":"Bwc9876","description":"An application that can be used for scheduling students","archived":false,"fork":false,"pushed_at":"2025-10-23T15:58:37.000Z","size":25399,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T17:43:17.035Z","etag":null,"topics":["csharp","dotnet","winforms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":false,"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/Bwc9876.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}},"created_at":"2022-09-18T17:50:30.000Z","updated_at":"2025-10-23T15:58:41.000Z","dependencies_parsed_at":"2023-01-20T07:33:48.880Z","dependency_job_id":null,"html_url":"https://github.com/Bwc9876/Coop-Schedule","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bwc9876/Coop-Schedule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bwc9876%2FCoop-Schedule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bwc9876%2FCoop-Schedule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bwc9876%2FCoop-Schedule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bwc9876%2FCoop-Schedule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bwc9876","download_url":"https://codeload.github.com/Bwc9876/Coop-Schedule/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bwc9876%2FCoop-Schedule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31764317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: 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":["csharp","dotnet","winforms"],"created_at":"2024-10-09T20:17:55.247Z","updated_at":"2026-04-13T18:02:09.367Z","avatar_url":"https://github.com/Bwc9876.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Co-op Scheduler\nAn application that can be used to schedule students into units.\n\n## Problem Statement\n\nEach student needs to be scheduled into a unit for a specific number of days.\n\nOnce a student is put in a unit for one day, they cannot be placed in that unit again.\n\nA unit can only take a certain number of students per-day.\n\n## Solution\n\nThis problem can be solved using wave function collapse, a procedural generation algorithm that abides by specific constraints.\n\nLet's imagine the schedule as a table, where each element represents the possible units a student can be in.\n\n|               | **Day 1** | **Day 2** |\n|---------------|-----------|-----------|\n| **Student 1** | UNIT      | UNIT      |\n| **Student 2** | UNIT      | UNIT      |\n\nLet's also imagine that we have 2 units, A and B. Each of these can only have one student.\n\nTo represent the possible state of an element we use a boolean array, where each index corresponds to a unit and each value determines whether that unit is a valid state for the element.\n\nSo if an element can be any unit, it would be [True, True]  \nIf it can't be any (contradictory state), it would be [False, False]  \nIf it can only be A, then it would be [True, False]  \nAnd if it was B it would be [False, True]  \n\nThese boolean arrays will be represented as binary numbers, each boolean corresponds to the bit in the number.\n\nSo if an element can be any unit it would be 3 (because 11₂ = 3)  \nIf it can't be any is would be 0 (because 00₂ = 0)  \nIf it can only be A, then it would be 2 (because 10₂ = 2)  \nAnd if it was B it would be 1 (because 01₂ = 1)  \n\nWe represent the elements like this because we can utilize bitwise operations to save on time.  \n\n\nWe first setup the table in a completely unobserved state, that is, every element can be any unit:\n\n|               | **Day 1** | **Day 2** |\n|---------------|-----------|-----------|\n| **Student 1** | 3         | 3         |\n| **Student 2** | 3         | 3         |\n\nNext we need to choose which element we want to observe first, we do this by calculating the [shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) of each element and taking the lowest non-zero one. If they're all the same, we just grab whichever we find first.  \n\nCollapsing an element means picking one of the states it can be and forcing it to only be that state.\n\nSo lets say we picked the element (0, 0) to observe, we see that it can be either A or B, so we randomly pick which one we want it to be.  \n\nLets say we choose B, now our table will look something like this:\n\n|               | **Day 1** | **Day 2** |\n|---------------|-----------|-----------|\n| **Student 1** | 1         | 3         |\n| **Student 2** | 3         | 3         |\n\nBut wait! now that (0, 0) is B, we know that (1, 0) and (0, 1) both can't be B!\n\nThis is where the constrain stage comes in, once we observe an element we look in the row and column of that element and restrict the elements in that row and column accordingly.  \n\nSo for (1, 0) we know that a unit can only appear in a row once, so we'll limit the element to 10₂ (2).  \n\nFor (0, 1) we know that unit B only allows for one student per-day, therefore we should limit to 10₂ as well.\n\nNow because we have such a small table and only two units, these can only be A, however in larger datasets these won't always be constrained to a single state.\n\nSo now we have the following table:\n\n|               | **Day 1** | **Day 2** |\n|---------------|-----------|-----------|\n| **Student 1** | 1         | 2         |\n| **Student 2** | 2         | 3         |\n\nThe next element that has the lowest non-zero shannon entropy is (1, 1), this can only be one value, B.\n\n\n|               | **Day 1** | **Day 2** |\n|---------------|-----------|-----------|\n| **Student 1** | 1         | 2         |\n| **Student 2** | 2         | 1         |\n\nWe've successfully observed all elements of the table!  \n\nOne last thing, we need to be able to remember what units a student for subsequent generations, this is simply achieved by constraining the elements before collapsing any.\n\nDoing this, however, can result in a student not being able to be in any unit. This is called a contradictory state.\n\nOverall, this algorithm is pretty fast and doesn't conflict often. I think more scheduling programs could benefit from using WFC.\n\n## Screenshots\n\n![Main App](https://user-images.githubusercontent.com/25644444/190924859-c55535fc-5d1b-4f08-9e1b-620b4060b335.png)\n\n## Works Cited\n\nGumin, M. (2016). Wave Function Collapse Algorithm (Version 1.0) [Computer software]. https://github.com/mxgmn/WaveFunctionCollapse  \nWave function collapse. (2022, September 8). In Wikipedia. https://en.wikipedia.org/wiki/Wave_function_collapse  \nEntropy (information theory). (2022, September 8). In Wikipedia. https://en.wikipedia.org/wiki/Entropy_(information_theory)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwc9876%2Fcoop-schedule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwc9876%2Fcoop-schedule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwc9876%2Fcoop-schedule/lists"}