-
-
Notifications
You must be signed in to change notification settings - Fork 438
feat: add kruskal algorithm #137
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
The Rust repo is licensed under the MIT license. This means you have to attribute it properly (and state the license), unless you wrote the tests on the Rust repo yourself (then you are free to just copy them). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of Kruskal's algorithm looks correct to me. Note that it won't be restricted to Minimum Spanning Trees; if the input graph is disconnected, it will compute a Minimum Spanning Forest.
The tests still need attribution. You could also directly write the edges in the array literals rather than verbosely pushing them.
I believe this is fine from a licensing perspective. Attribution means that a copy of the license is included with the software. Both the Typescript and Rust repos have the MIT license with My question is more about the definition of plagiarism according to The Algorithms contributing guidelines. Its not simple to directly use the Oxford definition of plagiarism for example
Most implementations in the Algorithms are re-implementations of well-known algorithms, and in most cases authors probably looked at reference implementations or reading materials, yet we don't consider it plagiarism. The test cases I provided can be looked at as a re-implementation of test cases I saw elsewhere within The Algorithms, but I am not sure if that falls under the scope of plagiarism. |
Oh yeah, this is unintentional but welcome. Let me change comments and add some test cases. |
Honestly the "The Algorithms" copyright holder is questionable; I don't think that "The Algorithms" are a registered organization or the like. I would have expect copyright holders like "the Rust repo contributors" and "the JS repo contributors" (which can be found in the files / commit history) rather than "the Algorithms", wrongly implying that the same people had been working on all these repos. Still, I'd consider it good practice to attribute the source of the tests; a single comment containing a permalink should work. This is also helpful in case someone happens to find an issue with the tests or the like.
To be sure I don't plagiarize reference implementations, I usually don't look at them (rather, I just understand the algorithm), and implement algorithms from memory; I avoid porting code side-by-side. A reimplementation is not necessarily free from licensing issues by pure virtue of being a reimplementation. We're not passing the algorithms off as our own; we're merely claiming that the implementations are our own. |
OK yeah, I think its easiest to rewrite tests. Not a huge fan of permalinks in code. I still think its an interesting discussion, but that can take place else where. |
add well-known kruskal's algorithm
Is it plagiarism to use test cases from other TheAlgorithms repos? I got testcases from https://github.com/TheAlgorithms/Rust/blob/master/src/graph/minimum_spanning_tree.rs to avoid having to come up with interesting graph cases myself. If this is a problem, I can rewrite stuff from scratch.