compute vertex prices and edges reduced costs