A simple example showing how to use the graph interface for in python.
4 from __future__
import print_function
12 for i
in range(0, 10):
14 vs.append(g.add_vertex(ps[-1]))
15 g.add_edge(vs[0], vs[1])
16 g.add_edge(vs[1], vs[2])
23 print(
"Oh well, no altgraph")
28 matplotlib.use(
"macosx")
29 import matplotlib.pyplot
as plt
32 xg = IMP.get_networkx_graph(g)
40 print(
"networkx not fully installed")
48 print(
"oh well, something not working with graphviz")
52 for n
in g.get_in_neighbors(8):
53 print(g.get_vertex_name(n).get_name())