I have created a 500 nodes in a graph, and assigned 3 edges(directed) for each node to any other nodes excluding itself. (no self loop)
I randomly pick half of the nodes, and mark them as fail. (250 nodes are alive, and the other 250 nodes are marked as fail)
I randomly pick a node that is alive, and traverse using its edges. (3 edges for each node)
The traversing algorithm looks like below, and it will be initiated with any alive node.
public void traverse(Node p){ if(p.fail||p.visited){ //if node is marked as fail or has been visited already, return return; } p.visited = true; //mark it as visited for(int i = 0;i
What should be the average percentage that this operation end up traversing all the alive nodes? (start from random node, and see if graph is connected or not in the node's viewpoint)