2
0
mirror of https://github.com/boostorg/graph.git synced 2026-01-30 20:02:12 +00:00

Started documenting Python bindings

libs/graph/src/python/basic_graph.cpp, libs/graph/src/python/basic_graph.hpp:
  - Allow one to build a graph from anything that looks like a Python list or
    tuple.


[SVN r28324]
This commit is contained in:
Douglas Gregor
2005-04-19 17:01:07 +00:00
parent 003e90151e
commit 631d35bcc2
13 changed files with 314 additions and 24 deletions

View File

@@ -0,0 +1,14 @@
from bgl import *
class bfs_print_discover_visitor(Graph.BFSVisitor):
def discover_vertex(self, u, g):
print "Discovered vertex ",
print u
g = Graph((("r", "s"), ("r", "v"), ("s", "w"), ("w", "r"), ("w", "t"), ("w", "x"), ("x", "t"), ("t", "u"), ("x", "y"), ("u", "y")))
iter = g.vertices.__iter__()
iter.next()
s = iter.next()
breadth_first_search(g, s, visitor=bfs_print_discover_visitor())