Optimized graph loading by adding the root index vertex only once.