Network flow methods for electoral systems