private Tuple<int, double> GetMostExpensiveMatchComponent(List<MatchComponent> components)
{
int index = 0;
int edgeCount = components[0].EdgeMaterilizedDict.Count;
edgeCount = edgeCount == 0 ? 1 : edgeCount;
double maxValue = components[0].Cost/edgeCount;
for (int i = 1; i < components.Count; i++)
{
edgeCount = components[i].EdgeMaterilizedDict.Count;
edgeCount = edgeCount == 0 ? 1 : edgeCount;
if (components[i].Cost/edgeCount > maxValue)
{
index = i;
maxValue = components[i].Cost/edgeCount;
}
}
return new Tuple<int, double>(index, maxValue);
}