Option ExplicitSub generateNewProblem ( ) ' It generates a new case for knapsack problem ' It uses
Fantastic news! We've Found the answer you've been seeking!
Question:
Option ExplicitSub generateNewProblemIt generates a new case for knapsack problem It uses random numbers for weights, values and maximum weight Dim W As Long Dim n As Long Dim i As Long Dim arrCase As Variant 'this array will contain the solution W Application.WorksheetFunction.RandBetween n ile arasnda deerler isteniyor ReDim arrCase To n To For i To n arrCasei i arrCasei Application.WorksheetFunction.RandBetween 'Value arrCasei Application.WorksheetFunction.RandBetween 'Weight Next i Temizleme ilemi: 'den sonraki satrlar temizle Rangeb:dClearContents rnek olarak satrdan satra kadar temizler Deerleri yerletir RangebResizen arrCase Rangec WEnd Sub
Please creare an algorithm for this code and explain the code clearly.
Related Book For
Posted Date: