- java.lang.Object
-
- org.logicng.np.SetCover
-
public final class SetCover extends Object
A simple MaxSAT based implementation of an algorithm finding a minimum set cover for a given collection of sets. This algorithm is really only meant for small set cover problems with perhaps some tens or hundreds of set and hundreds of variables.- Since:
- 2.0.0
- Version:
- 2.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<Set<T>>compute(Collection<Set<T>> sets)Computes the minimum set cover for the given collection of sets, i.e.
-
-
-
Method Detail
-
compute
public static <T> List<Set<T>> compute(Collection<Set<T>> sets)
Computes the minimum set cover for the given collection of sets, i.e. a minimum number of sets s.t. each element is covered at least once by a set in the cover.- Type Parameters:
T- the type of the elements of the sets. This type must implement a meaningful equals/hashCode method since it is internally used in HashSets- Parameters:
sets- the sets to cover- Returns:
- a minimum cover of the elements in the given sets
-
-