-
-
Notifications
You must be signed in to change notification settings - Fork 42
Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 5 |implement laptop allocation #292
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
base: main
Are you sure you want to change the base?
Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 5 |implement laptop allocation #292
Conversation
OracPrime
left a comment
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.
You need an algorithm that scales. This one doesn't
| best_assignment = None | ||
| lowest_sadness = float("inf") | ||
|
|
||
| for perm in permutations(laptops): |
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.
I think you need to revisit this algorithm. If you have 20 laptops, how many iterations is this loop?
| Laptop(4, "Apple", "MacBook Air", 13, OperatingSystem.MACOS), | ||
| Laptop(5, "Apple", "MacBook Pro", 16, OperatingSystem.MACOS), | ||
| Laptop(6, "Dell", "Latitude", 15, OperatingSystem.ARCH), | ||
| Laptop(7, "HP", "EliteBook", 13, OperatingSystem.MACOS), |
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.
HP running MacOS? Cute :)
| @@ -1 +1,2 @@ | |||
| node_modules | |||
| .venv | |||
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.
While it's correct to gitignore .venv, if you've had to create a venv you should probably commit a requirements.txt that describes it.
Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 5 |implement laptop allocation
Learners, PR Template
Self checklist
Changelist
Implement laptop allocation algorithm and detailed output
Questions
This solution is good for small data, but it doesn't scale because permutations grow factorially. The SciPy/Hungarian way to solve the problem is polynomial time and stays fast even with more laptops/people. Which approach do you prefer for this version?
Please review my work — thank you!