Add algorithm to compute core graph for any level