Class MaxCoverGenerator

java.lang.Object
org.ddolib.examples.maximumcoverage.MaxCoverGenerator

public class MaxCoverGenerator extends Object
Utility class for generating and measuring instances of the Maximum Coverage (MaxCover) problem.

This class provides methods to:

  • Create random MaxCover instances with specified parameters
  • Optionally compute the optimal solution using brute-force
  • Generate multiple instances for benchmarking
  • Generate all combinations of k elements among n for brute-force computation

Generated instances are saved to disk in a specific text format.

  • Constructor Details

    • MaxCoverGenerator

      public MaxCoverGenerator()
  • Method Details

    • main

      public static void main(String[] args)
      Program entry point.

      By default, calls measureInstance() to generate benchmark instances.

      Parameters:
      args - command-line arguments (not used)
    • generateCombinations

      public static List<Set<Integer>> generateCombinations(int n, int k)
      Generates all non-ordered combinations of k elements from n.
      Parameters:
      n - the total number of elements
      k - the size of each combination
      Returns:
      a list of sets, each representing a combination of k elements