Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A* and Floodfill algorithms
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Panphobia




PostPosted: Sat Nov 17, 2012 12:38 am   Post subject: A* and Floodfill algorithms

I was wondering if you guys could help me with these two algorithms, I have them searched on wikipedia, but I do not know how to implement them to my advantage. I know you can A* for this question http://dwite.org/questions/haunted_house.html , but i was wondering how I would implement it. Also for flood fill I know you can use it on this question http://dwite.org/questions/oil_spill_area.html , but I also wonder how to implement. If there are guides on this could you guys link me, if not could you explain it to me, preferably in python/java.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Nov 17, 2012 1:25 am   Post subject: RE:A* and Floodfill algorithms

A* is a heuristic. While in practice it might typically give correct results, it's not guaranteed to give the optimal result. http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm is typically the way to go if optimality must be guaranteed. A* is typically used when some optimality can be sacrificed to gain performance (such as in video games).

Wikipedia's entry on Flood Fill http://en.wikipedia.org/wiki/Flood_fill also describes the algorithm in detail.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: