SlideShare a Scribd company logo
1 of 14
遺伝的アルゴリズム
〜概要から巡回セールスマン問題を解くまで〜
渡辺大智(taichi)
遺伝的アルゴリズム(Genetic Algorithm)とは
・機械学習の手法の1つで、生物の進化をモデルにしたアルゴリ
ズム
→「選択」、「交叉」、「突然変異」といった
遺伝的操作を模した処理で問題を解く
・「個体の学習」をモデルにしているNNに
対して、GAは「生物の進化」をモデルにし
ている
N700系新幹線の形状設計でGAが使われた話が有名
前提
個体C
個体B
個体D
個体(染色体)A
遺伝子
集団
適応度の算出
個体C
個体B
個体D
個体A
遺伝子
集団
適応度
94
80
63
45
選択(適用度が低いものを淘汰する)
個体C
個体B
個体D
個体A
遺伝子
集団
適応度
94
80
63
45除去
今回は50%を淘
汰
交叉(2つの個体から遺伝子を引き継いだ子を作成する)
親個体B
親個体A
集団
子個体B(New!)
交叉点 交叉点
突然変異(一定の確率で遺伝子を変化させる)
子個体
突然変異!
子個体
これを繰り返しまくって近似解を見つける
選択
交叉
突然変異
1世代
「局所解」に陥りにくく、「大域的」な
探索ができる。
→ 局所解が多数存在する「多峰性の問
題」に強い
巡回セールス問題(TSP)を解いてみる
• 50個のランダム(x:0〜1.0,y: 0〜1.0 )な位置にある都市をすべて巡回する
• セールスマンがすべての都市を一巡するときの距離が最短となる経路を求める
(「移動距離」や「交通費」に代替え可能)
• 都市数をnとすると、経路総数は(n-1)!になる。
(30都市で約8.8x10**30)
• 現在のコンピュータでは現実的な時間で最適解を見出せない
乱数だけでTSPを解いてみる
全コードはこちら
結果
10万回実行した時点で、
20.78が最高記録
GAでTSPを解いてみる
全コードはこちら
結果
2000世代時点で
6.44が最高記録
今後の研究
・GAで大域的な探索を行いそのあとにNNで許k書的な学習をさ
せるといった組み合わせに期待されている。
→ まだよく理解していない
・何か実用的(現実的)な
巡回セールスマン問題を解いてみたい
→ なんかアイデア出てこない

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Genetic algorithm