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

added a answer weighted_subset_sum_contraints #72

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

Saunakghosh10
Copy link
Contributor

I've contributed a solution to the Weighted Subset Sum with Constraints problem using dynamic programming. This code considers item selection constraints (must-pair and cannot-pair) and optimizes for maximum value with weight and item limits.

The implementation handles:

Must-pair items: Merging their weights and values.
Cannot-pair items: Avoids selecting conflicting pairs.
A 3D DP table ensures the correct subset is chosen.
Looking forward to your feedback! 😊

@dubey-harshit dubey-harshit self-requested a review October 5, 2024 14:16
@dubey-harshit dubey-harshit merged commit 9099afb into dubey-harshit:main Oct 5, 2024
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