working shortest paths mcf implmeentation