Skip to content

Hamiltonian cycle implementation #3133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

itsAkshayDubey
Copy link
Contributor

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

References

#3057 Implementation of Hamiltonian Cycle

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Java files are placed inside an existing directory.
  • All filenames are in all uppercase characters with no spaces or dashes.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also format your code to use spaces instead of tabs and not to contain so many empty lines

itsAkshayDubey and others added 3 commits June 17, 2022 11:44
- Rename solve method to isPathFound method which now returns true if path is found false otherwise, earlier the return type of this method was void
- Improve flow by removing throw statement by using boolean return type
- Replace all tab spaces with whitespaces
private HamiltonianCycle hamiltonianCycle = new HamiltonianCycle();

@Test
void testFindHamiltonianCycleShouldReturnHamiltonianPath() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's called findCycle, it should return a cycle, not just a path. Please rename everything to find path, not find cycle if that's what it's supposed to do

Copy link
Contributor Author

@itsAkshayDubey itsAkshayDubey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the build?

@itsAkshayDubey
Copy link
Contributor Author

Closing this PR - due to some issue with this remote branch I am getting internal server when trying to push the changes.

Link to issue raised in github community.

Will create new branch and create a new PR with all the suggested changes.

Thanks

@itsAkshayDubey
Copy link
Contributor Author

@siriak created new PR #3151. Kindly have a look.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants