TemporalNetworksTest.ExampleData.GetTestNetwork5 C# (CSharp) Method

GetTestNetwork5() public static method

Returns a test network in which node B should have betweenness preference 0
public static GetTestNetwork5 ( ) : TemporalNetwork
return TemporalNetwork
        public static TemporalNetwork GetTestNetwork5()
        {
            TemporalNetwork temporal_net = new TemporalNetwork();

            // Create sequence based on edges in edge graph

            // two-paths ending in (a,b)
            temporal_net.AddTemporalEdge(1, "A", "B");
            temporal_net.AddTemporalEdge(2, "B", "D");

            temporal_net.AddTemporalEdge(3, "A", "B");
            temporal_net.AddTemporalEdge(4, "B", "C");

            // two-paths ending in (b,a)
            temporal_net.AddTemporalEdge(5, "D", "B");
            temporal_net.AddTemporalEdge(6, "B", "D");

            temporal_net.AddTemporalEdge(7, "C", "B");
            temporal_net.AddTemporalEdge(8, "B", "A");

            // two-paths ending in (b,c)
            temporal_net.AddTemporalEdge(9, "D", "B");
            temporal_net.AddTemporalEdge(10, "B", "C");

            temporal_net.AddTemporalEdge(11, "X", "Y");

            // two-paths ending in (c,b)
            temporal_net.AddTemporalEdge(12, "C", "B");
            temporal_net.AddTemporalEdge(13, "B", "D");

            temporal_net.AddTemporalEdge(14, "C", "B");
            temporal_net.AddTemporalEdge(15, "B", "C");

            temporal_net.AddTemporalEdge(16, "D", "B");
            temporal_net.AddTemporalEdge(17, "B", "A");

            temporal_net.AddTemporalEdge(18, "X", "Y");

            temporal_net.AddTemporalEdge(19, "A", "B");
            temporal_net.AddTemporalEdge(20, "B", "A");

            return temporal_net;
        }

Usage Example

        public void NoBWPTest()
        {
            TemporalNetwork net = ExampleData.GetTestNetwork5();

            Dictionary <string, int> index_pred = null;
            Dictionary <string, int> index_succ = null;

            double[,] actual = null;
            actual           = BetweennessPref.GetBetweennessPrefMatrix(net, "B", out index_pred, out index_succ);

            double bwp = BetweennessPref.GetBetweennessPref(net, "B");

            Assert.AreEqual(bwp, 0d);
        }