Optimize and bug fixed the search graph.