reset password
Author Message
rkmx52
Posts: 23
Posted 14:30 Oct 19, 2014 |

From what I understand so far, it seems like a non-binary tree has to be used so that each leaf in a node represents an adjacent country. I am not sure how to get started with this though, i.e. am I going to have to manually add the 54 countries in the tree in a way that each leaf is an adjacent node?

Last edited by rkmx52 at 14:33 Oct 19, 2014.
msargent
Posts: 519
Posted 16:05 Oct 19, 2014 |

You will need to specify a successor function: you input a country, output a set of countries adjacent to it. For generating the search tree during your search, all you do is assign a color to a new country to get a child state.

rkmx52
Posts: 23
Posted 17:59 Oct 19, 2014 |

So it sounds like the successor function is going to be a long wall of code? I guess my main question is, is there going to be a lot of manual condition checking for the 54 countries?

msargent
Posts: 519
Posted 18:37 Oct 19, 2014 |

My suggestion at this point is to use a dictionary of a string of each country as the key and a set of adjacent countries as its value. Use the dictionary in the successor function.  Unfortunately this information has to be in the program somewhere. It shouldn't take that long to do (about 20 minutes maybe). 

Last edited by msargent at 18:43 Oct 19, 2014.
rkmx52
Posts: 23
Posted 18:59 Oct 19, 2014 |

That makes sense now, thanks.