updated initial graph with prefixes that will be reched and corresponding paths