Graph SampleΒΆ

In [1]:
def test_nodes():
    assert(Fail)
In [2]:
#def nodes(G):
#    return a list of all nodes
In [3]:
def test_edges():
    assert(Fail)
In [4]:
#def edges(G):
#    return a list of all edges
In [5]:
def test_add_node():
    assert(Fail)
In [6]:
#def add_node(G, n):
#    adds a new node 'n' to the graph
In [7]:
def test_add_edge():
    assert(Fail)
In [8]:
#def add_edge(G, n1, n2):
#    adds new edge connecting n1 & n2,
#    if not(n1|n2) add_node(nX)
In [9]:
G = {'A': ['C', 'D'], 'B': ['D', 'A'], 'C': ['D', 'E'],
      'D': ['E'], 'E': [] }