coding framework for graph search