addUniqueNode method added to class Graph