searchgraph with new function