Add algorithm for finding base vertices in graph