Finding the transitive closure of a graph

十年热恋 提交于 2020-01-14 01:36:49

问题


I am trying to calculate a transitive closure of a graph. Let`s consider this graph as an example (the picture depicts the graph, its adjacency and connectivity matrix):

Using Warshall's algorithm, which i found on this page, I generate this connectivity matrix (=transitive closure?), that is different from the one in the picture:

 01111
 01111
 01011
 01111
 01111

I have also tried using this applet which also gives me a different result:

01111
01111
01111
01111
01111

So I'm a little confused right now, since I don't know which matrix is the right one. Can someone shed some light on my problem?


回答1:


C(1,1): The letter T at C(1,1) implies that there should be Ts on the diagonal of A.

C(3,3): One round of the Warshall algorithm only seems to find reachable nodes at a depth of two. Since it takes three edges to reach node number three from itself, one round is not enough.



来源:https://stackoverflow.com/questions/13438865/finding-the-transitive-closure-of-a-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!