private void buttonCreate_Click(object sender, EventArgs e) { MaxFlowKEK _maxFlow = new MaxFlowKEK((int)NCount.Value); int[,] array = _maxFlow.GetMatrix(); TableUtils.CustomizeTable(dataGridView1, array.GetUpperBound(0) + 1, array.GetUpperBound(1) + 1); TableUtils.FillTable(array, dataGridView1); _maxFlow.Solve(); textBox1.Text = _maxFlow.GetMaxFlow().ToString(); }