if there is a matrix how to apply genetic algorithm?

1 回表示 (過去 30 日間)
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016 年 4 月 5 日
if there is a (N x M )matrix A
AND B represent a number of group of ones in each row
AND C represent a number of group of ones in each column
A = [ 1 1 0 0 1 0
1 0 1 0 0 1
1 1 0 1 0 1
0 1 0 1 0 0 ]
B = [ 2 1 0
1 1 1
2 1 1
1 1 0 ]
C = [ 0 1 0 0 0 0
3 2 1 2 1 2 ]
and i want to apply genetic algorithm
in first step generate a (N x M) Matrix
AND apply this fitness function F(x) = ∑ ∑ | Bij - Xij | .
to understand this equation let take example
if the first population x1 = 0 1 1 0 1 , x2 = 1 0 1 0 1 0 , x3 = 1 0 0 1 1 0
then x1 = 0 1 1 0 1 wil be (2,1)
x2 = 1 0 1 0 1 0 will be (1,1,1)
x3 = 1 0 0 1 1 0 will be (1,2)
in the first row in A [ 1 1 0 0 1 0] which is [2 1 0]
then
F(x1) = | 2-2 | + |1-1| + |0-0| = 0
F(x2) = | 1 - 2| + |1-1| + |1-0| = 2
F(x3) = | 2-1 | + | 1-2 | + |0-0| = 2
then F(x1) is the better

回答 (0 件)

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by