-
-
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
sprint-5/laptop-allocation.py
Outdated
| 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?
sprint-5/laptop-allocation.py
Outdated
| 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 :)
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 let HP join the macOS club for this dataset 😄 I’ll switch it to a more realistic OS
.gitignore
Outdated
| @@ -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.
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.
Thank you @OracPrime . Agreed — I’ll generate and commit a requirements.txt so the environment can be reproduced
|
Yes, you are right @OracPrime — I considered scalability, but assumed the input would remain limited to 8 for this sprint. For larger sets, I will replace the brute-force permutation approach with an optimal algorithm such as the Hungarian algorithm.Thank you |
…P/MacOS data, add requirements.txt, and implement full unit tests
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!