Esempio n. 1
0
        public override sealed void AddFreeVertexToTreil(int colonyIndex, Vertex vertix)
        {
            FreeVertices.Remove(vertix);

            Treil[colonyIndex].Add(vertix);
            WeightOfColonies[colonyIndex]++;

            //Log.DebugFormat($"Vertex <{vertix.Index}> add for colony <{colonyIndex}>");

            PassedVertices.Add(vertix);
        }
Esempio n. 2
0
        public void AddFreeVertexToTreil(int colonyIndex, Vertex vertix)
        {
            FreeVertices.Remove(vertix);

            Treil[colonyIndex].Add(vertix);
            Log.DebugFormat($"Vertex i: {vertix.Index}, w: {vertix.Weight}");

            var currentWeightOfColony = WeightOfColonies[colonyIndex];

            WeightOfColonies[colonyIndex] = currentWeightOfColony + vertix.Weight;

            foreach (var passedVertex in Treil[colonyIndex])
            {
                EdgesWeightOfColonies[colonyIndex] += _graph.EdgesWeights[passedVertex.Index, vertix.Index];
            }

            PassedVertices.Add(vertix);
        }