optimal flow for index multiple source and destination in directed graph
This is an instance of a multi-commodity flow problem.  Unfortunately the problem is NP-hard (even when all edge capacities are 1).