The only hard requirement cost functions have to fulfill is monotonicity.
adding an edge e to a graph G should never result in a graph cheaper than G. Formally: The monotonicity assumption helps reduce the search space, since extensions of subgraphs with a cost greater than the best subgraph found up to that point can safely be ignored.