Construct costar graph.