Graph-Theoretic Techniques for Optimizing NISQ Algorithms