Implement graph library and demo