code: def is_closed(self):
          
          closed = all(i == 2 for i in
                       dict(self.vertex_graph.degree()).values())
  
          return closed
docs: Are all entities connected to other entities.
  
          Returns
          -----------
          closed : bool
            Every entity is connected at its ends