[Olena-patches] 3346: Add code to merge components thanks to a graph.