I think the role of those two functions are not very clear, because they have nearly the same name but are not the same thing... If I understand correctly, they are applied one after the other... Maybe the `get_costmat` method is the one that should be exposed?