use OO design
graph initializa method ok