class GraphObject:
    count = 0
    def __init__(self):
        GraphObject.count += 1

class GraphNode (GraphObject):
  count = 0
  def __init__(self, name):
    self.edges = []
    self.name = name
    GraphNode.count += 1
    GraphObject.__init__(self)
  def add_edge(self, edge):
    self.edges.append(edge)

class GraphEdge (GraphObject):
  count = 0
  def __init__(self, weight, target):
    self.weight = weight
    self.target = target
    GraphEdge.count += 1
    GraphObject.__init__(self)
