class_docstr: A connected graph of Vertex/Edge objects. A GraphBase is a *component* of a Graph that contains a connected set of Vertex and Edges.
  
  Attributes:
      verticesPoset (Poset[Vertex]): the partially ordered set of vertices of the graph.
      edgesPoset (Poset[Edge]): the partially ordered set of edges of the graph.
      loops (set[Edge]): the set of *loop* edges (of degree 0).
      directed (bool): indicates if the graph is considered *oriented* or not.
class_docstr_tok: ["A","connected","graph","of","Vertex\/Edge","objects",".","A","GraphBase","is","a","*","component","*","of","a","Graph","that","contains","a","connected","set","of","Vertex","and","Edges",".","Attributes",":","verticesPoset","(","Poset","[","Vertex","]",")",":","the","partially","ordered","set","of","vertices","of","the","graph",".","edgesPoset","(","Poset","[","Edge","]",")",":","the","partially","ordered","set","of","edges","of","the","graph",".","loops","(","set","[","Edge","]",")",":","the","set","of","*","loop","*","edges","(","of","degree","0",")",".","directed","(","bool",")",":","indicates","if","the","graph","is","considered","*","oriented","*","or","not","."]
docstr: shortest path between vertices x and y by breadth-first descent, contrained by f_io direction if provided. The path is returned as a list of Vertex objects.
  If a *hook* function is provided, it is called at every vertex added to the path, passing the vertex object as argument.
docstr_tok: ["shortest","path","between","vertices","x","and","y","by","breadth-first","descent",",","contrained","by","f_io","direction","if","provided",".","The","path","is","returned","as","a","list","of","Vertex","objects",".","If","a","*","hook","*","function","is","provided",",","it","is","called","at","every","vertex","added","to","the","path",",","passing","the","vertex","object","as","argument","."]
code: def path(self, x, y, f_io=0, hook=None):
      """
      shortest path between vertices x and y by breadth-first descent, contrained by f_io direction if provided. The path is returned as a list of Vertex objects.
      If a *hook* function is provided, it is called at every vertex added to the path, passing the vertex object as argument.
      """
      assert x in self.verticesPoset
      assert y in self.verticesPoset
      x = self.verticesPoset.get(x)
      y = self.verticesPoset.get(y)
      if x == y:
          return []
      if f_io != 0:
          assert self.directed
      # path:
      p = None
      if hook is None:
          hook = self.constant_function(False)
      # apply hook:
      hook(x)
      # visisted:
      v = {x: None}
      # queue:
      q = [x]
      while (not p) and len(q) > 0:
          c = q.pop(0)
          for n in c.neighbors(f_io):
              if n not in v:
                  hook(n)
                  v[n] = c
                  if n == y:
                      p = [n]
                  q.append(n)
              if p:
                  break
      # now we fill the path p backward from y to x:
      while p and p[0] != x:
          p.insert(0, v[p[0]])
      return p
  
imports: from graphistry.layout.utils import Poset
label_desc: Use image node_id 18 for calling the GraphBase obj's underlying member method code with example usage: obj.path(x, y, f_io, hook) and returns: p, list