add end node to graph