Graph structure with type parameters for nodes and edges