9 Relations 关系
《离散数学及其应用 第八版》(Discrete Mathematics and Its Application 8th Edition)第九章
9.6 Patrial Order 偏序关系
A relation R on a set A is called a partial order if R is reflexive, antisymmetric, and transitive.
如果一个关系满足:
-
自反性
-
反对称性
-
传递性
则这个关系称为偏序关系(Partical Order)
The set A together with the partial order R is called a partially ordered set, or simply a poset, and we will denote this poset by (A, R)
偏序关系和其集合共同构成偏序集(poset),记为
例如
is not a poset
9.6.1 几类偏序关系
Comparability 可比性
If is a poset, the elements a and b are said to be
comparable if or
incomparable if neither nor
两个元素间存在偏序关系则称两个元素可比(comparable),不存在偏序关系则称不可比(incomparable)
Linear order 线序关系(全序关系)
If every pair of elements in a poset A is comparable, we say that A is called a totally ordered or linearly ordered set, and the partial order is called a totally order or linear order. We also say that A totally ordered set is a chain.
线序关系满足:
- 集合内两两元素都可比
线序关系用哈斯图表示出来是一条链
例如:
-
任何两个元素都是可比的,是链
-
有些元素不可比,不是链
Well-ordered set 良序
is a well-ordered set if it is a poset such that is a total ordering and every nonempty subset of has at least element.
每一个非空集合都能找到最小元素的全序集称为良序集(well-ordered set)
推论:
-
有限关系集合的全序集一定是良序集
-
无限关系集合的全序集不一定是良序集
例如:
-
是良序集,任何子集总能找到最小元
-
不是良序集,因为 的负整数子集没有最小元
Quasiorder 拟序关系
A relation R on a set A is called quasiorder if it is transitive and irreflexive
满足:
-
传递性
-
反自反性
的关系称为拟序关系(quasiorder)
例如
拟序具有反对称性
如 为拟序,则 为偏序。偏序是拟序的扩展,拟序是偏序的缩减。
Product partial order 乘积偏序
If and are posets, then is a poset, with partial order defined by if in and in .
This ordering is called product partial order.
乘积偏序要满足有序对的第一元素和第二元素分别满足偏序关系
Lexicographic Order 字典序
If and are posets, then is a poset, with partial order defined by if or if and .
This ordering is called lexicographic or "dictionatry" order.
Extented to Cartesian produxts .
词典顺序:首先比较第一元素,依次比较第二元素
看下面这个例子:
蓝色部分是字典序小于 (3, 4) 的有序对,红色方框内的是乘积偏序小于等于 (3, 4) 的有序对。
Covering Relation 覆盖关系
Let be a poset. We say that an element covers an element if and there is no element such that . The set of pairs such that covers is called the covering relation of
覆盖关系是由偏序集中两个有直接关系的元素构成的有序对组成的集合
9.6.2 哈斯图
Hasse Diagrams 哈斯图的构造
Hasse Diagrams is the diagraph of a partial order on a finite set A that
- deletes all self-cycles
- eliminates all edges that are implied by the transitive property
- draws the diagraph with all edges pointing upward
哈斯图以简洁的方式表示出偏序集中元素之间的关系。
从有向图表示的偏序关系改为哈斯图分三步:
-
删除自环
-
取消传递性而来的边
-
边方向向上
根据覆盖关系求偏序
若已知一个覆盖关系,其实就是相当于已知了哈斯图,由哈斯图反演出有向图表示的偏序关系即为求覆盖关系的偏序的过程,分两步:
-
恢复传递边:利用 Warshall 算法在关系矩阵上生成传递闭包
-
恢复自环:给主对角线上的 0 全部变为 1
9.6.4 偏序集的重要元素
Maximal(miminal) element 极大(极小)元
An element a A is called a maximal element of A if there is no element c in A such that a < c.
An element b A is called a minimal element of A if there is no element c in A such that c < b.
-
极大元就是比选定子集任何一个元素都要靠后的元素,只能在子集内中找
-
极小元就是比选定子集任何一个元素都要靠前的元素,只能在子集内中找
注意:极大极小元并不唯一,且同一元素既可能是极大元,又可能是极小元
例如:
定理:有限非空偏序集,集合 A 至少有一个极大元和一个极小元
Greatest (least) element 最大元(最小元)
定义:偏序集 中,子集 ,
-
若 ,对 都有 则 为 的最大元
-
若 ,对 都有 则 为 的最小元
注意:最大元和最小元都在子集 A 中找。
子集 A 的最大元或最小元如果存在,则与 A 中的任意元素必须可比
有时候最大最小元可能不存在:
如果 A 是全集,则
-
最大元通常用 1 表示,称为单位元
-
最小元通常用 0 表示,称为零元
lub 最小上界 glb 最大下界
pose A and a subset B (B is a subset of A)
An element a A is called a upper bound of B is b a for all b B.
An element a A is called a upper bound of B is a b for all b B.
-
子集 B 的最小上界(least upper bound)就是比 B 任何一个元素都要靠后的第一个元素,是在全集中找,有可能在子集内也可能在子集外
-
子集 B 的最大下界(greatest lower bound)就是比 B 任何一个元素都要靠前的第一个元素,是在全集中找,有可能在子集内也可能在子集外
总结
-
有限非空集合极大元、极小元各至少一个
-
最大元、最小元各最多一个
-
子集的最小上界、最大下界各最多一个
9.6.5 拓扑排序
Topological Sorting 拓扑排序
A total ordering is said to be compatible with the partial ordering R if a b whenever aRb. Constructing a compatible total ordering from a partial /ordering is called topological sorting.
一个偏序集可能给出多个不同的拓扑排序
二元关系思维导图
9.6.6 格
Lattices 格的定义
A lattice is a poset in which every subset {a, b} consisting of two elements has a least upper bound (l.u.b) and a greatesr lower bound (g.l.b)
denote l.u.b({a, b}) by and call it the join of a and b
denote g.l.b({a, b}) by and call it the meet of a and b
-
格是任意两个元素构成的子集都有最小上界和最大下界的偏序集
-
用并表示两个元素构成子集的 l.u.b ,用交表示两个元素构成子集的 g.l.b
定理:两个格的氏积也是一个格
子格(sublattice)类比子集的定义
Properties of lattices 格的性质
格是特殊的偏序,所以格具有偏序的所有性质
特性:格的 l.u.b 和 g.l.b 都是唯一的
定理:
Let L be a lattice. Then for every a and b in L,
-
if and only if
-
if and only if
-
if and only if
Special types of lattices 几种特殊的格
有界格
如果格存在一个最大元 1 ,一个最小元 0 ,则这个格是有界格。最大元和最小元唯一。
所有有限格都是有界格
分配格
任意元素之间的 l.u.b 和 g.l.b 都符合分配律的格称为分配格。
如果一个格的子格与上述两个特殊的格任何一个同构的,则不是分配格
补元(Complement)
有补格
一个有界格中,如果每个元素都有补元,则称之为有补格。
模格
L 是模格,当且仅当不含与五角格同构的子格。
Lattices:
-
modular
- distributive
- nondistributive
-
nonmodular