Пример #1
0
        public void EmptyGraph(IBidirectionalGraph <string, Edge <string> > g)
        {
            this.dfs = new BidirectionalDepthFirstSearchAlgorithm <string, Edge <string> >(g);
            this.dfs.Compute();

            VerifyDfs();
        }
        public void Compute <TVertex, TEdge>(IBidirectionalGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var dfs = new BidirectionalDepthFirstSearchAlgorithm <TVertex, TEdge>(g);

            dfs.Compute();

            // let's make sure
            foreach (var v in g.Vertices)
            {
                Assert.IsTrue(dfs.VertexColors.ContainsKey(v));
                Assert.AreEqual(dfs.VertexColors[v], GraphColor.Black);
            }
        }