有沒有辦法在pydot中實現這一點?尋找開始,結束並與pydot循環
採取下面的例子:
[輸出點文件]
strict graph g{
"A" -> "B";
"B" -> "C";
"C" -> "D";
"D" -> "E";
}
[Python的]
print(num.start)
>>> A
print(num.steps)
>>> ["a,b","b,c","c,d","d,e"]
print(num.end)
>>> E
或與下列情況下:
[輸出點文件]
strict graph g{
"A" -> "B";
"B" -> "C";
"C" -> "A";
}
[python]的
if num["A"] == num.loop:
print("[%s] loop detected")%(num["A"])
爲了將來的參考,我有一個使用networkx在點圖中標識週期的python腳本示例:http://blog.jasonantman.com/2012/03/python-script-to-find-dependency-cycles -in-graphviz-dot-files /感謝Jochen爲我提供鏈接以提供腳本。 – 2012-03-29 03:06:11