util function is done on graph