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); }
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); }