Road-map path-finding


A road-map path-finding problem.

Source: PROLOG programming for artificial intelligence, 3rd Edition, Harlow, 2001, ISBN 0-201-40375-7.


Program source code:


%  A road-map path-finding problem
%  The interesting probem is path from s to t
s( X, Y, C)  :-  c( X, Y, C); c( Y, X, C).
c( s, a, 2).  c( a, b, 2).  c( b, c, 2).  c( c, d, 3).
c( d, t, 3).  c( t, g, 2).  c( g, f, 2).  c( f, e, 5).
c( e, s, 2).
% heuristic estimates are the direct distances to t
h( s, 7).   h( a, 5).  h( b, 4).  h( c, 4).  h( d, 3).
h( e, 7).   h( f, 4).  h( g, 2).  h( t, 0).


pl/prolog/pllib/road-map_path-finding.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna) Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0