Build graph