fn reverse_graph<T: Types>( graph: &HashMap<T::KVar, Vec<T::KVar>>, ) -> HashMap<T::KVar, Vec<T::KVar>>