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 Details

  • 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 interface RandomizedAlgorithm
      Parameters:
      seed - the seed for the random number generator.