Skip to content

Conversation

kmyk
Copy link
Collaborator

@kmyk kmyk commented Apr 1, 2021

close #127
close #139
close #152
close #153

まだ作業中なのですがとりあえずプルリクの形にしておきます。
構成をひっくり返すことになるようなレビューコメントがあるならしてほしいですが、詳しいレビューはまだ待ってください。

プレビュー:

@MiSawa
Copy link
Collaborator

MiSawa commented Apr 1, 2021

燃やす埋めるやPSPに独立したページを与えることは考えましたか?
例えば「強連結成分分解のページに、2-SAT の問題定義と帰着の仕方の解説がある」と同型なことになっている気がします。(が、距離がだいぶ違う気もしなくはないです)

@kmyk
Copy link
Collaborator Author

kmyk commented Apr 1, 2021

燃やす埋めるや PSP に独立なページを与えるのは検討し漏らしていました。
「一方から一方へ帰着可能なだけの異なる問題」だと思えば分けたい気持ちは分かって、しかし距離が近すぎて「具体的な応用テクのひとつ」とか「最小カット問題の問題クラスの部分クラスであって名前が付いたもの」でしかないので埋め込んだ方がよいという気持ちもあります。たとえば「有限体のページに mod 1000000007 の場合の話題がある」のような構造です。

微妙なラインなはずでかなり迷っています。どちらがよいかの意見があれば言ってください。
いま以下のように書かれていて、このような説明の仕方 (帰着可能な異なる問題) でそのまま行くのなら独立なページを与えることになるのかなとは思っています。

競技プログラミングのコミュニティにおいて「燃やす埋める問題」という名前で呼ばれている問題は、最小カット問題に帰着できる問題のひとつである。

@MiSawa
Copy link
Collaborator

MiSawa commented Apr 1, 2021

燃やす埋めるとかPSP自体で記事が立っていたりするのと、コストが非負とは限らない一般の場合でも、劣モジュラになるよう反転出来るならば云々のような話も入れたほうがよさそうだとかを考えると、独立なページを与える価値がありそうな気もします。
ただ、燃やす埋めるとPSPでひたすら同じような話が出てきそうで、どうしたもんかなぁという懸念もあり…

@kmyk kmyk changed the title [WIP] 最大流問題と最小カット問題について記事を足す [WIP] 最大流問題や最小カット問題などについて記事を足す Apr 2, 2021
@kmyk
Copy link
Collaborator Author

kmyk commented Apr 2, 2021

燃やす埋める問題と project selection problem に独立したページを与えました。

ところで、一般の最小カット問題の話題なのに「燃やす埋める問題」という言葉を使っているように見えるブログ記事がいくつかあるように見えて対応に困っています。つまり、「最小カットは「頂点を (S, V \ S) に 2 分割して、s ∈ S, t ∉ S としたときに、{uv | u ∈ S, v ∉ S} の重み和を最小化せよ」という問題」なわけですが、この集合 S のことを「燃やす」と呼んで集合 V \ S のことを「埋める」と呼んで議論しているように見えるブログ記事があります。記号として「燃やす」と「埋める」を使えばなんでも燃やす埋める問題になるわけではないはずなのですが。

@noshi91
Copy link
Owner

noshi91 commented Apr 2, 2021

燃やす埋めると最小カットが近すぎるのが原因だと思います。
燃やす埋めるの厳密な定義は多分存在しない?はずなので

kmyk added 6 commits April 3, 2021 20:24
TODO コメントがまだいくつか
@MiSawa さんが提案してくれたもの:

> 例えば「強連結成分分解のページに、2-SAT の問題定義と帰着の仕方の解説がある」と同型なことになっている気がします。(が、距離がだいぶ違う気もしなくはないです)

という指摘は正しいように聞こえる。
頂点集合として定義される場合と、辺集合 (非連結化集合) として定義される場合とがある。

@noshi91 いつもありがとう

## 注釈

[^project-selection-problem-name]: TODO: 出典を探す
Copy link
Collaborator Author

@kmyk kmyk Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tokoharu さんに問い合わせたところ Algorithm Design (Jon Kleinberg) に乗っているらしいと教えてもらった

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本はまだ確認できてないんですが、時間がかかりそう (図書館へ行かないといけない) なので、issue として立てておいてこのプルリクでは忘れることにしたい。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あとでよむ:

Project Selection Problem (を max flow で解くやつ) の初出,ちらっと調べたらこれな気がしたんだけど,妙に引用が少ないのでよく分からんhttps://t.co/meWFbO2zx4

— つる(競プロ) (@theory_and_me) April 2, 2021

kmyk added 5 commits April 4, 2021 09:36
Algorithm Design (Jon Kleinberg) に乗ってるらしいと @tokoharu さんに教えてもらったため。
実は project selection problem もローカルネームである、という可能性は消えたと見てよい。
参考文献に挙げておきたいけど、少なくとも私はまだ本の中身を確認できてないので控えておく。
2 色で塗り分けるので B := V \ A として (A, B) という気持ちで書いていたが、B は書かれないし arc の A となんとなく衝突するので、source の S の方がよい気がする。
@kmyk kmyk changed the title [WIP] 最大流問題や最小カット問題などについて記事を足す 最大流問題や最小カット問題などについて記事を足す Apr 4, 2021
@kmyk
Copy link
Collaborator Author

kmyk commented Apr 4, 2021

@noshi91 @MiSawa ひとまず完成と言える状態になったと思います。レビューよろしくお願いします。

最大流最小カット定理によって最大流問題の解の流量は最小カット問題の解の容量に等しい。
---

# 最大流問題
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「最大流問題」と「最大フロー問題」のどちらを使うべきかはかなり迷っています。おすすめがあったら教えてほしい。

This comment was marked as off-topic.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

組合せ最適化、アルゴリズムイントロダクション、グラフ・ネットワーク・組合せ論は「最大フロー問題」でした。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。「最大フロー問題」(ついでに「最大フロー」「最大フロー最小カット定理」) で統一するようにしました。

ちなみに「離散凸解析と最適化アルゴリズム」では「最大流問題」(ただし「最大フロー」「最大フロー最小カット定理」) のようです。

最大流最小カット定理によって最大流問題の解の流量は最小カット問題の解の容量に等しい。
---

# 最大流問題
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

組合せ最適化、アルゴリズムイントロダクション、グラフ・ネットワーク・組合せ論は「最大フロー問題」でした。

最小カット問題を考える際にはどの定義を用いても解の容量は同じであるが、カットの定義としてはすべて異なるものである。
(1.) の定義と (2.) の定義との違いはカットの容量の最大値について考えれば明らかである。
(2.) の定義と (3.) の定義とはほとんど同じものであるが、ネットワークが非連結な場合に異なってくる。
(1.) で定義されるものを (2.) や (3.) で定義されるものから区別したいときには、(1.) で定義されるものを $s$-$t$ 非連結化集合 ($s$-$t$ disconnecting) と呼ぶことがある[^s-t-disconnecting]。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s-t disconnecting edge set とかではありませんか? ("非連結化集合" は集合だけれど s-t disconnecting は性質に見えます)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは私の誤訳だったかもしれません (英語力が無くて判断できない)。
For s, t \in V, it is said to be s-t disconnecting, if B intersects each directed s-t path.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

その直前は (s-t でないのは) disconnecting arc set とあり、索引では s-t disconnecting arc set という項目名になっているので、やはり「ほげ集合と呼ぶ」と「ほげであると言う」をノリで同一視しているように思います。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s-t disconnecting edge set に修正しました。


最小カット問題を考える際にはどの定義を用いても解の容量は同じであるが、カットの定義としてはすべて異なるものである。
(1.) の定義と (2.) の定義との違いはカットの容量の最大値について考えれば明らかである。
(2.) の定義と (3.) の定義とはほとんど同じものであるが、ネットワークが非連結な場合に異なってくる。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「異なる」が曖昧な気がしていて、もうちょっと具体的に「一般には多対一対応になる」みたいな書き方のほうがよい気がします。あと、有向なので、非連結でなくても多対一になる場合がって、例えば u は接続する辺が (u, s) のみのとき、2. では区別出来る「u が s 側に属するか否か」が 3. では区別できません。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これも自分のミスです、申し訳ない...

Copy link
Owner

@noshi91 noshi91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カットの定義色々が辺の重みが負の時に事情が変わると思いますが、ネットワークというと非負実数ですか?


## 概要

problem selection problem とは、次の形の問題である:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

problem

project

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

うっかりしていました……

こうしてできるネットワーク上での最小カットの容量を $F$ とすると project selection problem の答えは $\sum_i a_i - F$ となる。
このネットワークを図示すると以下のようになる。

![project selection problem のネットワーク](assets/img/project-selection-problem.svg)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y_{N-1}, b_{N-1}

y_{M-1}, b_{M-1}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直しました。ついでに N と M が異なるかもしれないことが分かりやすいように頂点の位置をずらしておきました。

- [最小カット問題](/minimum-cut-problem)
- 最大流最小カット定理によって最大流問題の解の流量は最小カット問題の解の容量に等しい。
- [Dinic 法](/dinic)
- Dinic 法は最大流問題を解くアルゴリズムである。最悪計算量は $O(\lvert V \rvert^2 \cdot \lvert E \rvert)$ だが実用的にはかなり速い。
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O だとやや違和感がありますが、Θ で評価できるのかが分からない (Dinic の最悪ケースに詳しくないため)。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これの真ん中あたりのネットワークで、k^2=Θ(m), p = Θ(n) となるように k と p を調節すれば良さそうな気がします。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pk=O(m) も必要なのでもうちょっと非自明でした。s 全体と t 全体の前後にノードを一つずつ、計 4 つ追加して、u/v と s/t 間の辺はそいつらを経由させるとかですかね 🤔

## 概要

最大流問題とは、与えられたネットワークのフローであって流量が最大のものを求めるという問題である。
最大流最小カット定理によって最大流問題の解の流量は[最小カット問題](/minimum-cut-problem)の解の容量に等しい。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最大流問題と最小カット問題が双対であることにも言及しておいたほうがよいかもしれません。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに書いておきたいです。(あまりよく理解してないから曖昧にして逃げてしまっていました……)

しかし「最大流問題と最小カット問題が双対であること」と「最大流最小カット定理が成り立つこと」の関係を私はあまり理解できてないので教えてほしいです。
「最大流問題と最小カット定理とは双対である。しかも、最大流最小カット定理が成り立つ」なのか「最大流問題と最小カット定理とはある特定の関係 (何?) にある問題である 。最大流最小カット定理が成り立つ。よって最大流問題と最小カット定理とは双対だと言える」なのか、どちらでしょうか? なんとなく後者なのかなとは思っていますが、自信はないです。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大雑把に言うと、

一般に、線形計画問題のインスタンス(主問題)に対し、その双対問題というものがあり、主も双対も feasible であれば両方 bounded でその最適解が一致することが知られています。(強双対定理)
ところで、任意の容量と s, t 付きのネットワークに対し、それ上の最大流問題の線形計画問題としての定式化(の一つ)と、最小カット問題の線形計画問題としての定式化(の一つ)は、互いに双対になります。
最大流も最小カットも、任意の(s!=tな)インスタンスが feasible なので、強双対定理から両者の最適解は一致します。

です。大抵の場合、強双対定理という大道具は使わず、アルゴリズムを持ってきてその有限性の証明とかで独立に示しますが。
「最大フロー問題と最小カット問題は線形計画問題としての双対問題であり、強双対定理からその最適解が一致する。これは特に最大フロー最小カット定理と呼ばれる。」あたりが普通の説明かなぁと思います。

## 外部リンク

- [『燃やす埋める』と『ProjectSelectionProblem』 - とこはるのまとめ](http://tokoharuland.hateblo.jp/entry/2017/11/12/234636)<sup>[archive.org](https://web.archive.org/web/20210401023114/http://tokoharuland.hateblo.jp/entry/2017/11/12/234636)</sup>
- <a class="handle">tokoharu</a> によるブログ記事。燃やす埋める問題という問題ではなく project selection problem という別の問題を利用することを提案している。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この記事が PSP なので「という別の」は不自然だと思います。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに

- $N$ 個のプロジェクト $x_0, x_1, x_2, \dots, x _ {N-1}$ と $M$ 個の機械 $y_0, y_1, y_2, \dots, y _ {M-1}$ がある。
プロジェクト $x_i$ を実行すると利益 $a_i$ 円 ($a_i \ge 0$) を産む。
機械 $y_j$ は購入に費用 $b_j$ 円 ($b_j \ge 0$) かかる。
さらに、プロジェクト $x _ {c_k}$ を実行するためは機械 $y _ {d_k}$ が購入されていなければならないという形の条件が $K$ 個与えらている。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ、条件がコスト有限の形だと PSP ではないんですかね?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wikipedia の記述を信用してよいならば、条件がコスト有限の形だと PSP ではないようです。問題のストーリー的にも条件に有限のコストが付くのは不自然な気がします。
論文があるらしいので後で (かつ merge より前に) 確認しておきます。

kmyk added 2 commits April 6, 2021 23:19
-   `scripts/lint.py` にも足しておいた
-   「最大流量」だけは「最大」+「流量」なのでそのまま
kmyk added 4 commits April 6, 2021 23:35
-   y_{N-1}, b_{N-1} でなくて y_{M-1}, b_{M-1} にする
-   N と M が異なるかもしれないことが分かりやすいように頂点をずらしておく
Copy link
Collaborator Author

@kmyk kmyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すぐ直せそうなところは先に直しました。落ち着いて考えないと直せないところはまだです。

最大流最小カット定理によって最大流問題の解の流量は最小カット問題の解の容量に等しい。
---

# 最大流問題
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。「最大フロー問題」(ついでに「最大フロー」「最大フロー最小カット定理」) で統一するようにしました。

ちなみに「離散凸解析と最適化アルゴリズム」では「最大流問題」(ただし「最大フロー」「最大フロー最小カット定理」) のようです。

最小カット問題を考える際にはどの定義を用いても解の容量は同じであるが、カットの定義としてはすべて異なるものである。
(1.) の定義と (2.) の定義との違いはカットの容量の最大値について考えれば明らかである。
(2.) の定義と (3.) の定義とはほとんど同じものであるが、ネットワークが非連結な場合に異なってくる。
(1.) で定義されるものを (2.) や (3.) で定義されるものから区別したいときには、(1.) で定義されるものを $s$-$t$ 非連結化集合 ($s$-$t$ disconnecting) と呼ぶことがある[^s-t-disconnecting]。
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s-t disconnecting edge set に修正しました。


## 概要

problem selection problem とは、次の形の問題である:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

うっかりしていました……

- $N$ 個のプロジェクト $x_0, x_1, x_2, \dots, x _ {N-1}$ と $M$ 個の機械 $y_0, y_1, y_2, \dots, y _ {M-1}$ がある。
プロジェクト $x_i$ を実行すると利益 $a_i$ 円 ($a_i \ge 0$) を産む。
機械 $y_j$ は購入に費用 $b_j$ 円 ($b_j \ge 0$) かかる。
さらに、プロジェクト $x _ {c_k}$ を実行するためは機械 $y _ {d_k}$ が購入されていなければならないという形の条件が $K$ 個与えらている。
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wikipedia の記述を信用してよいならば、条件がコスト有限の形だと PSP ではないようです。問題のストーリー的にも条件に有限のコストが付くのは不自然な気がします。
論文があるらしいので後で (かつ merge より前に) 確認しておきます。

こうしてできるネットワーク上での最小カットの容量を $F$ とすると project selection problem の答えは $\sum_i a_i - F$ となる。
このネットワークを図示すると以下のようになる。

![project selection problem のネットワーク](assets/img/project-selection-problem.svg)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直しました。ついでに N と M が異なるかもしれないことが分かりやすいように頂点の位置をずらしておきました。

## 外部リンク

- [『燃やす埋める』と『ProjectSelectionProblem』 - とこはるのまとめ](http://tokoharuland.hateblo.jp/entry/2017/11/12/234636)<sup>[archive.org](https://web.archive.org/web/20210401023114/http://tokoharuland.hateblo.jp/entry/2017/11/12/234636)</sup>
- <a class="handle">tokoharu</a> によるブログ記事。燃やす埋める問題という問題ではなく project selection problem という別の問題を利用することを提案している。
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに

## 概要

最大流問題とは、与えられたネットワークのフローであって流量が最大のものを求めるという問題である。
最大流最小カット定理によって最大流問題の解の流量は[最小カット問題](/minimum-cut-problem)の解の容量に等しい。
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに書いておきたいです。(あまりよく理解してないから曖昧にして逃げてしまっていました……)

しかし「最大流問題と最小カット問題が双対であること」と「最大流最小カット定理が成り立つこと」の関係を私はあまり理解できてないので教えてほしいです。
「最大流問題と最小カット定理とは双対である。しかも、最大流最小カット定理が成り立つ」なのか「最大流問題と最小カット定理とはある特定の関係 (何?) にある問題である 。最大流最小カット定理が成り立つ。よって最大流問題と最小カット定理とは双対だと言える」なのか、どちらでしょうか? なんとなく後者なのかなとは思っていますが、自信はないです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants