So I stumble upon a library called pydot. Which is a python wrapper for the Dot language of Graphviz. Both is open source.
An example i am trying now, after I install pydot
graph = pydot.Dot(graph_type='graph',font='verdana')
graph.add_edge(pydot.Edge('John Doe','person',label='is a'))
It is pretty good, as you can see in pydot.add_edge is to add edge, and you don't need to create a node, because, pydot edge is defined by pydot.Edge(src_node,dest_node)
pydot is included in ubuntu repository.
the project page is in: