Documente Academic
Documente Profesional
Documente Cultură
GRAPH
A graph consists of a set of nodes and a set
of arcs and links connecting pairs of nodes.
In the state space model of problem
solving, the nodes of a graph are taken to
represent discrete states in a problem
solving process, such as the results of
logical inferences or configuration of a
game board.
The arcs of the graph represent transitions
between states. These transitions
correspond to logical inferences or legal
moves of a game. In expert systems for
example, states describe our knowledge of
a problem instance at some stage of a
reasoning process. Expert knowledge in the
form of If.. Then.. Else, allows us to
generate new information; the act of
applying a rule is represented as an arc
between states.
RIVERBANK 1
3
ISLAND 1
ISLAND 2
6
RIVERBANK 2
b4
b3
b1
i1
i2
b6
b7
b5
rb2
connect(i2,i1,b1)
connect(rb1,i1,b2)
connect(i1,rb1,b2)
connect(rb1,i1,b3)
connect(i1,rb1,b3)
connect(rb1,i2,b4)
connect(i2,rb1,b4)
connect(rb2,i1,b5)
connect(i1,rb2,b5)
connect(rb2,i1,b6)
connect(i1,rb2,b6)
connect(rb2,i2,b7)
connect(i2,rb2,b7)
rb1
b2
b4
b3
b1
i1
i2
b6
b7
b5
rb2
F W
C G
South Shore
Problem Representation
The key to problem solving is a good
representation. A good representation
scheme has the following properties:
An initial state
A goal state
Initial
01
02
03
04
Goal
For Example
Consider again the farmer and his boat. In
this problem state information can be
represented in the form of the following 4tuple
Farmer
Wolf
Goat
Cabbage
a?
b?
c?
d?
)
Each variable position stores the location
of a particular object. For example the
initial state where everyone is on the south
bank is given by (S,S,S,S) while the goal
state is represented by (N,N,N,N). There
are 4 state transforming operators: Farmer-Takes-Self:
(a?,b?,c?,d?) (Opposite(a?), b?,c?,d?)
Farmer-Takes-Wolf:
(a?,b?,c?,d?) (Opposite(a?), Opposite(b?),c?,d?)
Farmer-Takes-Goat:
(a?,b?,c?,d?) (Opposite(a?), b?,Opposite(c?),d?)
Farmer-Takes-Cabbage:
(a?,b?,c?,d?) (Opposite(a?), b?, c?,Opposite( d?))
Cont..
Here is one 7 step solution to the boating problem. There are of
course other possibilities.
S1: (S,S,S,S)
S2: (N,S,N,S)
F G
N
FWGC
S4: (S,S,N,S)
F W G
C
S5: (S,N,S,S)
W
F G C
S8: (N,N,N,N)
F W G C
W C
S3: (N,N,N,S)
G
F W C
S6: (N,N,S,N)
F W C
G
S7: (S,N,S,N)
W C
F G