search


Prolog: How to get a path from a start node to a Goal Node


I'm trying to write a prolog program that will represent a goal node G and will return a list of nodes from a predicate called something like get_path(StartNode, Path) from the start node to the goal node.
I have a set of nodes, each with a heuristic value, some successor arcs to travel from one node to another, and a cost for doing so. The heuristic values for each are:
h(a,12).
h(b,8).
h(c,4).
h(d,3).
h(f,5).
h(e,5).
h(g,0).
And the successor arcs and associated costs are:
s(a,b,3).
s(a,c,6).
s(b,d,4).
s(b,e,2).
s(d,e,2).
s(d,g,1).
s(e,g,3).
s(c,e,5).
s(c,f,4).
s(f,g,7).
I have drawn out a chart that maps all the node routes I can take, and as such I know that both a->b->e->g and a->b->d->gis the cheapest paths I can follow, each with a total cost of 8.
However I'm just not entirely sure what kind of predicate I should write that will take in this information as well as output my results needed.
Do I use breadth first search?
And where does the Heuristic value come into play with the solution?
Any help at all would be majorly appreciated, thanks.

Related Links

Photo search using popular tag with Flickr API sometimes returns empty results
How to implement search on a webapp / website
Find the next occurrence of a variable in vim
How to search a Doctrine NestedSet?
Macro to Search for a string in a work book which may present multiple times
A* Search Algorithm gets stuck
Best Indexing Platforms
Rails 3 Search: Searchlogic vs Thinking_Sphinx
What are some good cloud or 3rd party search providers out there?
How do I structure Solr cores for multiple locales and content types?
html5 search input events
search copies of data from all over internet
How can I access child object property in Compas Search framework?
Anyone Know of a Free Site Search?
Using Lucene just as an inverted index
Get the last search or search&replace string back in vim?

Categories

HOME
prism
time-complexity
codenvy
github-for-windows
zend-framework
mstest
error-handling
pclxl
knitr
telegram-bot
pyqt4
interpolation
code-coverage
frontend
lanczos
modal-dialog
bing-maps
rcloud
qpython
fabric.io
32bit-64bit
octave
plist
ipmitool
tput
libc
intercom
do-while
soci
poedit
ios10.2
mongoid6
strongname
ckfinder
winexe
tpm
mql
dotspatial
panoramas
css-position
resolution
azure-arm
visa
branching-and-merging
preloader
flask-login
vaadin-charts
oim
flask-restful
getchar
fwrite
dotnet-httpclient
wcftestclient
corruption
context-switch
video-conferencing
yii2-user
subnet
headless
meteor-packages
reporting-services-2012
winusb
seek
cfchart
gcloud-ruby
boost-serialization
beanstalk
tfs-workitem
pypiserver
microsoft-reporting
doctype
evolus-pencil
dulwich
zxspectrum
dot.js
procedural-programming
adehabitathr
theos
beatsmusic
crowd
genymotion-call
psr-4
cbind
with-statement
gae-quotas
spring-3
printdialog
facebook-timeline
stacky
cascadingdropdown
alice
resource-management
redis-py
faye
httponly
window-decoration
workflow-services
android-holo-everywhere
xcelsius
google-floodlight
entitydatasource
msr
drupal-fivestar
interprocess
zen
burndowncharts
skype4java
lalr
software-lifecycle
localizable.strings
great-circle

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App