Submit Search
Upload
巡回セールスマン
•
Download as PPTX, PDF
•
0 likes
•
585 views
ga sin
Follow
TSG用
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 10
Download now
Recommended
Argmax Operations in NLP
Argmax Operations in NLP
Hitoshi Nishikawa
Faster matroid intersection
Faster matroid intersection
ga sin
Veri2048
Veri2048
ga sin
Image net classification with deep convolutional neural network
Image net classification with deep convolutional neural network
ga sin
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
Recommended
Argmax Operations in NLP
Argmax Operations in NLP
Hitoshi Nishikawa
Faster matroid intersection
Faster matroid intersection
ga sin
Veri2048
Veri2048
ga sin
Image net classification with deep convolutional neural network
Image net classification with deep convolutional neural network
ga sin
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
More Related Content
Featured
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Featured
(20)
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO 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)
How 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 Insights
Trends 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 summary
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
Google'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
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The 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...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
巡回セールスマン
1.
gasin contest
2.
問題 • 頂点数1000の有向完全グラフが与えられます(辺の情報は見る ことができます)。頂点0から始めて全ての頂点を一度だけ通 り頂点0に戻ってくる経路のうち、できるだけ短いものを求め よ。 • つまり、巡回セールスマン問題 •
以下のリンクにジャッジ用のコードとサンプルのコードがある ので、始めたい人は始めてください • https://github.com/gasin/procon1
3.
巡回セールスマン問題とは • NP困難と呼ばれるクラスに含まれる問題。 • 僕もよく理解していないが、とにかく効率的なアルゴリズムが 存在しない問題。 •
頂点数が1000などというサイズの問題が解けるわけがない • 競プロなどにおいて巡回セールスマン問題が出るときの頂点数 はせいぜい12ぐらい。
4.
巡回セールスマン問題(n<=12のとき) • bitDPというテクニックを使うことで解くことができる。(詳 しくは蟻本を参照) • 計算量はO(n*2^n) •
アイディアとしては、今いる頂点と、それまでに訪れた頂点の 情報が分かっていれば十分なので、経路を全て記憶している必 要がないということを利用してうまくDPをする。
5.
では、どうするか • このような問題はマラソンと呼ばれる長期間のコンテストで出 題されるような問題であり、最適解を求めることは諦めて、極 力よい解を求めるように頑張る。 • いきなり言われても難しいと思うので、いくつか有名な手法を 紹介します。(僕もマラソンは専門外なので詳しくないです が)
6.
貪欲(ヒューリスティック) • よさそうな戦略を決めて、それを実装するだけ。シンプルだけ ど戦略が強ければもちろん強いのでやってみる価値はあるしこ れで勝てちゃうこともあるかもしれない。(ほとんどないけ ど) • 例えば、今回の巡回セールスマン問題においては今いる頂点か ら生えている辺のうち最小コストの辺を選択するなどがこれに あたる。(もちろん、条件を満たすように辺は選ぶ)
7.
山登り法 • その場その場でより良いスコアへの改善を探索し、良いスコアを見 つけたらそれを採用するという操作を繰り返す。 • しかし、局所解に陥りやすいので工夫が必要になる。(しかし、そ こそこのコンテストだとこれだけでなんとかなったりする) •
今回の場合に適用すると、適当に経路を定め、その頂点を適当に swapするなどして、もとの経路よりもコストが小さくなればそれを 採用するということを繰り返すなどの方法が考えられる。 • 上位互換として、焼きなまし法という方法があり、これは局所解に 陥りにくくしたもの。(温度という概念を導入し、現在の解よりも 悪くてもそれをある確率で採用するという操作を行う)
8.
ビームサーチ • マラソン系のコンテストにおいて、最も使われている手法(多 分)。派生系もたくさんある(chokudai searchなど)。 •
探索をするときに、全探索をするとメモリや時間が足りなくな るので、そこを工夫しようというもので、よさそうな解をいく つかだけ採用して他の場合を切り捨てるという考え方。 • いくつ採用するのか(ビームの幅)、よさそうとはなんなのか (評価関数)など、考えることは多いので扱いが難しいといえ ば難しい。 • 今回の問題で言えば、i頂点からなる経路のうち、短い経路を10 個だけ採用するなど。
9.
頑張りましょう • これらのテクニックはもちろん、複合することもできたりする ので色々と工夫してみましょう。 • どの方法をとるにしても、試行回数は多ければ多い方が良いに 決まっているので、高速化や自動化は実装したほうが結果的に はよいです。 •
また、数字が大きいので基本的にlong long型を使ったほうがい です。 • 経路の候補は1000!(2568桁らしい)もあり、最適解なんか求 まるわけもないので良い解が出ても、もっと良い解があるはず だと思って改善を続けましょう。
10.
最後に • 一応、僕が出した最短経路のスコアは4763774です。 • 超えたぜという人は宣言してください。
Download now