construct a graph
return list of graph vertices
return list of graph edges
BFS(g, v, f)
traverse graph in breadth-first order
gin breadth-first order, starting from
vif provided, or from the first vertex.
fis called for every visited vertex.