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.
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?