4

After a little work with pygraphviz I've returned to pydot. One of the useful methods in pygraphviz is iterdegree(). Can something analogous be done with pydot? ie: find the highest degree node so that I can set it as root?

jjc

jjon
  • 680
  • 1
  • 8
  • 23

1 Answers1

4

No answer after a year and a half? I don't think there is a way with Pydot without writing some code.

But you could use NetworkX with the networkx.from_pydot() function to convert to a NetworkX graph object and then call the degree() method.

Aric
  • 24,511
  • 5
  • 78
  • 77
  • I know, right? Thanks for your interest. I wound up using pygraphviz, but since then, I've discovered that NetworkX integrates both pygraphviz and pydot. It has both from_pydot and from_agraph methods. The swiss-army knife of python graph packages! I'm accepting this answer because somebody should point this out, and you did. – jjon Jan 17 '14 at 19:24