Sie sind auf Seite 1von 13

Partial Order Relations

We defined three properties of relations: reflexivity, symmetry


and transitivity.
A fourth property of relations is anti-symmetry.

Definition of Antisymmetry::
Let R be a relation on a set A, R is antisymmetric if , and only if,
for all a and b in A, if a R b and b R a then a=b.

Testing for Antisymmetry of finite Relations:


Let R1 and R2 be the relations on {0, 1, 2} defined as follows:
a- R1= { (0,2 ), (1, 2), (2, 0)}
b- R2 = { (0,0), (0, 1), (0, 2), (1, 1), (1, 2)}
Draw a directed graph for R1 and R2 and indicate which relation
is antisymmetric?

a- R1 is not antisymmetric
b- R2 is antisymmetric

Testing for Antisymmetry of “Divides” relations.

Let R1 be the “divides” relation on the set of all positive integers,


and let R2 be the “divides” relation on the set of all integers.

For all a, b ∈ Z+, a R1 b ⇔ a | b

For all a, b ∈ Z, a R2 b ⇔ a | b
a- Is R1 antisymmetric ? Prove or give a counterexample
b- Is R2 antisymmetric ? Prove or give a counter example.

Solution:

-R1 is antisymmetric
-R2 is not antisymmetric

Partial Order Relations:

Let R be a binary relation defined on a set A. R is a partial order


relation if, and only if, R is reflexive, antisymmetric and
transitive.

Two fundamental partial order relations are the “less than or


equal to” relation on a set of real numbers and the “subset”
relation on a set of sets.

The “Subset” Relation:


Let A be any collection of sets and define the subset relation ⊆
on A as follows:
For all U, V ∈ A
U ⊆ V ⇔ for all x, if x ∈ U then x ∈ V.

Show that ⊆ is a partial order?

- Reflexive
For ⊆ to be reflexive means that U ⊆ U . U ⊆ U means that U ⊂
U or U= U and U=U is always true.
- Transitive
U⊆ V&V⊆ W⇒ U⊆ W
U⊆ V ⇔ for all x, if x ∈ U then x ∈ V.
V⊆ W ⇔ for all y, if y ∈ V then y ∈ W.
Let x be an arbitrary element of U ⇒ x ∈ V (definition of
subset) ⇒ x ∈ W.
Since this is true for an arbitrary element of U, it is true of all
elements of U ⇒ U ⊆ W
- Antisymmetric
For ⊆ to be antisymmetric means that for all sets U and V in A if
U ⊆ V & V ⊆ U then U=V. Which is true by definition of
equality of sets.

Prove that the Divides Relation on a Set of Positive Integers is a


partial order.
Prove that the “Less Than or Equal to” Relation is a partial order.

Lexicographic Order

To figure out which of two words comes first in an English


dictionary, you compare their letters one by one from left to
right. If all letters have been the same to a certain point and one
word runs out of letters, that word comes first in the dictionary.
For example, play comes before playhouse.
If all letters up to a certain point are the same and the next letter
differs, then the word whose next letter is located earlier in the
alphabet comes first in the dictionary. For instance, playhouse
comes before playmate.
Notation:
Because of the special paradigm role played by the relation ≤ in
the study of partial order relations, the symbol p is often used to
refer to a general partial order relation
More generally, if A is any set with a partial order relation, then a
dictionary or lexicographic order can be defined on a set of
strings over A as indicated in the following

Theorem :

Let A be a set with a partial order relation R and let S be a set of


strings over A. Define a relation p on S as follows:

For any positive integer m and n and a1a2…am and b1b2…bn in S


1. if m ≤ n and ai= bi for all i=1, 2, …, m then
a1.a2….am ≤ b1b2…bn

2. If for some integer k with k ≤ m , k ≤ n and k ≥ 1, ai=bi for all


i=1, 2,…k-1,
and ak R bk but ak ≠ bk then a1.a2….am ≤ b1b2…bn
3. if ε is the null string and s any string in S, then ε ≤ s

Definition:

The partial relation of the above theorem is called a lexicographic


order for S that corresponds to a partial order R on A.
Hasse Diagram

Let A= {1, 2, 3, 9, 18} and considers the “divides” relation on A:

For all a, b ∈ A a | b ⇔ b=k.a for some integer k.

Draw the directed graph of this relation

Note :

There is a loop on every vertex, all other arrows point to the same
direction.
At any time there is an arrow from one point to a second and from
the second point to a third, there is an arrow from the first point to
the third.

In order to represent this relation using a simpler graph, we use a


Hasse Diagram, with a partial order relation defined on a finite
set.
To obtain a Hasse diagram, proceed as follows:
1. Start with the directed graph of the relation in which all arrows
are pointing up.
2. Then eliminate the loops at all the vertices
3. Then eliminate all arrows whose existence is implied by the
transitive property
4. Remove the direction indicators on the arrows.

For the relation given above, the Hass diagram is as follows:


18 9

3
2

Constructing the Hasse Diagram (in-class work)

Consider the “subset” relation ⊆ on the set P({a, b}). That is,
for all sets U and V in P({a, b }),
U⊆V ⇔ ∀ x, if x ∈ U then x ∈ V

Construct the Hasse diagram for this relation.

To recover the directed graph of a relation from the Hasse


diagram, we reverse the instructions:
1. Reinsert the direction markers on the arrows making all
arrows point upward.
2. Add loops at each vertex
3. For each sequence of arrows from one point to a second
point and from that second point to a third, add an arrow
from the first point to the third.
Definition:

Let R be a partial relation on a set A. Elements a and b of


A are said to be comparable if, and only if, either a p b or
b p a. Otherwise a and b are called noncomparable or
incomparable.
In the poset (Z+, |), are the integers 3 and 9 comparable?
Are 5 and 7 comparable?

The adjective partial is used to describe partial ordering


since pairs of elements may be noncomparable.
When every two elements in the set are comparable, the
relation is called a total ordering.

Partially and Totally Ordered Sets:

Given any two real numbers x and y either x ≤ y or y ≤ x.


We say then that elements x and y are comparable.

On the other hand, given to subsets A and B of {a, b, c}, it


may be the case that neither
A ⊆ B nor B ⊆ A. For instance, let A= {a,b}, B={b,c},
then A ⊄ B and B ⊄ A. In such a case, A and B are said to
be noncomparable.

Definition:

If R is a partial order relation on a set A, and for any two


elements a and b in A either:
a p b or b p a, then R is a total order relation on A.
Both the “less than or equal to” relation on sets of real
numbers and the lexicographic order of the set of words in
a dictionary are total order relations.

However, many partial order relations have elements that


are not comparable and are therefore not total order
relations. For instance the subset relation or the divides
relation.

A set A is called partially ordered set with respect to a


relation p if and only if p is a partial order relation on A

A set A is totally ordered set with respect to a relation p iff


A is partially ordered with respect to p and p is a total
order.

Definition:

Let A be a set that is partially ordered with respect to a


relation p . A subset B of A is called a chain iff each pair
of element in B is comparable. In other words, a p b or
b p a for all a and b in B.
The length of the chain is one less than the numbers of
elements in the chain. length(chain)=|chain|-1

A Chain of Subsets:
The set P({a, b, c}) is partially ordered with respect to the
subset relation. Find a chain of length 3 in P

Solution:

Since ∅⊆{a}⊆{a, b}⊆{a,b,c}, the set S= { ∅, {a}, {a,


b},{a,b,c}} is a chain of length 3 in P({a, b,c }).

Maximal and Minimal Elements:


Elements of posets that have certain extremal properties
are important for many applications.

Let a set A be partially ordered with respect to a relation p


A.An element a in A is called maximal element of A, iff
for all b in A, either b p a or b and a are not
comparable.
B. An element a in A is called minimal element if A, iff,
for all b in A either a p b or a and b are not
comparable.
Maximal and minimal elements are easy to spot in a
Hasse diagram; they are the “top” and the “bottom”
elements in the diagram.

Greatest and Least Elements: An element a in A is


called a greatest element of A, iff for all b in A, b p a.

C. An element a in A is called a least element of A, iff,


for all b in A a p b.

The greatest and the least elements are unique if they


exist.
A greatest element is maximal, but a maximal element
need not be the greatest element.

Every finite subset of a totally ordered set has both a least


element and a greatest element.

Similarly, the least element is minimal but a minimal


element need not be a least element.

Furthermore, a set that is totally ordered with respect to a


relation can have at most one greatest element and one
least element.

Topological Sorting:
Suppose a project is made up of 20 different tasks. Some
tasks can only be completed after others have been
finished. How can an order be found for these tasks.
To model this problem, we set up a partial order on the
set of tasks, so that :
a p b if and only if a and b are tasks where b cannot be
started until a has been completed.
To produce a schedule for these tasks, we need to
produce an order for the 20 tasks.

Definition:
A total ordering p is said to be compatible with the
partial ordering R if a p b whenever a R b.

Constructing a compatible total ordering from a partial


ordering is called topological sorting.
Algorithm : Topological Sorting:
procedure topological sort (S: finite poset)
k:=1;
while S ≠∅
begin
ak:= a minimal element of S
S:= S- {ak}
k++
end (a1, a2,…an) is a compatible total ordering of S

Find a compatible total ordering for the poset ({1, 2, 4, 5,


12, 20}, |)

Topological Sorting has an application to the scheduling


of projects.

Job Scheduling Problem:


At an automobile assembly plant, the job of assembling
an automobile can be broken down into these tasks:
A.Build a frame
B. Install engine, power train components, gas tank
C. Install brakes, wheels, tires
D.Install dashboard, floor, seats
E. Install electric lines
F. Install gas lines.
G.Install brake lines
H.Attach body panels to frame
I. Paint body.

Certain of these tasks can be carried out at the same


time, whereas some cannot be started until other tasks
are finished. The table below summarizes the order in
which tasks can be performed and the time required to
perform each task:

Task Immediately Preceding Time needed to


tasks perform task
A 7 hours
B A 6 hours
C A 3 hours
D B 6 hours
E B,C 3 hours
F D 1 hour
G B,C 1 hour
H D,E 2 hours
I F,G,H 5 hours
x p y ⇔ x = y or x precedes y

Let T be the set of all tasks and consider the partial


order relation p defined on T as follows :
For all tasks x and y in T,
x p y ⇔ x = y or x precedes y

What is the time required to build a car?


In order to solve this problem, we need to perform
the following steps:
1. Build the Hasse diagram of this relation.
2. Find a topological sorting and determine the
time required to assemble a car.

PERT and CPM:


Two important and widely used application of topological
sorting are PERT : Program Evaluation and Review
Technique and CPM : Critical Path Method.
They are used to determine the smallest number of hours
after the start in which each task can be finished.

For example task A can be started at once, so it will be


done after 7 hours. We will write the number 7 by the
corresponding circle to indicate it. How we treat task B is
the key to the whole algorithm. This task cannot be
started until A is finished. This will be after 7 hours. So
13 hours are needed before task B is finished.
In case a task is contingent on more than one task for it to
start, we take the time required for the longest one.
The method just described is called PERT. The PERT
method is useful in scheduling and estimating completion
times for large projects, involving hundreds of steps.

Critical Path Method:


The critical path is the sequence of tasks that determine
the time required to finish the whole project.
In the above example, the critical path is:
A-B-D-H-I

Das könnte Ihnen auch gefallen