Generating All Maximal Independent Sets: NP-Hardness and Polynomial-Time Algorithms