Add topsort algorithm
Add components algorithm