MincostPath Problem