Solution for convert currency rate history to graph and find all cycles (Delphi)