Such intelligent agent or robot is guided in the right direction with the help of its best previous position. In the other words, the cognitive component is such an appropriate actuator for embedding in the intelligent agents like robots. The cognitive component contains the best position of the particles up to now, while the social component contains the particle with the best position in the whole of the system at the current time and the particles with the best position in the neighborhood. The GSA has used a function of time to determine the number of the best particles for attracting others in each time, while our main idea is based on attracting each particle with two cognitive and social components. In this paper, we propose a Cognitive Discrete GSA (called CDGSA) for solving 0-1 knapsack problem. Hope it will help you.The Gravitational Search Algorithm (GSA) has been proposed for solving continues problems based on the law of gravity. Thus, items that must be put in the knapsack to obtain the maximum value 7 are.If an entry is encountered whose value is not same as the value which is stored in the entry immediately above it, then mark the label of row of that entry.Considering the last column, start scanning the entries from bottom to top.Identifying the items that must be put in the knapsack Thus, maximum possible value that can be put in the knapsack = 7.The last entry represents the maximum possible value that can be put in the knapsack.Similarly, after computing all the values and filling them in the table, we get. Use the following formula- T (i, j) = max.Start filling the table row wise top to bottom from left to right.Fill all the boxes of 0 th row and 0 th column with zeroes as shown.Draw a table say ‘T’ with (n+1) number of rows and (w+1) number of columns. ‘n’ number of items each having some weight and value.Steps for solving 0/1 Knapsack Problem using Dynamic Programming Approach.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |