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

I need search text in parent search box but to search in iframe of another link and post results there
How to detect an entered search query as a surround query or as a normal lucene core library query
With ack (or something similar), how do I exclude sub-directories
Can't do backtrack research in OCaml
Sitecore Lucene search indexing and subfolders
Wicket dataprovider query / search time
Use termfreq(field,term) function for phrase with space in SOLR 4.1
ElasticSearch may have failed to start
Full text searches on product codes
how to find where a stored procedure is being used
Solr phonetic search not finding anything
SOLR - Optimise the relevance of search results
SOLR/Lucene weighting by user-centric criteria
Most efficient way to detect Google Voice Search installation on Android device
replace multiple values with regular Expression (Extended search mode) in notepad++ [closed]
concatenating string to solr field value while searching?

Categories

HOME
django
grok
rdbms
interface
solaris
static-site
carousel
azure-container-service
banner
categorical-data
google-chrome-app
dkim
microsoft-dynamics-nav
standards
enterprise-miner
oledb
solrcloud
gmock
definitelytyped
itunes
bringtofront
gp
xbox
sql-server-2000
turfjs
mailkit
gojs
least-squares
salesforce-communities
reactivekit
gdata
loading
opensmpp
tasm
dbnull
contract
knime
file-sharing
optimizely
phpdbg
jboss-4.2.x
builder
netbeans6.8
trojan
amq
tinkerpop
skin
pdf-conversion
css-transforms
jtree
baidu
cronexpression
slackware
macaulay2
i386
delta
angular-ui-typeahead
php-socket
cda
halcon
terracotta
dllimport
django-urls
bufferedinputstream
entity-framework-4.3
fits
rrule
bcache
beatsmusic
contrast
punycode
teaspoon
insight.database
live555
winginx
synapse
xmltodict
code-duplication
inputmismatchexception
oocss
printdialog
observium
pclzip
mantle
idn
subgraph
cuda-gdb
stress
google-maps-mobile
appledoc
timertask
maven-1
web-garden
blender-2.49
feasibility
visualj#
int64
technical-debt
blind

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