overrode equals and get hash code methods of node class.
created a class for undirected graph which extends graph abstract base class.