Operations Researchの手法はソフトウェアとしてまとめられています。手軽に使えるのが Google OR-toolsです。下記に解説があります。
https://www.issoh.co.jp/tech/details/3477/
pythonの場合はpip install ortools で使えるようです。例として、計算量が多くなり面倒な「整数計画法 integer programming」を取り上げましょう。本家のチュートリアルは下記です。やってみましたが、web上のGoogle Colaboratoryで動きます。
https://developers.google.com/optimization/mip/mip_example?hl=ja
例題は、x,yを整数として、x+10yを最大化するものを求めよ、ただし x+7y<=17.5 その他条件がある(略)、というもので、条件は
solver.Add(x + 7 * y <= 17.5)
のようにsolverというclass instanceに食べさせて
solver.Maximize(x+10y) で問題を設定
solver.Solve() 解け
といれれば勝手に制約に当てはまる答を出してくるというものです。
上記チュートリアルにありますが、整数値であるという条件を外すと全然違う(x,y)が答となり、その近くで整数値(x,y)を探すと最適解が見つかりません。
人数の割り当てなどの整数値が必要な時には役立ちます。
自分で一からプログラムを書くには結構面倒な思考が必要で時間がかかりますが、ortoolsというライブラリを使えばすぐできます。
これまではライブラリをどう使うかは覚えなければならず、プログラミングが記憶力勝負になっていたのですが、AIの登場でその部分が要らなくなっています。これは弁護士の業務とAIの関係に似ていると思います。先日読んだ記事でAIはいかにもありそうな法律の条文を勝手に創造して答弁書をつくることがあるので必ず条文の確認が必要だ、ということでした。プログラミングでは特異な入力値で誤動作するバグがある可能性もあります。自動テストの技法もいろいろ開発されていますが、少なくとも小規模なプログラムは人間が読んでチェックすべきだと思います。
大規模なCPUなどのハードウェアもAIが設計に関与しています。最後は人間がチェックしていると思いますが、今後どうなるかわかりませんね。
ハードウェアとソフトウェアの中間にあるのが自動運転です。自動運転の重大事故が立て続けに起こっているので、対策が必要だと思います。
https://www.youtube.com/watch?v=E9Po8gbRCNw
英語は https://en.wikipedia.org/wiki/Self-driving_car
“A self-driving car, also known as an autonomous car (AC), driverless car, robotic car or robo-car, is a car that is capable of operating with reduced or no human input.”
autonomous オー「ト」ノマス 自律の
cf. automatic オートマティック 自動の a automatic door 自動ドア
https://www.cat.com/en_US/articles/ci-articles/automation-autonomy-whats-the-difference.html の解説は下記。
Automation: a noun – refers to a set of related functions performed automatically by equipment. Automation assumes that the operator performs any requirements before or after the automated sequence in order to complete the task. Multiple automation sequences are required to enable equipment to work semi-autonomously or autonomously.
Autonomy: a noun – refers to a state of equipment in which it can perform the programmed operations under defined conditions without human input or guidance. When we talk about this type of equipment, we use the adjective, autonomous. For example, some mines run autonomous trucks. 「自律」には複数の「自動」が組み合わさる必要がある
refers to ~のこと。
”The first semi-autonomous car was developed in 1977, by Japan’s Tsukuba Mechanical Engineering Laboratory.” ※半自動運転は日本が最初だそうです。
”ACs must be able to predict the behavior of possibly moving vehicles, pedestrians, etc, in real time in order to proceed safely. The task becomes more challenging the further into the future the prediction extends, requiring rapid revisions to the estimate to cope with unpredicted behavior. One approach is to wholly recompute the position and trajectory of each object many times per second. Another is to cache the results of an earlier prediction for use in the next one to reduce computational complexity.”
pedestrians 歩行者
to cope with ~に対処する
unpredicted behavior 予想されないふるまい
trajectory 軌道
cache キャッシュ 一時的に蓄える