Skip to content

Attempt to handle Issue #53 - #54

Merged
fillipe-gsm merged 5 commits into
masterfrom
53-solve_tsp_record_to_record-reachers-infinite-loop-with-a-simple-example
Apr 8, 2024
Merged

fillipe-gsm merged 5 commits into
masterfrom
53-solve_tsp_record_to_record-reachers-infinite-loop-with-a-simple-example

Conversation

@fillipe-gsm

Copy link
Copy Markdown
Owner

One of the inner Lin Kernighan loops gets hanged forever when the incoming distance matrix has only two nodes.

This seems to happen regardless of the matrix being symmetric or asymmetric.

In this pull request I setup a test that should pass once the bug has been solved.

I leave the rest to @luanleonardo to handle it properly.

@luanleonardo luanleonardo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: @fillipe-gsm, the Lin-Kernighan heuristic assumes the existence of at least 4 nodes (named a, b, c, d) that play important roles in defining the neighborhood of a solution. If the problem is small, with less than 4 nodes, the heuristic does not apply. In this case, it is preferable to solve the problem using brute force.

I committed this suggestion, what do you think? If it's ok for you, I suggest merging the PR.

@fillipe-gsm
fillipe-gsm merged commit 4416f56 into master Apr 8, 2024
@fillipe-gsm

Copy link
Copy Markdown
Owner Author

I cannot approve the PR since I was the one who opened it (I just realized it now 🦆 ).

Thanks for the help, @luanleonardo , I'll merge it the way it is.

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