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

Greedy algorithm to the setcover assignment #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BaltiBoix
Copy link

Rough and dirty greedy algorithm for the setcover assignment:
1. Order by c = Cost of set/nº of items covered. Removing first the items already covered
2. Add the set with the min c.
3. Repeat until all the items are covered

Iterate randomly changing the order of the sets and distorting the cost randomly between 0.85 and 1.15

Gets 7/10 in the 6 cases.

Rough and dirty greedy algorithm that gets a 7/10 in all 6 cases of the assignment
@ccoffrin
Copy link
Member

Sorry for the delay, just getting around to this.

The code looks resonable. For the sake of consistency I suggest we rename the directory to isl_001 short for iterated local search.

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