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
ConstructorDescriptionCreate a new greedy dominating set algorithm object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setSeed
(long seed) Sets the seed for the random number generator.Methods inherited from class com.jgalgo.alg.cover.DominatingSetAlgoAbstract
computeMinimumDominationSet
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 theDominatingSetAlgo
interface.
-
-
Method Details
-
setSeed
public void setSeed(long seed) Description copied from interface:RandomizedAlgorithm
Sets 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:
setSeed
in interfaceRandomizedAlgorithm
- Parameters:
seed
- the seed for the random number generator.
-