Skip to content
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

Starting point is always the first point in the path #5

Closed
EliteMasterEric opened this issue Dec 10, 2020 · 2 comments
Closed

Starting point is always the first point in the path #5

EliteMasterEric opened this issue Dec 10, 2020 · 2 comments

Comments

@EliteMasterEric
Copy link
Contributor

return 1 + Math.floor(Math.random() * (this.points.length - 1));

Currently the first point in the path is never moved. This should be configurable.

@lovasoa
Copy link
Owner

lovasoa commented Dec 10, 2020

I am not sure I understand the goal here. We are working on a closed path, so there is no "first point". By convention, the code works with an array that starts with the first point in the input points array. But since the path is closed, the resulting path can be executed from any point without changing the total length.

@EliteMasterEric
Copy link
Contributor Author

Aaah, I see.

I guess this inquiry only makes sense in the context of an open path (which is the use case I came to this repository for).

After more research, this may be out of the scope of a Salesman library as it falls under the concept of a 'Hamiltonian' path.

@lovasoa lovasoa closed this as completed Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants