I would like to ask, when this algorithm finished, when you put all of the nodes in the tree and the fringe is empty, or when you reach the destination node?
8 replies to this topic
#1
Posted 26 April 2011 - 10:04 AM
|
|
|
#2
Posted 26 April 2011 - 10:12 AM
It ends when all nodes have been visited.
#3
Posted 26 April 2011 - 10:28 AM
So, what happened if you can't visit all nodes?
#4
Posted 27 April 2011 - 05:28 AM
Well, since it's for a connected graph you'd have some issues now, wouldn't you.
#5
Posted 27 April 2011 - 06:09 AM
The problem is that, node "A" goes to 3 different nodes, but no other node goes to "A". My restriction is that i have to start from "B" so always i can't visit "A"
#6
Posted 27 April 2011 - 07:21 AM
Then all nodes have been visited.
#7
Posted 28 April 2011 - 01:39 AM
What do you mean all nodes have been visited? what about "A"?
#8
Posted 29 April 2011 - 03:05 PM
You don't make a big list of all the nodes in your graph and then 'remove' them as they are visited. You create a dynamic list from your starting node. And as you visit each node you add to this list any nodes that haven't already been visited (and remove the one you are at). When the 'nodes to visit' list is empty, you are done. In your case, node 'A' would never be added to the 'nodes to visit' list, as there is no way to get to it.
#9
Posted 30 April 2011 - 09:05 AM
Can i have an example with this situation please?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









