In combinatorics, it is the problem of selecting a minimum number of sets so that these sets combined contain all the elements found in some reference set.
Questions tagged [set-cover]
44 questions
1
vote
1 answer
How can I get a random selection from one dictionary that is a subset of another, without hitting recursion limit so often?
Disclaimer: I have checked many questions with similar keywords, but I don't believe they address my situation. Please correct me if I'm wrong, but I can't find anything.
I'm trying to get coverage from a random choice from the Pokedex where the…

iamlc
- 65
- 5
1
vote
1 answer
How can I efficiently randomly select items from a dictionary that meet my requirements?
So at the moment, I have a large dictionary of items. Might be a little confusing, but each of these keys have different values, and the values themselves correspond to another dictionary.
I need to make sure that my random selection from the first…

iamlc
- 65
- 5
1
vote
0 answers
Shipping from Minimize Number of Warehouses while generating shipping plans
I'm working to figure out an algorithm to solve the problem below:
There are w warehouses that store p different products with different
quantities
A customer places an order on n out of the p products
For example:
Product 1 | …

Ying Tang
- 11
- 1
1
vote
1 answer
Minimal `set cover` solution in Clojure
I've been trying ways to distill (a lot of) database index suggestions into a set of indexes that are applicable to most databases. To do that it turns out I need to solve a pretty basic but NP complete set theory problem: the minimum set cover…

NielsK
- 6,886
- 1
- 24
- 46
1
vote
2 answers
Extended version of the set cover problem
I don't generally ask questions on SO, so if this question seems inappropriate for SO, just tell me (help would still be appreciated of course).
I'm still a student and I'm currently taking a class in Algorithms. We recently learned about the…

roblox99
- 117
- 4
1
vote
1 answer
Why does this two-line change break this minizinc set-cover program?
The program below (adapted from http://www.hakank.org/minizinc/set_covering4b.mzn ) is a solution to the set-cover problem (example data provided at end of question). This runs correctly.
int: num_alternatives;
int: num_objects;
par set of int:…

Max Power
- 8,265
- 13
- 50
- 91
1
vote
1 answer
Minimal list of sub-sets covering elements
Given a list of sets which contain elements:
[setA: {a, b, e},
setB: {d, e, c}.
setC: {a, d}
]
and a list L of elements needed to cover: [x, y, z, ...]
find the smallest list of sets from L whose union contains all elements in the list L.
Is this…

Iota Tronics
- 11
- 2
1
vote
0 answers
Optimize Choices - Maximize Set From Selecting A Limited Number Of Bags From A List Of Bags
I have a list of bags. If allowed N selections, how do I choose the N bags that will maximize my set?
e.g.
choices = [ [A,A,Z], [B,A,E], [Z,Z,B,W], [Q], ...]
If N = 2 I would like to know that...
choices[1, 2]
Maximizes my set...
set = [B, A, E,…

Delicious
- 972
- 12
- 20
1
vote
1 answer
Set Cover Reduction
Let's say we have a set U = {x1, x2, x3} and a set S = {{x1},{x1, x2},{x1, x3},{x1,x1,x3}}.
This is purely an example and the problem is for the general problem. This looks just like a regular set cover problem, which is why I figure reducing it to…

Aviator
- 11
- 3
0
votes
0 answers
Genetic Algorithm does not improve solution (Set Covering Problem)
I made a genetic algorithm to solve the Set Covering Problem (SCP) which consists of given a coverage matrix that tells us which columns cover which rows and what is the cost of each column to find the set of columns that cover all the rows at the…
0
votes
1 answer
How to solve this linear programming problem?
Consider a set of city districts . There is a candidate for building a medical emergency service station in every city district. The cost of building an ambulance station is given by the parameter and the total budget for building stations…

DoctorTiko
- 1
- 1
0
votes
0 answers
How to output result of set cover algorithm as integers in python instead of 'None'?
I am having problems getting the output of a function to be displayed properly.
As can be seen in this image, what should be in place of the 'None' should be integers. The first, for example should output (1,2).
This issue seems to be with creating…

June
- 1
- 1
0
votes
1 answer
AttributeError: 'LpAffineExpression' object has no attribute 'solve', Error in Pullp
I'm trying to implement a problem a basis problem os Set covering with python, but pulp gives me all the time the error: AttributeError: 'LpAffineExpression' object has no attribute 'solve'
This is what I'm trying to solve
And this is my…
0
votes
0 answers
How to group route of journey (Set cover problem)
I have this issue need to solve:
Input:
List of route between city, all route will start from same origin
Set of all city
Output:
Group of path that can visit all city, if not found then return group cover the most of city with minimum of…

uncle bob
- 570
- 1
- 10
- 21
0
votes
1 answer
Return keys when solving Set Cover problem with a dictionary and the greedy algorithm
I have a set cover problem to solve where I would like to have the names of the sets returned to me. I figure a good way to store the named sets is in a dictionary.
I found this blog which implements the algorithm but uses a list of sets and I am…

G_T
- 1,555
- 1
- 18
- 34