Ask yourself this: is it possible to store the edges? Because it is clear that we can easily compare which edge is more expensive than others.