Having trouble with Connectivity [closed]
Q.1.2 List all the different ways to connect two different objects for the input/output in the table below:
Input | Output 开发者_Go百科 | Not Output (Connection Already Established)
3-4 3-4
4-9 4-9
8-0 8-0
2-3 2-3
5-6 5-6
2-9 2-3-4-9
5-9 5-9
7-3 7-3
4-8 4-8
5-6 5-6
0-2 0-8-4-3-2
6-1 6-1
A.1.2 (I don't understand this question) How would you answer this? That is you are given a pair, and if the nodes are not connected by other nodes already in the graph it outputs the pair else it does not output the pair because it is already connected based on the data that came before it.
As you describe it I would say
Your table describes a graph:
3<->4
4<->9
etc...
Now given 2 nodes (2 numbers) you need to find all the path from one to another. I guess you can look at this post for an optimise way to find all the paths : Graph Algorithm To Find All Connections Between Two Arbitrary Vertices
精彩评论