public Graph(int[][] accessMatrix, double[][] costMatrix) { AccessMatrix = accessMatrix.Select(m => m.ToList()).ToList(); CostMatrix = costMatrix.Select(m => m.ToList()).ToList(); Vertices = AccessMatrix.Count; Ways = GetWays(); Sums = GetSums(Ways); IndexCrit = Sums.FindIndex(s => s == Sums.Max()); Crit = Sums.Max(); Budgets = Sums.ToList(); var max = Sums.Max(); Budgets = Budgets.Select(b => max - b).ToList(); }