New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(graph/tree-centroid.md):增加对重心若干性质的证明 #5431
base: master
Are you sure you want to change the base?
Conversation
purple-vine
commented
Feb 25, 2024
•
edited
edited
- 我已认真阅读贡献指南 (contributing guidelines) 和社区公约 (code of conduct),并遵循了如何参与页及格式手册页的相应规范。
请认真阅读贡献指南 (contributing guidelines) 和社区公约 (code of conduct),并在之后勾选选择框,否则您的 PR 将无法通过 checks。 |
可以的 |
左推右:考虑证明逆否命题,若存在某个 $v$ 使得 $siz(u, v) > n/2$,则 $u$ 不是重心。 | ||
|
||
将根节点换为 $v$,$siz(v, u) = n-siz(u, v) < siz(u, v)$,又 $\displaystyle \sum_{(w, v) \in E, w \neq u} siz(v, w) = siz(u, v) - 1 \Longrightarrow \max_{(w, v) \in E, w \neq u} \{siz(v, w)\} < siz(u, v)$,故以 $v$ 为根的最大子树大小严格小于以 $u$ 为根的最大子树大小,与重心的定义矛盾。 | ||
|
||
右推左:设 $u$ 满足 $\forall (u, v) \in E, siz(u, v) \leq n/2$ 且不为重心,重心为 $v$,考虑 $u,v$ 之间的路径,注意到 $siz(v, u) = n - siz(u, v) \geq n-n/2$ 即 $n-n/2 \leq siz(u, v) \leq n/2$。若 $n$ 不为偶数或者 $siz(u, v) \neq n/2$,矛盾。否则 $u, v$ 为根的最大子树大小相等,均为 $n/2$,与 $u$ 不是重心矛盾。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明明证充分性和必要性都是用的反证法,为什么要用两种不同的说法 🤔
另外,应该用一些比较明显的方式来标识证明内容的范围,比如用 Collapsible Blocks 包起来(参考 https://oi-wiki.org/math/number-theory/lift-the-exponent/)或者单列一小节(参考 https://oi-wiki.org/math/number-theory/inverse/#%E8%AF%81%E6%98%8E)。
|
||
下面证明,树中所有点到某个点的距离和中,到重心的距离和是最小的;如果有两个重心,那么到它们的距离和一样。 | ||
|
||
考虑 $sum(u) = \sum_v dis(u, v)$,其中 $dis(u, v)$ 是 $u$ 到 $v$ 的唯一简单路径的长度。若 $\min_x\{sum(x)\}=sum(u)$,$\forall (u, v) \in E, sum(v)-sum(u) = siz(v, u) - siz(u, v) = n-2siz(u, v) \geq 0$,因此 $u$ 是重心。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里 u 和 v 的取值范围是什么,现在的写法说的是树中任意节点都是重心 🤔
你好 👋 这个 Pull Request 已经 30 天未响应。 感谢理解与支持。 |