initialize graph, pat advance 1081 added