AlgorithmExtensions

Topics: algorithm, graph
Dec 9, 2010 at 3:37 PM

I have seen the following code sample. Also, it seems that the ShortestPathsBellmanFord function comes from AlgorithmExtensions class.

How can I add this class? which dll is required?

Please help,

Thanks in advance.

Nadav

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            AdjacencyGraph<int, Edge<int>> testGraph = new AdjacencyGraph<int, Edge<int>>();
            testGraph.AddVerticesAndEdge(new Edge<int>(1, 2));
            testGraph.AddVerticesAndEdge(new Edge<int>(1, 3));
            testGraph.AddVerticesAndEdge(new Edge<int>(3, 4));
            testGraph.AddVerticesAndEdge(new Edge<int>(1, 4));
            var testPath = testGraph.ShortestPathsBellmanFord<int, Edge<int>>(e => 1.0, 1);
            for (int i = 1; i <= 4; i++)
            {
                Console.WriteLine(testPath(i).Count());
            }
        }
    }
}