开发者

Having trouble with Connectivity [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜