added extra fields to the graph so it works with both versions of the algorithm
If we cant solve, we resort to the classic implementation