Ejemplo n.º 1
0
        private void Search(
            IVertexListGraph <string, Edge <string> > g,
            string root, IDistanceRelaxer relaxer)
        {
            DagShortestPathAlgorithm <string, Edge <string> > algo =
                new DagShortestPathAlgorithm <string, Edge <string> >(
                    g,
                    DagShortestPathAlgorithm <string, Edge <string> > .UnaryWeightsFromVertexList(g),
                    relaxer
                    );
            VertexPredecessorRecorderObserver <string, Edge <string> > predecessors = new VertexPredecessorRecorderObserver <string, Edge <string> >();

            predecessors.Attach(algo);
            algo.Compute(root);

            Verify(algo, predecessors);
        }