Exemplo n.º 1
0
        private static BipartiteGraph Get_D_GM(BipartiteGraph G, EdgeList M)
        {//Get directed graph from given Graph G and matchings(list of matched edges) M
            BipartiteGraph D_GM = G;


            //D_GM.GetAdjListInTheFormOfIntegers(); //Graph is converted to AdjList containing integers which are assigned to each model type node in a graph
            //IList<int> match = HopcroftKarp.GetMatching(D_GM.AdjList, D_GM.ModSet.Count); //Max. matching algorithm is called here with above AdjList of graph and number of model type nodes in a graph as input

            //EdgeList<T> M = D_GM.MatchingToEdgeList(match); //Edges of Matching



            foreach (var edge in M)
            {
                D_GM.ReverseEdgeDirection(edge); //getting directed graph with matched edges with direction from v1 -> v2 and other edges from v2 -> v1
            }

            return(D_GM);
        }