hatvis.problems.greedy_set_cover#
- hatvis.problems.greedy_set_cover(H, universe=None, costs=None)[source]#
Greedy set cover (Chvátal 1979).
Repeatedly picks the hyperedge with the smallest cost per newly covered vertex, \(c_e/|e\cap U|\), until the universe \(U\) (default: all non-isolated vertices) is covered. The result is within a factor \(H_{\max|e|}\le 1+\ln\max|e|\) of the optimum.