Example #1
0
        public void AddNode()
        {
            var myGraph = new DirectedWeightedGraph <int, EdgeData>();

            myGraph.AddNode(4);

            myGraph.Exists(4).Should().BeTrue();
        }
Example #2
0
        static void Main(string[] args)
        {
            var graph = new DirectedWeightedGraph <int, double>();

            foreach (var num in Enumerable.Range(0, 10))
            {
                graph.AddNode(num);
            }
            foreach (var num in Enumerable.Range(0, 9))
            {
                graph.AddEdge(new Random().Next(0, 9), new Random().Next(0, 9), num);
            }

            Console.WriteLine(graph.ToString());

            graph.RemoveEdge(4, 5, 5);
            graph.RemoveEdge(3, 4, 3);
            graph.RemoveEdge(5, 6, 5);

            Console.WriteLine(graph.ToString());

            graph.Clear();
            Console.WriteLine(graph.ToString());
        }
Example #3
0
        public BasicCompositor(ObjectManager objm, RendererContext rc)
        {
            graphLock = new object();

            _CompositorGraph = objm.CreateOrRecycle<DirectedWeightedGraph<CompositorNode, CompositorEdgeDescriptionListWrapper>>();
            _CompositorGraph.Init();

            _Nodes = new List<DirectedWeightedNode<CompositorNode, CompositorEdgeDescriptionListWrapper>>();
            _Edges = new List<DirectedWeightedEdge<CompositorNode, CompositorEdgeDescriptionListWrapper>>();

            DummyNode = _CompositorGraph.AddNode(null);

            RendererContext = rc;
        }