SlideShare a Scribd company logo
1 of 23
Download to read offline
Genetic Algorithm
Charles Darwin
Genetic Algorithm
https://www.khanacademy.org/science/ap-biology/natural-selection/natural-selection-ap/a/darwin-evolution-natural-selection
Genetic Algorithm
https://www.khanacademy.org/science/ap-biology/natural-selection/natural-selection-ap/a/darwin-evolution-natural-selection
Genetic Algorithm
Genetic Algorithm
https://mammothmemory.net/biology/characteristics-and-classifications/classification/classification-should-reflect-evolutionary-relationships.html
Genetic Algorithm
Prescriptive
Genetic Algorithm
Best Overall Product Strategy
Partners Product A Product B Product C
1 70K 60K 60K
2 0 80K 70K
3 90K 90K 80K
4 50K 50K 50K
5 100K 100K 100K
6 110K 130K 150K
7 20K 20K 90K
8 10K 40K 80K
9 0 50K 60K
10 40K 40K 80K
• ตัวเลขคือค่า Prediction ของ Partners
แต่ละรายและยอดขายที่สามารถทำได้
• เลือก Partner ที่มาช่วยทำตลาด
• 1 Product เลือก Partners ได้ 3 ราย
• Maximize total score
Best Overall Product Strategy
Partner Product A Product B Product C
1 70K 60K 60K
2 0 80K 70K
3 90K 90K 80K
4 50K 50K 50K
5 100K 100K 100K
6 110K 130K 150K
7 20K 20K 90K
8 10K 40K 80K
9 0 50K 60K
10 40K 40K 80K
Total 260K 260K 250K
• ตัวเลขคือค่า Prediction ของ Partners
แต่ละรายและยอดขายที่สามารถทำได้
• เลือก Partner ที่มาช่วยทำตลาด
• 1 Product เลือก Partners ได้ 3 ราย ที่
เห็นว่าทำได้ดีที่สุดโดยไม่ซ้ำกัน
• Maximize total score
= 770K
Best Overall Product Strategy
Partner Product A Product B Product C
1 70K 60K 60K
2 0 80K 70K
3 90K 90K 80K
4 50K 50K 50K
5 100K 100K 100K
6 110K 130K 150K
7 20K 20K 90K
8 10K 40K 80K
9 0 50K 60K
10 40K 40K 80K
Total 260K 260K 250K
• รายการที่ 6 และ 9 ไม่ได้ถูกเลือกค่าสูงที่
สุดแต่เลือกค่าเพื่อให้ Total Score สูงสุด
• การคำนวณด้วยมือยากมากหาก
• จำนวน Partners มากว่า 100 ถึง
1,000 Partners
• จำนวน Products มีจำนวนมาก
• มี Conditions ที่ซับซ้อนขึ้น
= 770K
https://github.com/krmonline/geneticAlgorithm/blob/main/genetic_algorithm.ipynb
Technique
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1
1 Product A
2 Product A
3 Product A
4 Product B
5 Product B
6 Product B
7 -
8 Product C
9 Product C
10 Product C
Total 660K
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1 Random #2
1 Product A Product C
2 Product A Product C
3 Product A Product C
4 Product B Product A
5 Product B Product B
6 Product B Product A
7 - Product B
8 Product C Product A
9 Product C Product B
10 Product C -
Total 660K 670K
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1 Random #2
1 Product A Product C
2 Product A Product C
3 Product A Product C
4 Product B Product A
5 Product B Product B
6 Product B Product A
7 - Product B
8 Product C Product A
9 Product C Product B
10 Product C -
Total 660K 670K
Random #100
Product C
Product A
Product C
Product A
Product B
Product B
Product C
-
Product A
Product B
550K
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1 Random #2
1 Product A Product C
2 Product A Product C
3 Product A Product C
4 Product B Product A
5 Product B Product B
6 Product B Product A
7 - Product B
8 Product C Product A
9 Product C Product B
10 Product C -
Total 660K 670K
Random #100
Product C
Product A
Product C
Product A
Product B
Product B
Product C
-
Product A
Product B
550K
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1 Random #2
1 Product A Product C
2 Product A Product C
3 Product A Product C
4 Product B Product A
5 Product B Product B
6 Product B Product A
7 - Product B
8 Product C Product A
9 Product C Product B
10 Product C -
Total 660K 670K
Random #100
Product C
Product A
Product C
Product A
Product B
Product B
Product C
-
Product A
Product B
550K
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1
1 Product A
2 Product A
3 Product A
4 Product B
5 Product B
6 Product B
7 -
8 Product C
9 Product C
10 Product C
Total 660K
Random #101
Product A
Product B
Product A
Product B
Product B
Product A
-
Product C
Product C
Product C
550K
Mutation/Cross Over
ขั้นตอนการว+เคราะหดŒวย Genetic Algorithm
Partner Random #1 Random #2
1 Product A Product C
2 Product A Product C
3 Product A Product C
4 Product B Product A
5 Product B Product B
6 Product B Product A
7 - Product B
8 Product C Product A
9 Product C Product B
10 Product C -
Total 660K 670K
Random #100
Product C
Product A
Product C
Product A
Product B
Product B
Product C
-
Product A
Product B
550K
Random #101
Product A
Product A
Product A
Product B
Product B
Product B
-
Product C
Product C
Product C
550K
ตัวอย‹างการว+เคราะห Genetic Algorithm #2
• หาพื้นที่แหล่งจ่ายน้ำ
ครอบคลุมพื้นโดยซ้ำกันน้อย
ที่สุด
https://github.com/krmonline/geneticAlgorithm/blob/main/geneticArea.ipynb
Question?
Genetic Algorithm

More Related Content

More from Chakrit Phain

PHP Explode & Preg_split Test
PHP Explode & Preg_split TestPHP Explode & Preg_split Test
PHP Explode & Preg_split TestChakrit Phain
 
Types of Big Data Analytics
Types of Big Data AnalyticsTypes of Big Data Analytics
Types of Big Data AnalyticsChakrit Phain
 
Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021Chakrit Phain
 
Text classification With Rapid Miner
Text classification With Rapid MinerText classification With Rapid Miner
Text classification With Rapid MinerChakrit Phain
 
Ai optimization Example
Ai optimization ExampleAi optimization Example
Ai optimization ExampleChakrit Phain
 
Anomaly Detection Technique
Anomaly Detection TechniqueAnomaly Detection Technique
Anomaly Detection TechniqueChakrit Phain
 
Softnix Anomaly Detection Methods
Softnix Anomaly Detection MethodsSoftnix Anomaly Detection Methods
Softnix Anomaly Detection MethodsChakrit Phain
 
Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้Chakrit Phain
 
Softnix how ml_work_0.1draft
Softnix how ml_work_0.1draftSoftnix how ml_work_0.1draft
Softnix how ml_work_0.1draftChakrit Phain
 
Hierarchical clustering
Hierarchical clusteringHierarchical clustering
Hierarchical clusteringChakrit Phain
 
Artificial neural nework classification example
Artificial neural nework classification exampleArtificial neural nework classification example
Artificial neural nework classification exampleChakrit Phain
 
Syslog-ng Performance
Syslog-ng Performance Syslog-ng Performance
Syslog-ng Performance Chakrit Phain
 
Configuration management
Configuration managementConfiguration management
Configuration managementChakrit Phain
 
Social Network Analysis
Social Network AnalysisSocial Network Analysis
Social Network AnalysisChakrit Phain
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulationChakrit Phain
 

More from Chakrit Phain (19)

PHP Explode & Preg_split Test
PHP Explode & Preg_split TestPHP Explode & Preg_split Test
PHP Explode & Preg_split Test
 
Types of Big Data Analytics
Types of Big Data AnalyticsTypes of Big Data Analytics
Types of Big Data Analytics
 
Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021
 
Text classification With Rapid Miner
Text classification With Rapid MinerText classification With Rapid Miner
Text classification With Rapid Miner
 
Ai optimization Example
Ai optimization ExampleAi optimization Example
Ai optimization Example
 
Zabbix aws
Zabbix awsZabbix aws
Zabbix aws
 
Anomaly Detection Technique
Anomaly Detection TechniqueAnomaly Detection Technique
Anomaly Detection Technique
 
Softnix Anomaly Detection Methods
Softnix Anomaly Detection MethodsSoftnix Anomaly Detection Methods
Softnix Anomaly Detection Methods
 
Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้
 
Softnix how ml_work_0.1draft
Softnix how ml_work_0.1draftSoftnix how ml_work_0.1draft
Softnix how ml_work_0.1draft
 
Shell Shock
Shell ShockShell Shock
Shell Shock
 
Neo4j introduction
Neo4j introductionNeo4j introduction
Neo4j introduction
 
Hierarchical clustering
Hierarchical clusteringHierarchical clustering
Hierarchical clustering
 
Artificial neural nework classification example
Artificial neural nework classification exampleArtificial neural nework classification example
Artificial neural nework classification example
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Syslog-ng Performance
Syslog-ng Performance Syslog-ng Performance
Syslog-ng Performance
 
Configuration management
Configuration managementConfiguration management
Configuration management
 
Social Network Analysis
Social Network AnalysisSocial Network Analysis
Social Network Analysis
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 

Genetic Algorithm