Implement basic graph operations.