add graph

add graph.c and graph.h