{"id":16603950,"url":"https://github.com/dvorka/shifts-solver","last_synced_at":"2025-03-21T13:32:56.156Z","repository":{"id":51538291,"uuid":"42566124","full_name":"dvorka/shifts-solver","owner":"dvorka","description":"Finds a solution to fitting employees with preferences in a schedule for shifts-based operation (GWT, Google AppEngine).","archived":false,"fork":false,"pushed_at":"2018-08-30T12:53:23.000Z","size":29998,"stargazers_count":32,"open_issues_count":9,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T01:51:38.710Z","etag":null,"topics":["employee-management","google-appengine","gwt","optimization","planning","schedule","solver"],"latest_commit_sha":null,"homepage":"","language":"Java","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/dvorka.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":"2015-09-16T05:15:12.000Z","updated_at":"2024-08-30T14:35:35.000Z","dependencies_parsed_at":"2022-08-19T19:10:54.088Z","dependency_job_id":null,"html_url":"https://github.com/dvorka/shifts-solver","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/dvorka%2Fshifts-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvorka%2Fshifts-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvorka%2Fshifts-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvorka%2Fshifts-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvorka","download_url":"https://codeload.github.com/dvorka/shifts-solver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806193,"owners_count":20513399,"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":["employee-management","google-appengine","gwt","optimization","planning","schedule","solver"],"created_at":"2024-10-12T00:54:07.157Z","updated_at":"2025-03-21T13:32:54.103Z","avatar_url":"https://github.com/dvorka.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shifts Solver\nFinds a solution to fitting employees with preferences in a schedule for\nshifts-based operation using *heuristical backtracking*.\n\n**Shifts Solver** is a [Google AppEngine](https://cloud.google.com/appengine) application. To try **Shifts Solver** install AppEngine SDK and/or an AppEngine IDE which allows you to run **Shifts Solver** localy or to upload it to Google infrastructure (you may use *free* AppEngine tier to run it).\nI implemented **Shift Solver** using [Eclipse IDE for Java](https://cloud.google.com/eclipse/docs/) with AppEngine plug-in. Simply follow [how-tos](https://cloud.google.com/eclipse/docs/) to set up the development environment and then use Eclipse [project](./.project) that can be found in my Git repository to import **Shifts Solver** project to Eclipse. \nAlternatively you may use [your favorite tool/IDE](https://cloud.google.com/tools/docs/) to build and deploy the project.\n\n\n# Overview\nHome:\n\n\u003ckbd\u003e[![Home](http://me.mindforger.com/project/s2/s2home.png \"Home\")](http://mindforger.com/project/s2/s2home.png)\u003c/kbd\u003e\n\nEmployees management:\n\n\u003ckbd\u003e[![Employees Management](http://me.mindforger.com/project/s2/s2employees.png \"Employees Management\")](http://mindforger.com/project/s2/s2employees.png)\u003c/kbd\u003e\n\nMonth preferences management:\n\n\u003ckbd\u003e[![Month Preferences Management](http://me.mindforger.com/project/s2/s2preferences.png \"Month Preferences Management\")](http://mindforger.com/project/s2/s2preferences.png)\u003c/kbd\u003e\n\nSolution management:\n\n\u003ckbd\u003e[![Solution Management](http://me.mindforger.com/project/s2/s2solution.png \"Solution Management\")](http://mindforger.com/project/s2/s2solution.png)\u003c/kbd\u003e\n\n\u003ckbd\u003e[![Solution Dlouhan Management](http://me.mindforger.com/project/s2/s2dlouhan.png \"Solution Management\")](http://mindforger.com/project/s2/s2dlouhan.png)\u003c/kbd\u003e\n\n\u003ckbd\u003e[![Solution Employees Management](http://me.mindforger.com/project/s2/s2allocation.png \"Solution Management\")](http://mindforger.com/project/s2/s2allocation.png)\u003c/kbd\u003e\n\n\u003ckbd\u003e[![Solution Edit Management](http://me.mindforger.com/project/s2/s2solutionEdit.png \"Solution Management\")](http://mindforger.com/project/s2/s2solutionEdit.png)\u003c/kbd\u003e\n\n\n\n## Functional Specification\nEmployee roles:\n   * editor\n   * staffer\n   * morning sportak\n   * sportak\n\nEmployee jobs:\n   * fulltime\n   * part time\n\nShift types:\n   * workdays\n      * morning shift\n         * 1x editor\n         * 1x 6AM staffer\n         * 1x 7AM staffer\n         * 1x 8AM staffer\n         * 1x sportak (can be morning sportak)\n      * afternoon shift\n         * 1x editor\n         * 4x staffer\n         * 1x sportak\n      * night shift\n         * 1x staffer (*MUST:* staffer, editor, morning sportak i.e. not sportak)\n   * weekend\n      * morning shift\n         * 1x editor (*MUST:* same as Friday afternoon)\n         * 1x 6AM staffer\n         * 1x sportak\n      * afternoon shift\n         * 1x editor (*MUST:* same as morning)\n         * 1x staffer\n         * 1x sportak\n      * night shift\n         * 1x staffer (*MUST:* staffer, editor, morning sportak i.e. not sportak)\n\nSchedule:\n   * For one month\n   * Dependencies to previous month schedule (e.g. editor Friday to Sunday continuity)\n\nEmployee preferences:\n   * preference type:\n      * YES: I want this shift/day\n      * NO: I cannot make this shift/day\n      * WHATEVER: I don't care\n   * preference target:\n      * (whole) day\n      * any shift type (see above)\n\nRules:\n   * *MUST:* shift counts for one job (except editor continuity below)\n   * *MUST:* any employee role may serve on Monday to Saturday nights\n   * *MUST:* part time employee to serve on Friday night\n   * *MUST:* part time employee to serve on Saturday night\n   * *MUST:* fulltime employee to serve on Sunday night\n   * *SHOULD:* editor to serve on Sunday night **(TODO)**\n   * *MUST:* employee birthday is marked as NO preference\n   * *MUST:* national holidays are solved in the same way as Sunday **(PARTIAL)**\n   * Editor Friday to Sunday continuity:\n      * *MUST:* particular editor to serve Friday afternoon + Saturday morning\n        and afternoon + Sunday morning and afternoon shifts\n      * *MUST:* editor continuity counts for 1 + 3 (Friday + weekend) = 4 shifts\n        in job (note that it would be 5 otherwise) **(TODO)**\n      * *SHOULD:* editor to have same staffer and sportak in continuity **(TODO)**\n   * *MUST:* employee cannot have more than one shift in a day\n   * *MUST:* there must be at least 8 hours between two shifts served by the\n     same employee\n      * *MUST:* if employee serves afternoon shift, then first shift it may serve\n        is morning 8AM (6AM and 7AM CANNOT be served by this employee)\n      * *MUST:* if employee serves night shift, then it CANNOT serve morning shift\n        next day\n      * *MUST:* if employee serves on Saturday and Sunday then it CANNOT serve on\n        Monday **(TODO)**\n      * *SHOULD:* if employee has any shift in 5 consecutive days, then it SHOULD get\n        one day FREE\n   * Fulltime employee jobs:\n      * *MUST:* job shifts = workdays * 8 / 7.5\n      * *MUST:* fulltime employee must get max shifts +/-1 shift\n      * *MUST:* 2 night shifts in month at most\n      * *MUST:* if employee has holidays on workday, then it adds 1 to her/his\n        job shifts\n      * *SHOULD:* morning and afternoon shifts to be balanced 50%/50%\n   * Part time employee jobs:\n      * *MUST:* max job shifts = fulltime job shifts / 2\n\n\n\n## Technical Architecture\nFrontend:\n   * Google Web Toolkit\n\nBackend:\n   * Google AppEngine\n\n\n\n## Plan\nThe implementation plan:\n\n   * solver\n      * strategy:\n         * try to build schedule w/o need to backtrack\n         * smart allocation and capacity anticipation\n         * jobs for month - do I have enough?\n         * calculate capacity: editors, nights, sports, ...\n         * backtracking to be used only in situations when you cannot allocate wisely\n         * allocate user and ensure it wont fail (failure is last option causing backtrack)\n           e.g. make sure editor has 5 shifts capacity when assigned on Friday afternoon\n      * incorporate POSITIVE preferences in solver (do 2 cycles of employees\n        and remember it in solution: want employees for day and THEN don't\n        care employees)\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvorka%2Fshifts-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvorka%2Fshifts-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvorka%2Fshifts-solver/lists"}