예제 #1
0
파일: Graph.cs 프로젝트: ardasovvadim/mitp
        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();
        }