Implemented graph structure.