PartialGraph generation algorithm updated once again + minor performance fixes