add graph toString method