genetic algorithm tool GA(tool) for all possible (or shortest ) paths found in topology
2 ビュー (過去 30 日間)
古いコメントを表示
i want ga function to find all possible paths found in any topology
for example for this topology if the source (1) and destination (6) where 1 & 6 is nodes and L is link . can be represent the L1 as 1 and L2 as 2 ...etc.
all possible paths =( 4,8) &(1,2,7) &(4,3,7)&(1,5,9)&(1,2,3,8)......etc
or any help about this function...
with my thanks.
14 件のコメント
Walter Roberson
2013 年 1 月 8 日
Your question does not impose any restrictions on where the paths must start or end: your question asks for "all possible paths" found in the topology.
回答 (1 件)
Walter Roberson
2013 年 1 月 8 日
編集済み: Walter Roberson
2013 年 1 月 8 日
It is unfortunate that your version of ga() does not have IntCon.
One technique that can be used:
Let your ga have as many virtual variables as there are nodes. Let the virtual variables represent nodes in a path. To evaluate any particular list of values, start from the beginning of it. If the first value is not the desired first node, then assign a high cost and return. If the value after that is not reachable from the first node, assign a high cost and return. If the value is the destination node, assign a low cost that is lower for shorter paths, and return. If the value is a destination node that has already occurred along the path, assign a high cost and return. Keep evaluating along the path like this, verifying topology first then whether the destination has been reached then whether a loop was found. If you get to the end of the virtual variables and have not reached the destination and have not had a loop then there must have been a programming error.
Note that the final returned path will have values that have been ignored, as the examination stops when the destination has been reached. This is not a problem.
Now as you do not have IntCon in your version of ga(), instead encode each virtual variable by a series of bits sufficiently wide to hold the maximum node number. Be sure to add a step to verify the decoded values are in range for node numbers as you go along (it does not matter if you get invalid node numbers after you have reached the destination.)
Now what you might want to consider is whether all those cases of "high cost" should be the same "high cost", or if some of them should be considered to be worse than others.
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!