Implement GraphNode class.