Can't make a directed graphs in pygraphviz-windows

83 views
Skip to first unread message

Tony Cheng

unread,
Jan 17, 2013, 2:21:42 PM1/17/13
to pygraphvi...@googlegroups.com

I am trying to generate undirected graphs in pygraphviz but have been unsuccessful. It seems that no matter what I do, the graph always turns out directed.

Example #1
G = pgv.AGraph(directed=False)
G.is_directed()  # true

Example #2
G = pgv.AGraph()
G.to_undirected().is_directed()  # True

Example #3
G = pgv.AGraph(directed=False)
G.graph_attr.update(directed=False)
G.is_directed()  # true

I have no idea why something so trivial could not be working. What I am doing wrong?

I'm using pygraphviz v1.1 I got from https://groups.google.com/d/msg/pygraphviz-discuss/ZG4BqWFRR54/gCRlHgl2O5cJ, graphviz 2.28, python 2.7, and windows-7 x64

Aric Hagberg

unread,
Jan 17, 2013, 2:27:34 PM1/17/13
to pygraphvi...@googlegroups.com
Maybe there is a problem with your installation? This works for me:

In [1]: import pygraphviz as pgv

In [2]: pgv.__version__
Out[2]: '1.1'

In [3]: G = pgv.AGraph(directed=False)

In [4]: G.is_directed()
Out[4]: False

In [5]: G = pgv.AGraph()

In [6]: G.is_directed()
Out[6]: False

In [7]: G = pgv.AGraph(directed=True)

In [8]: G.is_directed()
Out[8]: True

In [9]: pgv.test()
....
----------------------------------------------------------------------
Ran 4 tests in 0.357s

OK


Aric

Chris Wj

unread,
Nov 22, 2013, 8:41:18 PM11/22/13
to pygraphvi...@googlegroups.com
I am also experiencing the same behavior with version 1.2 on Windows using WinPython with Python version 2.7.5.
Reply all
Reply to author
Forward
0 new messages