set-cover

How to optimize this suboptimal Set-Cover solution?

烈酒焚心 提交于 2019-12-11 01:29:33
问题 I wrote this program to test how long it would take to "solve" the set-cover problem. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using MoreLinq; namespace SetCover { class Program { const int maxNumItems = 10000; const int numSets = 5000; const int maxItemsPerSet = 300; static void Main(string[] args) { var rand = new Random(); var sets = new List<HashSet<int>>(numSets); var cover = new List<HashSet<int>>(numSets); var

Minimum set cover

拈花ヽ惹草 提交于 2019-12-10 15:33:58
问题 I would like to solve a minimum set cover problem of the following sort. All the lists contain only 1s and 0s. I say that a list A covers a list B if you can make B from A by inserting exactly x symbols. Consider all 2^n lists of 1s and 0s of length n and set x = n/3 . I would to compute a minimal set of lists of length 2n/3 that covers them all. Here is a naive approach I have started on. For every possible list of length 2n/3 I create a set of all lists I can create from it using this