protected RouteSet ParseWeakSolution(StreamReader weakSolution) { RouteSet weakRS = RouteSet.BuildEmptyRouteSet(ProblemData.Vehicles); Regex routeExp = new Regex(@"(?<c>C\d+)\S+(?<v>V\d+)\S+(?<a>\d\.d+)"); while (!weakSolution.EndOfStream) { string line = weakSolution.ReadLine(); if (line == "") { break; } //Match mline = routeExp.Match(line); int c_index = line.IndexOf('C'); int c_sep = line.IndexOf(' ', c_index); int c = int.Parse(line.Substring(c_index + 1, c_sep - c_index - 1)); int v_index = line.IndexOf('V'); int v_sep = line.IndexOf(' ', v_index); int v = int.Parse(line.Substring(v_index + 1, v_sep - v_index - 1)); int dot_index = line.IndexOf('.'); int val = int.Parse(line.Substring(dot_index - 1, 1)); if (val != 0) { weakRS[v - 1].Add(c); } } weakSolution.Close(); return(weakRS); }