Corrected the function readGraph by triple