If we don't need VD2, ED2, you can do 

    def project(other: Graph[_, _]): Graph[VD, ED]