This patch corrects an error in the graph. The original way the ticket l...

...inks are finded and handled a lot of tickets got a bigger CurrentDepth as it should because it was reached first in a 'longer' path/way. Later it is skipped because it was already seen but not that CurrentDepth.

To handle this correctly, the whole algorithm should be rewriten.
The script 'searches' ticket down and then the current level. It should first search in the current level, then down.
It requires more memory because you must store all the tickets you found, and you can only start finding their links after all the tickets in this level were created.