Title: Yuvraj Singh — R45-T031: Lock down the contract of HopcroftKarp (HopcroftKarp.java) [src/main/java/com/thealgorithms/graph/HopcroftKarp.java] · Issue #31 · S-AI-Projects/TheAlgorithms-Java · GitHub
Open Graph Title: Yuvraj Singh — R45-T031: Lock down the contract of HopcroftKarp (HopcroftKarp.java) [src/main/java/com/thealgorithms/graph/HopcroftKarp.java] · Issue #31 · S-AI-Projects/TheAlgorithms-Java
X Title: Yuvraj Singh — R45-T031: Lock down the contract of HopcroftKarp (HopcroftKarp.java) [src/main/java/com/thealgorithms/graph/HopcroftKarp.java] · Issue #31 · S-AI-Projects/TheAlgorithms-Java
Description: All Algorithms implemented in Java. Contribute to S-AI-Projects/TheAlgorithms-Java development by creating an account on GitHub.
Open Graph Description: All Algorithms implemented in Java. Contribute to S-AI-Projects/TheAlgorithms-Java development by creating an account on GitHub.
X Description: All Algorithms implemented in Java. Contribute to S-AI-Projects/TheAlgorithms-Java development by creating an account on GitHub.
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-Java
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Yuvraj Singh — R45-T031: Lock down the contract of HopcroftKarp (HopcroftKarp.java) [src/main/java/com/thealgorithms/graph/HopcroftKarp.java]","articleBody":"\u003c!-- sai-task-v1:R45-T031 -->\n\n## Student: Yuvraj Singh\n\n**Task:** R45-T031 · 1 of 10\n**Repository:** https://github.com/S-AI-Projects/TheAlgorithms-Java\n**Assigned working branch:** `student/e26b07f0666`\n\n## Goal\n\nWork on src/main/java/com/thealgorithms/graph/HopcroftKarp.java. Create focused regression tests for `HopcroftKarp` using the stated fixture. Test returned values and any observable mutation separately. Fixture: Use the smallest valid input and one ordinary input for `HopcroftKarp` from src/main/java/com/thealgorithms/graph/HopcroftKarp.java. Write the literal inputs and independently calculated expected outputs in the tests before editing the implementation. The check must name the source line establishing each precondition.\n\n## Steps\n\n1. Read src/main/java/com/thealgorithms/graph/HopcroftKarp.java, especially `HopcroftKarp` near line 29. Record its public inputs, result, mutation behavior and any external dependencies before changing it.\n2. Write independent expected results for the fixture before running the source. Run the baseline and explain any mismatch without assuming the implementation is correct.\n3. Add a regression per distinct behavior; assert contents rather than just successful execution.\n4. Implement work/R45-T031/check.py as a focused runner that executes the new checks and propagates failures. Native check to incorporate: mvn test (JDK 21 as specified in pom.xml); use JUnit in the corresponding src/test/java package. Record the actual command and nonzero test count.\n5. Create the checks specified below and run `python3 work/R45-T031/check.py`. Save inputs, expected versus actual results and tool versions in work/R45-T031/; a check must exit non-zero when an assertion fails.\n6. Commit the repository change on branch R45-T031; prepare a PR to the organisation fork explaining the result and linking the checks. Keep each task independently reviewable. Remove work/R45-T031/ from a later upstream branch.\n\n## Done when\n\n☐ The checked behavior is tied to `HopcroftKarp` in src/main/java/com/thealgorithms/graph/HopcroftKarp.java; every assertion has an explicit expected value.\n☐ Use the smallest valid input and one ordinary input for `HopcroftKarp` from src/main/java/com/thealgorithms/graph/HopcroftKarp.java. Write the literal inputs and independently calculated expected outputs in the tests before editing the implementation. The check must name the source line establishing each precondition.\n☐ Existing supported behavior and the public interface are preserved unless a failing regression demonstrates and documents a defect.\n☐ The tests cover ordinary input, a smallest supported input and a repeated-value or equivalent domain boundary; each reports expected and actual results.\n\n\u003cdetails>\n\u003csummary>Additional task guidance\u003c/summary>\n\n\nAdditional curated task guidance\n\nItem:\nsrc/main/java/com/thealgorithms/graph/HopcroftKarp.java\n\nTask type:\nContract regression tests\n\nCode change (goes into the PR):\nAdd focused tests in the repository’s existing test layout for src/main/java/com/thealgorithms/graph/HopcroftKarp.java; add a concise input/output contract beside `HopcroftKarp`.\n\nAutomated check:\npython3 work/R45-T031/check.py\n\nPrerequisites:\nJDK 21, Maven and Python 3.\n\nUpstream PR rules:\nFollow the Java style and Maven checks. The project does not accept standalone LeetCode problem additions; a new feature requires an upstream issue first. Submit coursework to the organisation fork first; keep work/ evidence out of any later upstream PR. Upstream acceptance is not a grading requirement. Policy: https://github.com/TheAlgorithms/Java/blob/6edd2d878947c7fb08a6f3286b316eca09fe9200/CONTRIBUTING.md\n\nSource (pinned):\nhttps://github.com/TheAlgorithms/Java/blob/6edd2d878947c7fb08a6f3286b316eca09fe9200/src/main/java/com/thealgorithms/graph/HopcroftKarp.java#L29\n\nChange:\nReplaces the shared task template with an item-specific contribution brief.\n\nPR destination:\nUpstream candidate after review\n\n\n\u003c/details>\n\n## Submission checklist\n\n- [ ] Complete this task and its checks.\n- [ ] Add the required evidence and link your pull request here.\n- [ ] Select this **S-AI-Projects fork** as the PR base repository.\n- [ ] Request instructor review.\n\nKeep this PR focused on this task. Do not submit assignment PRs to the upstream repository.","author":{"url":"https://github.com/ankushbisht01","@type":"Person","name":"ankushbisht01"},"datePublished":"2026-11-03T22:54:24Z","url":"https://github.com/S-AI-Projects/TheAlgorithms-Java/issues/31"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:1c52097f-a9cd-b16e-3cab-bbc61db992a5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD58:25C088:26F11B:38B1A7:6AFDC4BC |
| html-safe-nonce | 59f667f69fa1e685a00fb066ab87f12d5e8309e578e04b377d672b91bda76bd5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDU4OjI1QzA4ODoyNkYxMUI6MzhCMUE3OjZBRkRDNEJDIiwidmlzaXRvcl9pZCI6IjIwMjQ0MDU2MjM4NTE4Mjg0MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b8c934fbe88ca4d5a4617915f6272a8bf8451166b0ff56510e054a6afef7c17d |
| hovercard-subject-tag | repository:1444142392 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/S-AI-Projects/TheAlgorithms-Java/issues/31 |
| twitter:image | https://opengraph.githubassets.com/3c33c53e6eccdb4b6b8ace327ff8ccf984ad1961befc70a1cd7ffefa6515519c/S-AI-Projects/TheAlgorithms-Java |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c33c53e6eccdb4b6b8ace327ff8ccf984ad1961befc70a1cd7ffefa6515519c/S-AI-Projects/TheAlgorithms-Java |
| og:image:alt | All Algorithms implemented in Java. Contribute to S-AI-Projects/TheAlgorithms-Java development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9ab00cc3b4fa90bbd3da70765dd38efc23cfa9d9b0930e41feea2bf67f60ecaf |
| turbo-cache-control | no-cache |
| go-import | github.com/S-AI-Projects/TheAlgorithms-Java git https://github.com/S-AI-Projects/TheAlgorithms-Java.git |
| octolytics-dimension-user_id | 351892385 |
| octolytics-dimension-user_login | S-AI-Projects |
| octolytics-dimension-repository_id | 1444142392 |
| octolytics-dimension-repository_nwo | S-AI-Projects/TheAlgorithms-Java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 63477660 |
| octolytics-dimension-repository_parent_nwo | TheAlgorithms/Java |
| octolytics-dimension-repository_network_root_id | 63477660 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/Java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1b795ba060b92691fc16c5a12cf2bf95e83432b4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width