Example #1
0
    public static void TestEdgeDisjointPath2()
    {
        var g = new UndirectedGraph <int>();

        g.AddEdges(new int[] { 0, 1 });
        TestEdgeDisjointPath(g, 0, 1);
    }
Example #2
0
    public static void TestEdgeDisjointPath1()
    {
        var g = new UndirectedGraph <int>();

        g.AddEdges(new int[] { 0, 1, 0, 2, 1, 3, 2, 3, 3, 4, 3, 5, 4, 6, 5, 6 });
        TestEdgeDisjointPath(g, 0, 6);
    }
Example #3
0
        public void VerticeDegreeTest()
        {
            var graph = new UndirectedGraph(3);

            graph.AddEdges(new System.Collections.Generic.List <Tuple <int, int> >()
            {
                new Tuple <int, int>(0, 1),
                new Tuple <int, int>(2, 1),
            });

            Assert.IsTrue(graph.VerticeDegree(1) == 2);
        }
Example #4
0
        public void AdjacencyMatrixTestAfterDeleteEdge()
        {
            var graph = new UndirectedGraph(3);

            graph.AddEdges(new System.Collections.Generic.List <Tuple <int, int> >()
            {
                new Tuple <int, int>(0, 1),
                new Tuple <int, int>(2, 1),
                new Tuple <int, int>(0, 2),
            });
            graph.RemoveEdge(0, 1);
            Assert.IsTrue(graph.VerticeDegree(1) == 1);
        }