Changes to how equivalence graph is generated

- Keep one graph rather than a list of components
- Remove Type C vertices after generating the graph, not before