public List <Tuple <int, double> > GetDualVariables(string folderPath, RouteSet solution) { /*Solo permite obtener soluciones extremales del dual que son muy malas para la generacion de columnas*/ ColumnSelectionGAMS gamsProcedure = new ColumnSelectionGAMS(ProblemData); return(gamsProcedure.DualSolve(folderPath, GetExtRouteInfo(solution))); }
//public double[] GetDualVariables(List<Tuple<Route, double>> coveringSelection) //{ // //no gatantiza que sea solucion optima del dual // double[] vars = new double[ProblemData.Clients.Count + 1]; // foreach (var item in coveringSelection) // { // double routePartialCost = GetCost(item.Item1) * item.Item2; // foreach (var c in item.Item1) // { // vars[c] += routePartialCost / item.Item1.Count; // } // } // return vars; //} public double[] GetExtremeDualVariables(string folderPath, List <ExtRouteInfo> pool, int dualVectorSize) { double[] dual = new double[dualVectorSize]; if (pool.Count > 0) { ColumnSelectionGAMS gamsProcedure = new ColumnSelectionGAMS(ProblemData); var dualvalues = gamsProcedure.DualSolve(folderPath, pool); foreach (var item in dualvalues) { dual[item.Item1] = item.Item2; } } return(dual); }