protected Dictionary <int, List <OverlappingClientInfo> > RemoveOverlappingInfo(List <Route> selected, List <int> overlapping) { Dictionary <int, List <OverlappingClientInfo> > overlappingInfo = new Dictionary <int, List <OverlappingClientInfo> >(); for (int i = 0; i < selected.Count; i++) { foreach (var c in overlapping) { OverlappingClientInfo info = GetRemoveOverlappingInfo(selected[i], c, i); if (info != null) { if (overlappingInfo.ContainsKey(c)) { overlappingInfo[c].Add(info); } else { overlappingInfo.Add(c, new List <OverlappingClientInfo>() { info }); } } } } return(overlappingInfo); }
protected Tuple <int, OverlappingClientInfo> GetBestDeltaCostInfo(Dictionary <int, List <OverlappingClientInfo> > removeInfo) { double bestDeltaCost = int.MaxValue; int clientID = -1; OverlappingClientInfo info = null; foreach (var item in removeInfo) { foreach (var o in item.Value) { if (o.DeltaCost < bestDeltaCost) { bestDeltaCost = o.DeltaCost; clientID = item.Key; info = o; } } } return(new Tuple <int, OverlappingClientInfo>(clientID, info)); }