protected static void ComputeWithRoot_Test <TVertex, TGraph>(
            [NotNull] RootedAlgorithmBase <TVertex, TGraph> algorithm)
            where TVertex : new()
            where TGraph : IImplicitVertexSet <TVertex>
        {
            var vertex = new TVertex();

            Assert.DoesNotThrow(() => algorithm.Compute(vertex));
            Assert.IsTrue(algorithm.TryGetRootVertex(out TVertex root));
            AssertEqual(vertex, root);
        }