Navigation in Object Graphs
Mitch Wand
and
Karl Lieberherr
Searching for Reachable Objects
• Task: Given an object o1 in an object graph,
find all objects of type c1 that are reachable
from o1.
• Assumptions: we know the class structure
that describes the object graph, but we
know nothing else about the object graph
except the class of the current object.
Classes and Objects: Basic Notations
c1
e
c2
Class c1 has a part e of type c2
c1
c2
Class c1 is an ancestor of class c2
o1
c1
Object o1 is of class c1
o1
o1
c1
e
c2
o2
Object o1 is of type c2
(i.e., its class is a subclass of c2)
Object o1 has a part e which is object o2
Finding the first step for the search
C1
o1
C2
o2
o4
o3
Which arrows might lead
to an object of type C2?
Relations between Classes
C1
e
C2
e(C1,C2)
C1
C2
C(C1,C2) (that is, e(C1,C2) for some e)
C1
C2
C1 <= C2
o1
C1
Class(o1) = C1
o1
C1
C2
Object o1 is of type C2:
Class(o1) <= C2
Relations between Objects
o1
e
o2
e(o1,o2)
o1
o2
O(o1,o2) (that is, e(o1,o2) for some e)
o1
c1
Class(o1) = c1
o1
c1
c2
Object o1 is of type c2:
Class(o1) <= c2
Operations on Relations
• R.S = {(x,z) | exists y s.t. R(x,y) and S(y,z)}
• R* = reflexive, transitive closure of R
Possible edges in the object graph
C1
e
C2
e(o1, o2) implies
class(o1) (<= .e .=> ) class(o2)
in the class graph
“up, over, and down”
o1
e
o2
O(o1, o2) implies
class(o1) (<= .C .=> ) class(o2)
in the class graph
Which edges to follow to C2?
C2
C1
o1
e
o2
*
From o1 of class C1, follow
edge e iff there is some
object graph O and some
o2, o3 s.t.
(1) e(o1,o2),
(2) O*(o2,o3), and
(3) class(o3) <= C2
o3
The existential represents our lack of
knowledge about the rest of the object
graph
From dynamic to static characterization
From o1 of class c1, follow
edge e iff there is some
object graph O and some
o2, o3 s.t.
1. e(o1,o2),
2. O*(o2,o3), and
3. class(o3) <= c2
From o1 of class c1, follow
edge e iff
there are
classes c’, c’’ s.t.
1. c1 <=.e.=> c’
2. c’ (<=.C.=>)* c’’ and
3. c’’ <= c2
Let c’ be class(o2), c’’ be class(o3)
Relational Formulation
From object o of class c1, to get to c2, follow
edges in the set
{e | c1 <=.e.=> (<=.C.=>)* <= c2 }
Can easily compute these sets for every c1, c2 via
transitive-closure algorithms.
Generalizations
• More complex strategies
• “to c1 then to c2 then to c3”
– Use “waypoint navigation”; get to a c2 object,
then search for a c3 object.
• Strategy graphs (a la Lieberherr) also
doable in this framework
Extra Slides
z
x
S
X1
X2
y
Y1
Z1
Y2
Z2
Strategy
S -> T
T
t
X3
x
s1:S
Y3
y
x31:X3
Z3
z
y31:Y3
t
z31:Z3
go down e iff S <=.C C3 =>.(<=.C.=>)*.<=) T
t1:T
z
x
S
X1
X2
y
Y1
Z1
Y2
Z2
Strategy
S -> T
T
t
X3
x
s1:S
Y3
y
x31:X3
Z3
z
y31:Y3
t
z31:Z3
t1:T
go down e iff S <=.C X1 =>.(<=.C.=>)*.<=) T
z
x
S
X1
X2
y
Y1
Z1
Y2
Z2
Strategy
S -> T
T
t
X3
x
s1:S
Y3
y
x31:X3
Z3
z
y31:Y3
t
z31:Z3
t1:T
<=,=>
go down e iff S <=.C X1 =>.(<=.C.=><=.C.=><=.C=>).<=) T not
used
class dictionary
A
B
R
S
C
X
T
D
=
=
=
=
=
=
=
=
[“x” X] [“r” R].
[“b” B] D.
S.
[“t” T] C
D.
B.
0..1
R.
.
strategy
A -> T
T -> D
Example
0..1
X
B
A
D
C
0..1
R
class
graph
S
:C
0..1
T
:D
:A
:R
:S
object
graph “r”
class dictionary
A
B
R
S
C
X
T
D
=
=
=
=
=
=
=
=
[“x” X] [“r” R].
[“b” B] D.
S.
[“t” T] C
D.
B.
0..1
R.
.
strategy
A -> T
T -> D
Example
0..1
X
POSS(A,T,a1) = 1 edge
POSS(R,T,r1) = 1 edge
POSS(S,T,s1) = 0 edges
B
A
D
C
0..1
R
class
graph
S
0..1
T
a1:A
r1:R
:C
:D
object
s1:S graph “r”
class dictionary
A
B
R
S
C
X
T
D
=
=
=
=
=
=
=
=
[“x” X] [“r” R].
[“b” B] D.
S.
[“t” T] C
D.
B.
0..1
R.
.
strategy
A -> T
T -> D
Example
0..1
X
POSS(A,T,a1) = 1 edge
POSS(R,T,r1) = 1 edge
POSS(S,T,s1) = 1 edge
B
A
D
C
c2:C
d2:D
0..1
R
class
graph
S
0..1
T
a1:A
r1:R s1:S
c1:C
t1:T
:D
r2:R
Only node paths shown for space reasons
Object graph
Example 1
strategy:
{A -> B
B -> C}
Strategy s
t
:A
A
B
x1:X
class graph
S
e1:Empty
:R
R
x2:X
A
Empty
B
c3:C
OG :
OG’:
SG :
(CG:
x
x
c1:C
c2:C
A X
A X
A
A X Bopt
C
R X C
B X C
B
C
B X C)
c
X
b
BOpt
c
C
Only node paths shown for space reasons
Example 1A
Object graph
early
termination
:A
strategy:
{A -> S
S -> C}
Strategy s
t
A
S
x1:X
class graph
S
e1:Empty
:R
R
x2:X
A
Empty
B
c3:C
OG :
OG’:
SG :
(CG:
x
x
c1:C
c2:C
A X
A X
A
A X Bopt
C
R X
B X
B
B X)
c
X
b
BOpt
c
C
S = from BusRoute through Bus to Person
Example 2
busStops
BusRoute
BusStopList
buses
BusList
0..*
0..*
NGasPowered
waiting
passengers
Bus
DieselPowered
BusStop
PersonList
Person
0..*
OG : BR BL DP PL P
OG’: BR BL B PL P
SG : BR
B
P
Example 2
Only node paths shown for space reasons
Route1:BusRoute
busStops
buses
BusList
:BusStopList
CentralSquare:BusStop
waiting
:PersonList
Bus15:DieselPowered
passengers
:PersonList
Joan:Person
Paul:Person
Seema:Person
S = from BusRoute through Bus to Person
Eric:Person
OG : BR BL
OG’: BR BL
SG : BR
Example 3
Only node paths shown for space reasons
Route1:BusRoute
busStops
buses
early
termination
BusList
:BusStopList
CentralSquare:BusStop
waiting
:PersonList
Bus15:DieselPowered
passengers
:PersonList
Joan:Person
Paul:Person
Seema:Person
S = from BusRoute via NGasPowered to Person
Eric:Person
© Copyright 2026 Paperzz