title: Implementing Graphs using class function in python. (Assignment)
body: <p>I have an assignment about class functions so just point me to the right direction. I dont need the answer just a little help in visualizing the problem</p>
  <p>According to our lesson, graphs are made out of sets of vertices and edges.
  <a href="https://i.stack.imgur.com/nnyP3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nnyP3.png" alt="Sample graph" /></a></p>
  <p>so <code>G = (V, E)</code>
  When <code>V={v1, v2, v3, v4} and E = {(v1, v2), (v1, v3), (v2, v3), (v2, v4), (v4, v1), (v4, v3)}</code></p>
  <p>And I'm given a template code that looks like this:</p>
  <pre><code>class Vertex:
      def __init__(self, value=0):  # CAN ADD VAR
          self.key = None
          self.value = value
  
  class Edge:
      def __init__(self, k1, k2, value=0):  # CAN ADD VAR
          self.key = (k1, k2)
          self.value = value
  
  class Graph:
      def __init__(self):  # DO NOT MODIFY
          self._vertice = list()
          self._edges = list()
          self._vkeys = set()
          self._ekeys = set()
  
      def getV(self):
          return self._vertice[:]
  
      def getVkeys(self):
          return set(self._vkeys)
  
      def getE(self):
          return self._edges[:]
  
      def getEkeys(self):
          return set(self._ekeys)
  </code></pre>
  <p>I am supposed to use this class to implement a graph and make another class function that deals with directed and undirected graphs and tell whether they have an eulerian path or not</p>
  <pre><code>class DiGraph(Graph):
      def euler(self):
  </code></pre>
  <p>I just don't know how to think of the Graph class. Do I just think of it as a set of vertices and edges like the lesson described?</p>
  <pre><code>({Vertex},{Edge})
  </code></pre>
  <p>I hope someone can give me a hint</p>