'Adds a new node only if it doesn\'t already exist.
:param node_id: some unique identifier
:type node_id: (hashable)
:param data: any extra data that needs to be saved
:type data: (variadic dictionary)
:returns: the new node'

def add_node(self, node_id, **data):

    if (node_id in self.nodes):
        return self.nodes[node_id]
    node_index = len(self.nodes)
    new_node = SimpleGraphNode(node_index, **data)
    self.nodes[node_id] = new_node
    return new_node
