public ActionResult <long> Flow([FromBody] Tuple <List <string>, List <string> > sourceAndDestinationId)
        {
            var maxFlowFinder = new MaxFlowFinder();

            maxFlowFinder.InitGraph(sourceAndDestinationId.Item1, sourceAndDestinationId.Item2);
            return(maxFlowFinder.Find());
        }
예제 #2
0
        public void FlowTest(Dictionary <string, HashSet <SimpleEdge> > graph, long expected)
        {
            maxFlowFinder       = new MaxFlowFinder();
            maxFlowFinder.Graph = graph;

            Assert.Equal(expected, maxFlowFinder.Find());
        }