{"id":21420156,"url":"https://github.com/d-krupke/alglab-ws2425-material","last_synced_at":"2026-01-03T22:06:22.178Z","repository":{"id":258991855,"uuid":"872457658","full_name":"d-krupke/AlgLab-WS2425-material","owner":"d-krupke","description":"Material for the AlgLab (Winter 2024/2025) @ TU Braunschweig","archived":false,"fork":false,"pushed_at":"2024-11-29T19:29:24.000Z","size":21668,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T06:29:30.281Z","etag":null,"topics":["algorithm-engineering","combinatorial-optimization","mathematical-programming","operations-research"],"latest_commit_sha":null,"homepage":"https://www.ibr.cs.tu-bs.de/courses/ws2425/alg-prakt/index.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-krupke.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-14T13:23:08.000Z","updated_at":"2024-11-29T19:29:28.000Z","dependencies_parsed_at":"2024-11-29T20:33:40.767Z","dependency_job_id":null,"html_url":"https://github.com/d-krupke/AlgLab-WS2425-material","commit_stats":null,"previous_names":["d-krupke/alglab-ws2425-material"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-krupke%2FAlgLab-WS2425-material","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-krupke%2FAlgLab-WS2425-material/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-krupke%2FAlgLab-WS2425-material/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-krupke%2FAlgLab-WS2425-material/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-krupke","download_url":"https://codeload.github.com/d-krupke/AlgLab-WS2425-material/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926065,"owners_count":20369911,"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":["algorithm-engineering","combinatorial-optimization","mathematical-programming","operations-research"],"created_at":"2024-11-22T20:12:35.329Z","updated_at":"2026-01-03T22:06:17.140Z","avatar_url":"https://github.com/d-krupke.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Algorithms Lab - Winter 2024/2025\n\n_Instructor: [Dr. Dominik Krupke](https://www.ibr.cs.tu-bs.de/users/krupke/)\nIBR, Algorithms Group_\n\nOptimization problems are pervasive across numerous real-world applications\nwithin computer science, ranging from\n[route planning](https://en.wikipedia.org/wiki/Travelling_salesman_problem) to\n[job scheduling](https://en.wikipedia.org/wiki/Job-shop_scheduling). Certain\nproblems, like the\n[shortest path](https://en.wikipedia.org/wiki/Shortest_path_problem), can be\nsolved efficiently in theory and practice. However, a significant number of\nthese optimization problems are classified as\n[NP-hard](https://en.wikipedia.org/wiki/NP-hardness), indicating that, for these\nproblems, there is no known algorithm capable of consistently solving every\ninstance efficiently to proven optimality. In such instances, heuristic\napproaches, such as\n[genetic algorithms](https://en.wikipedia.org/wiki/Genetic_algorithm), are\nfrequently employed as practical solutions. Yet, the question arises: Is it\npossible to devise algorithms that yield optimal solutions within a feasible\ntimeframe for reasonably sized instances? This laboratory course is dedicated to\nexploring three sophisticated techniques that hold the potential for computing\noptimal solutions for a vast array of problems within practical limits. These\ntechniques include:\n\n- **Constraint Programming** with\n  [CP-SAT](https://developers.google.com/optimization/cp/cp_solver): This\n  versatile methodology enables the definition of a problem’s constraints, upon\n  which it employs a comprehensive suite of strategies, including the two\n  techniques discussed below, to find optimal solutions.\n- **SAT Solvers**: Renowned for their ability to resolve extensive logical\n  formulas, these tools can be ingeniously adapted to address optimization\n  challenges by transforming them into logical propositions.\n- **Mixed Integer Programming (MIP)**: This approach is adept at solving\n  optimization problems characterized by integer and continuous variables under\n  linear constraints.\n\nFor algorithm engineers and operations researchers, mastering these techniques\nopens the door to modeling and solving a wide spectrum of combinatorial\noptimization problems. By the end of this course, you will have acquired the\nskills to leverage these powerful methodologies, enabling you to approach\nNP-hard problems not only with theoretical insight but with practical,\nactionable solutions. This journey is not just about crafting elegant models but\nalso about utilizing robust solution engines to navigate the complexities of\nNP-hard challenges effectively.\n\n## Content\n\nThe class is organized into two main components: a series of exercises and an\nin-depth final project, both of which are designed to enhance your proficiency\nwith key optimization techniques.\n\nThe exercise sheets will be conducted in pairs, while final projects will\nrequire collaboration among groups of three to four students. To ensure\nequitable team composition for the final projects, we may consider individual\nperformance in the exercises as a criterion for team formation. Our objective is\nto create balanced teams by pairing students of comparable skill levels. This\napproach is informed by our observation that teams with a mix of varying\nabilities can sometimes lead to an imbalance, where more proficient students may\ninadvertently overshadow their peers.\n\n### Exercise Sheets Overview\n\nTo ensure you are thoroughly prepared for the project phase, this class will\nbegin with a series of exercise sheets. These exercises are carefully crafted to\neither introduce you to new techniques or enhance your existing knowledge of\nthem. Designed with a hands-on approach, these tasks aim to provide you with\npractical exposure to relevant tools and methodologies.\n\nEach exercise sheet is allocated a two-week completion window. However, with new\nsheets released on a weekly basis, you effectively have one week to work on each\nexercise, with an additional week serving as a buffer. While the exercises are\ndesigned to be completed within a few hours, the learning curve associated with\nmastering new techniques may necessitate additional time. The time required to\ncomplete each sheet may vary; for example, you might spend more time on the\ninitial sheet and less on subsequent ones, or vice versa, depending on your\nfamiliarity with the topics covered.\n\n|                  Sheet                  |           Time           |                                                                                                                                                 Content                                                                                                                                                 |\n| :-------------------------------------: | :----------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n| [Exercise Sheet 1A](./sheets/01_cpsat/) | 2024-10-15 to 2024-10-29 |                                                                                        Constraint Programming with CP-SAT - A Hello-World with CP-SAT, NetworkX, and Scalene. All nice and easy to get started.                                                                                         |\n| [Exercise Sheet 1B](./sheets/01_cpsat/) | 2024-20-22 to 2024-11-05 |                                     Constraint Programming with CP-SAT - Here you will explore the use of CP-SAT, a declarative constraint programming solver. You will learn to define your problem mathematically, allowing CP-SAT to efficiently find solutions.                                     |\n|   [Exercise Sheet 2](./sheets/02_bnb)   | 2024-10-29 to 2024-11-12 |                          DIY: Branch and Bound - This exercise delves into the foundational algorithm behind generic solvers like CP-SAT. Participants will gain insights into what these solvers require for optimal performance by exploring the Branch and Bound algorithm.                          |\n|  [Exercise Sheet 3](./sheets/03_sat/)   | 2024-11-05 to 2023-11-19 |                                      SAT Solver - After the high-level interface provided by CP-SAT, this exercise demands a closer interaction with the core mechanics of a SAT solver. You will learn to translate complex problems into basic logical formulas.                                      |\n|  [Exercise Sheet 4](./sheets/04_mip/)   | 2024-11-12 to 2024-11-26 | Mixed Integer Programming - Learn about Mixed Integer Programming (MIP), a technique favored by many optimization experts. Although not as expressive as CP-SAT, MIP offers better scalability and the opportunity to apply various optimization tricks thanks to an extensive mathematical foundation. |\n\n\u003e [!WARNING]\n\u003e\n\u003e These exercises are not traditional homework; they are the core of this course\n\u003e and should be approached accordingly. Each exercise sheet will require a full\n\u003e day of focused work, as they introduce new concepts and techniques you may not\n\u003e have encountered before. You will need to carefully study both the course\n\u003e material and the provided references to fully understand these concepts. Given\n\u003e the complexity, I expect you to ask more questions and seek assistance\n\u003e frequently.\n\n### Final Project\n\nIn the latter part of the course, we will embark on a comprehensive final\nproject, marking an opportunity for you to apply the methodologies and\nstrategies discussed in the exercises to a concrete, real-world challenge. This\nproject phase, extending over several weeks, invites you to engage deeply with a\nproblem, under the mentorship of your tutor. The culmination of this endeavor\nwill be a presentation, wherein you will have the chance to exhibit the outcomes\nof your efforts.\n\nThe essence of the project phase is to immerse you in the practical application\nof optimization techniques, tackling a problem that demands a blend of\ninnovative thinking and strategic planning. You are encouraged to explore\ndiverse approaches to the problem, aiming to devise a persuasive and effective\nsolution.\n\nPlease note, as a five-credit course, you are expected to dedicate up to 150\nhours in total to coursework. This allocation includes both the exercises and\nthe project, with no more than 50 hours slated for the exercises. Consequently,\na minimum of 100 hours should be devoted to the project, ensuring a deep and\nproductive engagement with the material and the challenge at hand.\n\n## Prerequisites\n\nFor a successful experience in this course and to effectively work on the\nprojects, students are expected to meet the following prerequisites:\n\n1. **Proficiency in Python**: The course's programming components will be\n   exclusively conducted in Python. It is essential that you have a solid grasp\n   of Python, as there will not be sufficient time to learn the language during\n   the course.\n2. **Algorithmic Foundations**:\n   - Completion of _Algorithms and Data Structures 1_ is compulsory for\n     foundational knowledge.\n   - It is advisable to have also completed (or complete in parallel)\n     _Algorithms and Data Structures 2_ and _Network Algorithms_ to be better\n     prepared for the more complex topics.\n   - Additionally, it is beneficial to have attended _Logic for Computer\n     Scientist_ and _Theoretical Computer Science I+II_ to be familiar with\n     NP-hardness and propositional logic.\n3. **Unix-Based Operating System**:\n   - Access to a Unix system, which could be in the form of a virtual machine,\n     is required for the course. Students should possess a fundamental\n     understanding of Unix command-line operations.\n   - While most of the tools and software used in this course are compatible\n     with Windows, support for Windows-specific issues cannot be guaranteed.\n4. **Version Control with Git**:\n   - A basic familiarity with Git is needed for version control purposes. While\n     Git skills can be acquired swiftly, students are expected to learn them\n     independently prior to or during the initial phase of the course.\n\nPlease ensure you meet these requirements to engage fully in the course\nactivities. If you have any questions or need clarification on the\nprerequisites, feel free to reach out to us.\n\n## Lectures to go next\n\nThis class is just a quick peek into solving NP-hard problems in practice, there\nis more!\n\n- _Algorithm Engineering (Master, infrequently)_ will teach you a superset of\n  this class, with more details.\n- _Mathematische Methoden der Algorithmik (Master)_ will teach you the\n  theoretical background of Linear Programming and Mixed Integer Programming.\n- _Approximation Algorithms (Master)_ will teach you theoretical aspects of how\n  to approximate NP-hard problems with guarantees. While this takes a\n  theoretical point of view, the theoretical understanding can improve your\n  practical skills on understanding and solving such problems.\n\n## References\n\n- [Discrete Optimization Course](https://www.coursera.org/learn/discrete-optimization/):\n  For those who are want to dive really deep into the topic, I recommend doing\n  this free course on Coursera in parallel. It is very intense but also very\n  rewarding. Probably one of the best courses I have ever seen.\n- [In Pursuit of the Traveling Salesman](https://press.princeton.edu/books/paperback/9780691163529/in-pursuit-of-the-traveling-salesman):\n  This amazing book is not a surprisingly good read, but also a great\n  introduction to the field of optimization. It gives you a lot of the ideas\n  that allow us to solve NP-hard problems in practice, while also gently\n  introducing you to the way of thinking of an optimization expert.\n\n## Found an error?\n\nPlease let us know by opening an issue! You can also create a pull request on a\nseparate branch, but as we have to do the changes in our internal repository\n(which also contains solutions), from which the public repository is\nautomatically updated, it is easier for us if you open an issue and let us do\nthe changes.\n\n## Are you an instructor?\n\nIf you are an instructor and want to use this material in your course, feel free\nto do so! We are happy to share our material with you. If you have any\nquestions, feel free to reach out to us. To get the solutions, please contact us\ndirectly from your official university email address, so we can verify that you\nare an instructor and not a student.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-krupke%2Falglab-ws2425-material","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-krupke%2Falglab-ws2425-material","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-krupke%2Falglab-ws2425-material/lists"}