greedy_mis#
- iqm.applications.mis.greedy_mis(mis_problem, seed=None)[source]#
Standard greedy algorithm for maximum independent set problem class.
Steps:
Pick the lowest-degree node in the graph (break ties randomly).
Add it to the independent set.
Remove it and all its neighbors from the graph.
Repeat steps 1-3 until the graph is empty.
Return the independent set.
- Parameters:
mis_problem (MISInstance) – A problem instance of maximum independent set to be solved (approximately).
seed (int | None) – Optional seed for randomly breaking ties.
- Returns:
A bitstring solution.
- Return type: