コード例 #1
0
        public void TryGetRootForVertex_minus1_ShouldNotFindPath()
        {
            var forest       = GetSampleForest(out int[] levels);
            int sourceVertex = -1;

            bool rootFound = EdmondsAlgorithm.TryGetRootForVertex(forest, sourceVertex, levels, out int foundRootVertex, out List <Edge <int> > pathToRoot);

            Assert.IsFalse(rootFound);
        }
コード例 #2
0
        public void TryGetRootForVertex_13_ShouldFind_12()
        {
            var forest       = GetSampleForest(out int[] levels);
            int sourceVertex = 13;
            int expectedRoot = 12;

            bool rootFound = EdmondsAlgorithm.TryGetRootForVertex(forest, sourceVertex, levels, out int foundRootVertex, out List <Edge <int> > pathToRoot);

            Assert.IsTrue(rootFound);
            Assert.AreEqual(expectedRoot, foundRootVertex);
        }