solutions for graph search problems