greedy_mis#
- iqm.applications.mis.greedy_mis(mis_problem)[source]#
Standard greedy algorithm for maximum independent set problem class.
Steps:
Pick the lowest-degree node in the graph.
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 | Graph) – A problem instance of maximum independent set or a
Graph
.- Returns:
A bitstring solution.
- Return type: