object SetCover
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- SetCover
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def covered[A](universe: Set[A], sets: Seq[Set[A]]): Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def greedy[A, Id](sets: Iterable[(Id, Set[A])]): Seq[Id]
Let
universe
be the union of all elements in all the sets insets
.Let
universe
be the union of all elements in all the sets insets
. Selects a subset ofsets
so that their union equalsuniverse
, i.e. a cover as specified by covered. The returned cover is in general neither minimal nor unique.Implements the standard greedy algorithm for set cover with the following optimization:
- Do not re-insert empty sets into the priority queue
- Do not update the priority queue immediately when a newly covered element is removed from the other sets. Instead, update the priority queue only when it would have been the updated set's turn without the updates. This saves unnecessary priority queue operations as a set may be updated multiple times before it would be its turn. This is normally not done in the greedy algorithms that use a bucket priority queue because bucket operations are constant-time. We however use a heap priority queue from the standard library, whose operations are logarithmic.
- Annotations
- @SuppressWarnings()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])