refactor graph file to decrease search state in a sense and add result file