Package com.jgalgo.alg.cover
Class DominatingSetAlgoGreedy
java.lang.Object
com.jgalgo.alg.cover.DominatingSetAlgoAbstract
com.jgalgo.alg.cover.DominatingSetAlgoGreedy
- All Implemented Interfaces:
RandomizedAlgorithm,DominatingSetAlgo
public class DominatingSetAlgoGreedy
extends DominatingSetAlgoAbstract
implements RandomizedAlgorithm
A greedy algorithm for computing a minimum dominating set.
The algorithm is randomized algorithm that adds vertices to the dominating set one by one. In each iteration, a random vertex is sampled with probability proportional to the number of vertices it will dominate.
- Author:
- Barak Ugav
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new greedy dominating set algorithm object. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetSeed(long seed) Sets the seed for the random number generator.Methods inherited from class com.jgalgo.alg.cover.DominatingSetAlgoAbstract
computeMinimumDominationSetMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jgalgo.alg.cover.DominatingSetAlgo
computeMinimumDominationSet
-
Constructor Details
-
DominatingSetAlgoGreedy
public DominatingSetAlgoGreedy()Create a new greedy dominating set algorithm object.Please prefer using
DominatingSetAlgo.newInstance()to get a default implementation for theDominatingSetAlgointerface.
-
-
Method Details
-
setSeed
public void setSeed(long seed) Description copied from interface:RandomizedAlgorithmSets the seed for the random number generator.The algorithm will use the same seed for the random number generator, in order to perform deterministically. Note that if methods of the algorithm are called multiple times, the seed should be set before each call.
- Specified by:
setSeedin interfaceRandomizedAlgorithm- Parameters:
seed- the seed for the random number generator.
-