Graph with triplets and graph