algorithm that determines the path up to a instruction