Example #1
0
        public Graph Prim(FromVertex from)
        {
            Graph graph = from.graph;
            AdjacencyList <string> adjacencyList = graph;

            return(TreeAlgorithms <string> .Prim(adjacencyList, from.orig));
        }
Example #2
0
        public Graph Kruskal(FromVertex from)
        {
            Graph graph = from.graph;
            AdjacencyList <char> adjacencyList = graph;

            return(TreeAlgorithms <char> .Kruskal(adjacencyList));
        }
Example #3
0
        public Graph DFS(FromVertex from)
        {
            Graph graph = from.graph;
            AdjacencyList <string> adjacencyList = graph;

            adjacencyList.DFS();
            return(adjacencyList);
        }
Example #4
0
        public Graph BFS(FromVertex from)
        {
            Graph  graph = from.graph;
            string s     = from.orig;
            AdjacencyList <string> adjacencyList = graph;

            adjacencyList.BFS(s);
            return(adjacencyList);
        }
Example #5
0
        public Graph BellmanFord(FromVertex from)
        {
            Graph graph = from.graph;
            AdjacencyList <string> adjacencyList = graph;

            TreeAlgorithms <string> .BellmanFord(adjacencyList, from.orig, out GraphLib.Model.Graph <string> q);

            AdjacencyMatrix <string> output = (AdjacencyMatrix <string>)q;

            return(output);
        }