Exemplo n.º 1
0
        public void TestLoadRing()
        {
            var graph = GraphInfo.Load("../../../Data/ring.json");

            Assert.Equal(10, graph.Nodes.Count);
            Assert.Equal(10, graph.Edges.Count);
        }
Exemplo n.º 2
0
        public void TestLoadFullyConnected()
        {
            var graph = GraphInfo.Load("../../../Data/fully_connected.json");

            Assert.Equal(10, graph.Nodes.Count);
            Assert.Equal(10, graph.Edges.Count);
        }
Exemplo n.º 3
0
        public void TestLoadSimple()
        {
            var graph = GraphInfo.Load("../../../Data/simple.json");

            Assert.Equal(3, graph.Nodes.Count);
            Assert.Single(graph.Edges);
        }
Exemplo n.º 4
0
        public void TestRingDiameter()
        {
            var graph = GraphInfo.Load("../../../Data/ring.json");

            var(diam, pairs) = Distance.CalcDiameter(graph.BuildSparseIncedenceMatrix());
            Assert.Equal(9, diam);
            Assert.Equal(10, pairs.Count());
        }
Exemplo n.º 5
0
        public void TestFullyConnectedDiameter()
        {
            var graph = GraphInfo.Load("../../../Data/fully_connected.json");

            var(diam, pairs) = Distance.CalcDiameter(graph.BuildSparseIncedenceMatrix());
            Assert.Equal(1, diam);
            Assert.Equal(90, pairs.Count());
        }
Exemplo n.º 6
0
        public void TestRingEccentricity()
        {
            var graph = GraphInfo.Load("../../../Data/ring.json");

            var(distance, nodes) = Distance.CalcEccentricity(graph.BuildSparseIncedenceMatrix(), 0);
            Assert.Equal(9, distance);
            Assert.Single(nodes);
        }
Exemplo n.º 7
0
        public void TestFullyConnectedEccentricity()
        {
            var graph = GraphInfo.Load("../../../Data/fully_connected.json");

            var(distance, nodes) = Distance.CalcEccentricity(graph.BuildSparseIncedenceMatrix(), 0);
            Assert.Equal(1, distance);
            Assert.Equal(9, nodes.Count);
        }