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 weighted-edges paths between x and all other vertices by dijkstra's algorithm with heap used as priority queue.
docstr_tok: ["shortest","weighted-edges","paths","between","x","and","all","other","vertices","by","dijkstra","'s","algorithm","with","heap","used","as","priority","queue","."]
code: def dijkstra(self, x, f_io=0, hook=None):
      """
      shortest weighted-edges paths between x and all other vertices by dijkstra's algorithm with heap used as priority queue.
      """
      from collections import defaultdict
      from heapq import heappop, heappush
  
      if x not in self.verticesPoset:
          return None
      if f_io != 0:
          assert self.directed
  
      # initiate with path to itself...
      v = self.verticesPoset.get(x)
  
      # D is the returned vector of distances:
      dic = defaultdict(lambda: None)
      dic[v] = 0.0
      L = [(dic[v], v)]
      while len(L) > 0:
          l, u = heappop(L)
          for e in u.e_dir(f_io):
              v = e.v[0] if (u is e.v[1]) else e.v[1]
              dv = l + e.w
              if dic[v] is not None:
                  # check if heap/D needs updating:
                  # ignore if a shorter path was found already...
                  if dv < dic[v]:
                      for i, t in enumerate(L):
                          if t[1] is v:
                              L.pop(i)
                              break
                      dic[v] = dv
                      heappush(L, (dv, v))
              else:
                  dic[v] = dv
                  heappush(L, (dv, v))
      return dic
  
imports: from graphistry.layout.utils import Poset
label_desc: Use image node_id 19 for calling the GraphBase obj's underlying member method code with example usage: obj.dijkstra(x, f_io, hook) and returns: dic, None